sorry, didn't know gaf had code blocks!Can you please indent the code and put it in code blocks?
sorry, didn't know gaf had code blocks!Can you please indent the code and put it in code blocks?
So I shouldn't waste time learning SAS in a week? Any tips on what I should do to prepare?
Is your singleton defined in a static library that is linked into multiple different shared libraries?
It is defined in one shared libraries and used by other two libs and the main application. Though 3 instances are generated in this process. I can see why I'm having this problem but I don't know if there's some workaround on linux.
I have a couple of theories, but rather than throw darts and hope I hit something, can you post the code for the singleton?
Here it is!
Code:template <class T> class Singleton { public: static T& instance() { static T instance; return instance; } private: Singleton(); ~Singleton(); Singleton(Singleton const&); Singleton& operator=(Singleton const&); };
As an aside, I find that singletons are almost never a good idea. They kill testability for starters.
They're good for quick and dirty global state management, but, past the rapid prototyping stage, you should be either passing a global state context as a parameter if your leaning more towards C-style coding or wrap your application in an object if your programming in C++ or really any object oriented language.
They're also good for enhancing performance in situations where a lot of a similar object are being created by separate actors (things like formatter objects ).
Probably a tiny bit OT, but probably not as this this is probably common here.
I may be going to San Jose, anyone who lives there or nearby interested in PMing me or just posting your opinions about the place and what to expect?
I live in LA. :/
More like the junior programmer that interviews you and has no ifea what that is. Assumes it's not rock solid because there's no ISortable interfaceBeing fluent in haskell must be rad. Like, get a interview question, write 3 lines and drop the mic. At least that's how I imagine it.
I want to become a talented software developer/engineer and while I feel I am learning a lot at my job I also feel like I'm still an awful programmer. What are ways to really improve a lot? Just keep doing some random practice problems? I feel like I don't really know anything and at this point I'm not even sure how I got my Bachelor's
Learn something nobody else knows. My recomendation: www.learnyouahaskell.comI want to become a talented software developer/engineer and while I feel I am learning a lot at my job I also feel like I'm still an awful programmer. What are ways to really improve a lot? Just keep doing some random practice problems? I feel like I don't really know anything and at this point I'm not even sure how I got my Bachelor's
Rust is awesome. I've been doing engine programming in it for a few weeks and now it feels like the One True Language. Encouraging my job to switch from C#/Unity to Rust/OpenGL.
Why Rust vs C++ just out of curiosity? I'm guessing it comes down to ease of use but I'm curious as to what features make Rust more appealing than years of C++ examples, materials, libraries, etc.
I do love the small size of the language and Cargo from what I have seen.
Thanks Slo, great advice and you're right that I shouldn't rush into a decision. I'm lucky in the sense that for a long while now (since the start of the decline) I've been following FI blogs like MMM and have managed to build up a bit of a buffer.
This has been a long time coming for me tbh, but going back to the language I used to love and still hating it has made me realise I'm just not cut out for it any more
I'm still hoping to do a little bit of work and programming from home, maybe even enough to maintain our pretty modest lifestyle - though the way I feel right now I never want to see another line of code again x_x
Rust has most of my favorite features including tuples, options, unions, and pattern matching. But it also has a unique memory model that guarantees several classes of bugs won't happen. No explicit memory management - malloc and free are inserted by the compiler without the hit of a garbage collector or reference counter.Why Rust vs C++ (or even just C#) just out of curiosity? I'm guessing it comes down to ease of use but I'm curious as to what features make Rust more appealing than years of C++ examples, materials, libraries, etc.
I do love the small size of the language and Cargo from what I have seen.
Like is it a fun place to live. What's cool about it, what sucks about it. I mean I'm coming from LA where everything is, so I just want to know what to expect.What kind of opinions? Having to do with programming somehow? Job market related? I live in SJ but not sure what you're looking for
Man I am about to graduate in couple of semester and most intern jobs I see are for JavaScript. Is there really a high demand for it? So far I mostly know c++ and java.
Web related jobs are the most prevalent, so yes.
Man I am about to graduate in couple of semester and most intern jobs I see are for JavaScript. Is there really a high demand for it? So far I mostly know c++ and java.
Yeah I am gonna start learning JavaScript this winter break. Since I am already proficient with c++ and java i can pick up the basics fast I hope.
Practice on your own time. Seek out books and/or tutorials. Go to local meetups. Don't be afraid of failure, keep pushing yourself to try new things. Etc, etc.
Learn something nobody else knows. My recomendation: www.learnyouahaskell.com
Like is it a fun place to live. What's cool about it, what sucks about it. I mean I'm coming from LA where everything is, so I just want to know what to expect.
I know SF is like an hour north, and I'll probably check it out once in a while.
Ah, I'm really glad you're enjoying Unity a bit more than what you were working on previouslyI've been feeling the same way for a few years now. Been doing it professionally since shortly after the tech bubble burst. For me at least, I think it came down to what I was developing. I simply cannot stand doing anything web related anymore. Front-end or back-end, it is all stupid and I hate it. All the same crap over and over again with a "new" coat of paint which ends up just being an abstraction over what you were doing before. More pain when your site has to be IE compatible. Not just one browser but you have to test with 8, 9, 10, 11. Jeez. Sucks that that's where 90% of the jobs are.
I've turned to Unity development recently and am a lot happier. Things that are actually new to me. It may not be programming you are tired of but what you are programming.
Going into management is another option for you.
Thanks for the advice, both of you
I haven't but I've watched most of Jon Blow's series on his.Anyone ever taken a stab at creating their own language?
I haven't but I've watched most of Jon Blow's series on his.
https://www.youtube.com/playlist?list=PLmV5I2fxaiCKfxMBrNsU1kgKJXD3PkyxO
https://www.youtube.com/playlist?list=PLmV5I2fxaiCIZVTLzofsocka2LvWBFvBa
It goes into really specific detail about both design and implementation so it's a great resource.
Well, a couple, if only to train with L&Y (several stupid/toy ones, too).Anyone ever taken a stab at creating their own language?
Guys I have to learn ruby on rails for work. So I bought a course from udemy and they recommend cloud 9 for IDE, but it seems to me that they ask for a credit card info even for the free version. Don't feel comfortable giving my credit info for a free version. Is it ok to give cloud 9 my credit info? I just hope i don't get unwanted charges on my card lol.
Alright this is one of the cases that I suspected. In theory this is supposed to work (on Linux anyway, but not necessarily on Windows), but declaring function local statics inside of a header file is a really bad idea because there are some *really* subtle rules about when it's supposed to work and when it's not. In this case I'm pretty sure it's supposed to work, but given how ugly this part of the language is, I would advise using a different approach.
What's *supposed* to happen is that the function local static is supposed to get a unique mangling, COMDATted, and then when these shared libraries load it's supposed to resolve the symbol based on the mangling so that only a single copy of it is being used. Note that on Windows this isn't the case, multiple DLLs (i.e. shared libraries) that included this header would be guaranteed to get a separate instance of the static.
If you're using an old compiler, it's possible this isn't working. Or there could be something else going on.
If you want to delve into this deeper, you could use a tool like nm to display the symbols in each .so file and verify that they have unique names.
On the other hand, I would probably just implement singleton-ness at the class level. Do you really need it to be this generic? You could make a Singleton<int> using this class, which is kind of non-sensical if you think about it. If Foo needs to be a singleton, just put the logic directly into Foo, and put the implementation into the cpp file.
As an aside, I find that singletons are almost never a good idea. They kill testability for starters.
I wanted a way to create a singleton without needing to declare an instance method in each class. But in the end I came back to the old manner. Also, from nm, I was getting different symbols in each shared object. I think that makes sense because it generated a template instance for each shared obj compilation. Thanks!
About Rust, how is the community? I was interested on it sometime ago.
That's waht I thought about D a LOOOONG time ago.Pretty much everything about Rust seems way better than C++ except the availability of libraries.
Indeed.It's actually kinda crazy how terrible the package management situation around one of the dominant programming languages is.
I know this is crazy but my money's on Jon Blow's Jai to replace C++. It can beat C for performance if it's easy to make cache-friendly code. He already got it to compile instantly.
I'm thinking the same, too. C++ will be replaced when we'll look for an alternative, not when an alternative is available. Better languages (keeping the same advantages) are already available, even if they don't have the manpower behind them..The world isn't ready for a C++ replacement yet. There is too much mission critical software dependent on it, too much library code written in it, and too much industry weight behind it.
Probably, although each time C++ "eats" such a new feature, its syntax becomes uglier. When you add grammar special rules to deal with grammar conflicts, you know it's getting bad.If a new language comes along and does X, Y, and Z better than C++, then the standards committee will adopt X, Y, and Z for inclusion in C++ 10 years from now, which is not long enough for the new language to make a significant dent in C++'s market share, and even if it does X, Y, and Z worse than those languages, it'll be good enough for the maintainers of the trillions of lines of existing C++ code to not put significant effort towards switching.
I think that's Go's niche. Enormous growth in Go this year while C is in large decline - at least according to Tiobe.https://rocket.rs/
There's also a non-zero chance that Rust finds a niche as a language for web development. Probably not usually as the main language of a backend, but we are seeing it be used to replace C where C is used to make performance bound parts of software faster, while the rest is still Python/Ruby/JavaScript. And using Rust from Python/Ruby/JavaScript is actually really easy.