5 ms·
Sincerely, from the bottom of my heart: It doesn't matter I have some familiarity with some of the systems described (and with other systems that use C++). Let
by raverbashing 14y ago
Sincerely, from the bottom of my heart: It doesn't matter
I have some familiarity with some of the systems described (and with other systems that use C++). Let me put it this way:
- Large enterprise projects are bad
- Large enterprise projects in C++ are very bad. It's like giving razor blades to a kindergarten group for a whole afternoon. I wish I was kidding
- "Done in C++" is not as important as the capabilities of the platform targeted
C++ is good, and very powerful. And I have a million reasons not to use it unless absolutely necessary.
If you want to use it I'll give you 3 tips:
- Focus on STL and maybe Boost (use it sparringly and wisely! don't overdo it)
- Avoid inheritance hell
- Don't go crazy with Templates, in fact don't even use them (except for what's in STL already)
- kombine 14y ago> Don't go crazy with Templates, in fact don't even use them (except for what's in STL already) What's wrong with templates? This is the most powerful feature of C++ allowing for Generic programming, Polymorphism and metaprogramming. The latter is of course clunky considering C++ syntax, but overall templates are great. And STL is the best thing that happened to the C-like family of the languages.
- raverbashing 14y agoThe problem is that, as expected in a strongly typed language, you can't do real Generic programming, even with templates. Or even adding another inheritance level (which makes some things easier) Because type 'fixing' (that is, knowing what you need) happens at compile type, for example, duck typing ("even with" dynamic_cast - yes, dynamic_cast works at run-time, but you're limited in what kind of objects - by your inheritance hierarchy - can be present at the time you're doing the dynamic_cast) You end up having to specify the type, you don't have a 'Generic' type. And you may have to deal with dynamic_cast And read again, I'm not against STL, they 'get' templates. Edit: confusing explanation
- kombine 14y ago> You end up having to specify the type, you don't have a 'Generic' type. And you may have to deal with dynamic_cast Do you really need one? Because then you really are dealing with run time polymorphism, whereas templates are all about compile time. I recommend checking D programming language out. It has very powerful templates with a nicer syntax than C++ and a lot of other things aiding metaprogramming. Moreover with Ranges you get an implementation of ideas laid out in STL but with a better syntax and matching the power of what is in proper functional languages.
- nitrogen 14y agoQt is capable of lazy typing in C++ using QObject and QVariant, though it also adds its own meta-object compiler on top of the C++ compiler.
- apaprocki 14y agoWhich is really no different than using GObject and GValue from GLib / Gnome world. (Even using a meta-object GOB compiler :))
- nitrogen 14y ago... or using a union with an enum in plain C: struct data { void *data; size_t length; }; union value { char *zstr; int intgr; float flt; struct data *data; }; enum type { STRING, INTEGER, FLOATING, DATA, };
- Jabbles 14y agoSo what language would you recommend writing Windows in? Firefox/Chrome? LLVM? What are your reasons for recommending said language over C++?
- raverbashing 14y agoWindows: for lower level, C. like Linux and Mac OS X. For higher level development, C++ or just go with C# Firefox/Chrome: C++ looks like a good choice, still, there's a lot of JS behind them as well if I'm not mistaken. Now, Go may be a good choice LLVM has interesting requirements, it needs to be both fast and needs a lot of 'flexibility'. I would probably try making the next LLVM version in PyPy (which uses LLVM itself), so it maybe bootstrap itself using CPython first, hence bringing us one step closer to Skynet. But in general Go/C#/PyPy may be steps in the right direction (Java is too afraid of new things being added to C# like anonymous functions, so it's behind)
- CCs 14y ago> For higher level development, C++ or just go with C# The facts: C# was created in 2000. After 12 years Microsoft still does not sell a single app written in C#. Not one. C# is used for PowerShell (free) and MSN (free, the backend is mixed C# and Java). This is not likely to change anytime soon: pretty much all Microsoft job openings require C++. Also for new projects MS recommends JavaScript or C++. Python is not better off either: Google does not allow Python code in anything that can be seen by end user. (Youtube is Python, but it was bought, not built.) I'm not saying C++ is perfect, just that for some use cases it is pretty good. For some other use cases obviously it is not the best choice. Peter Norvig: "I think that language choice is not as important as all the other choices" http://news.ycombinator.com/item?id=1803815 http://news.ycombinator.com/item?id=1803815
- raverbashing 14y agoI have heard these things about C#. Too bad, because I think this is one thing Microsoft nailed. Sure, it has its warts, some parts of the library have to be improved, etc, still. Also for new projects MS recommends JavaScript or C++. This was one of the clashes between Microsoft divisions, the division between the new Metro (JS) and the rest, can't remember which side Sinofsky was on this. Of course, to work at MS you have to know C++ " Google does not allow Python code in anything that can be seen by end user" really?! Didn't know that, maybe it has to do with their infrastructure and the way it scales. Can't say I blame them (still, GAE runs python)