Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

From my perspective, most of the stuff about C++ complexity rings untrue. Most people I know seem to know enough about C++ that they can produce pretty good code.

Yes, there's a lot of depth to C++ but you derive a lot of benefit from other's wizardry even if you're not a magician yourself.

Maybe this guy didn't invest as much time on C++ as he did on his other languages.



Perhaps, or perhaps C++ programmers who defend the language haven't spent enough time in other languages.

If you are just plugging components together I can think of better languages.

In my experience C++ demands more time that most languages to master. Which is a far longer time than, say, C.


I think that's not the right criteria though. Are most of the people you know capable maintaining other people's C++ code?

The idea that you can write (!) sane code in C++ by using a simple/sane subset is of course true. But the problem is that in a language of this complexity no two people are going to be able to agree on what that sane subset is. One person may love auto_ptr and use it everywhere, confusing her coworkers who don't get reference counting idioms, but love the STL...

By the time you manage to get your project's coding standards hammered out and enforced, and get it rigged up so it can talk to your external libraries that don't adhere to those standards, you might as well have given up and used C to begin with.


I agree. (Might I add that reference counting is evil (and slower than true garbage collection).)


FWIW, I'm working in C for my day job (and resisting calls to move up to C++), as my day job involves shuffling bytes around rather than particularly complex code; it's ~20KLOC. Then we build the tools to manage it in Python with a bit of shell scripting here and there. However, I code Scheme in my spare time, and would do the lot in that if I didn't then have to justify training new developers in Scheme! C's the right tradeoff for commercially developing a high-performance database kernel, IMHO.

I've done plenty of C++ in past jobs... which is why my day job is in C :-)


Is there an easy way to shuffle bytes and bits in Scheme? I was quite delighted when I found Data.Binary (http://code.haskell.org/binary/) for Haskell.


Yes... sort of.

SRFI-4 (http://srfi.schemers.org/srfi-4/srfi-4.html) provides a standard interface for dealing with 'homogenous vectors' (eg, arrays of unboxed integers or floats), which is great for shuffling bytes.

For bits, there's the usual bitwise-or and all that.

However, both could be improved somewhat; what the Factor folks have done with their struct arrays is IMHO superier.




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

Search: