5 ms·
The fact that very few web applications use C++ doesn't mean that using C++ is a bad idea. Most web applications are absolute garbage, both in terms of the con
by cperciva 19y ago
The fact that very few web applications use C++ doesn't mean that using C++ is a bad idea. Most web applications are absolute garbage, both in terms of the concepts behind them and the actual implementations.
Personally, I write code in C. Does this mean I write fewer lines of code? Possibly. Does it mean that I write fewer GOOD lines of code? Definitely not. Working in C forces me to think about what I'm doing in a way that I wouldn't do if I were using a more flexible language like perl; and as I've written about before, I firmly believe that thinking before coding is a key ingredient in producing good code.
Returning to the original question: I would never work for a startup which was using C++ or Java, simply because those languages are too flexible. If you don't know what function pointers are, you shouldn't be using them -- and that applies doubly if you don't even realize that you're using them.
- aston 19y agoAs an aside, function pointers are the closest C++ has to lambdas. If C++ is too flexible for having them, you shouldn't go near anything LISPy.
- nostrademons 19y agoWell, technically boost::lambda (http://www.boost.org/doc/html/lambda.html http://www.boost.org/doc/html/lambda.html) is the closest C++ has to lambdas. ;-)
- aston 19y agoThose boost kids...They do great work.
- jey 19y agoboost::lambda still blows. I avoid using C++'s <functional> and friends because of the crap-tastic missing support for lambda expressions. Luckily there are a couple of sane proposals to fix this in the next version of C++ (aka "C++0x"). http://www.research.att.com/~bs/N1968-lambda-expressions.pdf http://www.research.att.com/~bs/N1968-lambda-expressions.pdf I'm happy to say that I no longer hack C++. I loved C++ until I realized that you have little hope of using C++'s features correctly unless you sink 5 years into becoming a C++ expert. Digital Mars D looks pretty damn good, but I haven't looked into it very deeply.
- neilc 19y agoYeah, I think that is precisely the problem with C++. The language lets you do some amazing things, but it is just way too complicated. Unless you've spent a long time becoming an expert at the language, it is all too easy to write C++ code that looks correct, but it is actually wrong (either poorly performant, or non-portable, or subtly buggy). Whereas C doesn't give you all the wizzbang C++ features, but it has the important property that wrong code looks wrong; the language is simple, and there's often "one logical way" to implement a given algorithm. That translates into simpler code (albeit often less expressive), and fewer bugs.
- jey 19y agoI'd still use C++ over C... virtual functions, inheritance, RAII, and standard containers are too useful. The important thing is to not get caught up in C++ voodoo magic land, and spend 2 weeks trying to get a template with Alexandrescu typelists working correctly when nobody is going to even going to reuse the code, nor wants to learn your fancy interface, nor wants to maintain your fancy code.
- gregwebs 19y agoI have programmed a little D, and although you will be stuck in the imperative/object-oriented mindframe as with C++, D is quite useable. The overall design is coherent, and anyone with a basic understanding of C++ should be able to pick it up very quickly. It even has some lambdaness.
- willarson 19y agoI think your statement implies that you don't know what function pointers are. :/
- euccastro 19y agoDoes it mean your good lines of code achieve less than the good lines of code of someone with comparable experience in a high level language? I bet that's the case. If you're such a believer in thinking before coding, why do you need your language to force you to?