Hacker News new | past | comments | ask | show | jobs | submit login

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.




Does 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?


As 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.


Well, technically boost::lambda (http://www.boost.org/doc/html/lambda.html) is the closest C++ has to lambdas. ;-)


boost::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

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.


Yeah, 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.


I'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.


I 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.


Those boost kids...They do great work.


I think your statement implies that you don't know what function pointers are. :/




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: