Slashdot Mirror


Any "Pretty" Code Out There?

andhow writes "Practically any time I hear a large software system discussed I hear "X is a #%@!in mess," or "Y is unmanageable and really should be rewritten." Some of this I know is just fresh programmers seeing their first big hunk o' code and having the natural reaction. In other cases I've heard it from main developers, so I'll take their word for it. Over time, it paints a bleak picture, and I'd be really like to know of a counterexample. Getting to know a piece of software well enough to ascertain its quality takes a long time, so I submit to the experience of the readership: what projects have you worked on which you felt had admirable code, both high-level architecture and in-the-trenches implementation? In particular I am interested in large user applications using modern C++ libraries and techniques like exception handling and RAII."

6 of 658 comments (clear)

  1. God's code by Tablizer · · Score: 0, Troll

    God did an esquisite job on the human brain. It is well-structured and well-commented. However, I pissed him off once and he thus made me a mere mortal. Now I cannot understand any of it.

    1. Re:God's code by jdigriz · · Score: 0, Troll

      While the source may be well-structured and well-commented, it's extremely poorly designed for its functionality. It's constantly getting into states that are difficult if not impossible to get out of. There's no easy way to reload the software or initialize the system so as to start over with a clean state. Its logic is suspect unless the neural net has had long training times, and in power-save mode there's all sorts of extraneous activity. It's also a bear to modify the code directly without resorting to training the neural net. And don't even get me started on the lack of debug data.

  2. Re:Maturity = Mess by Antique+Geekmeister · · Score: 0, Troll

    I see you've used CPAN!

  3. Re:Shameful behavior from Posfix or qmail author by poopdeville · · Score: 0, Troll

    I've been thinking about this topic a lot recently. I do a lot of work with ancient COBOL code that by all rights should now be in the public domain. Sometimes I find that code from one project will take care of issues in another, but the threat of a lawsuit for using code this way is just too high. So I'm in a bit of a pickle -- if company A ever found out that Belatrix Lestrange kills Ron Weasley for Company B, I'd have to argue that my recollection and reconstruction of that code does not constitute a derivative work, or that the code in question was part of the public domain anyway. A sticky wicket indeed.

    --
    After all, I am strangely colored.
  4. Sun Projects - Solaris in particular by Anonymous Coward · · Score: 0, Troll

    Not a C++ project, but Solaris code is beautiful. Sun writes very concise and clear code. I've done work with the Solaris, BSD (several "modern" flavours) and Linux kernels. BSDs are pretty nice, but Solaris is simply a joy to work with. Everything is where you'd expect it, and when you get there, you see nothing more and nothing less.

    Linux kernel code is like a pile of vomit with contributions made by a communist drinking game including someone every UN reconised country. Even worse, the Finn who started it couldn't hold his liquor.

    And my experience was dealing with the rather messy job of packet capture and assembly.

    -Former Linux Zealot.

  5. Nice three things ya got there. by Tim · · Score: 1, Troll

    Ah, yes...the flamebait comment from the "expert" who doesn't understand how to use a powerful language feature. It never dies....

    "(1) It's impossible to debug. You can't read the code. The debugger can't unravel the templated variables and stuff in any meaningful way for you. You can't even step through code, that's doing a supposedly simple operation like memory allocation!"

    Well, rather than getting into a childish "can too!" debate with you, I'll posit that it must have been pretty damn hard to develop boost, if all of the things you mention were actually "impossible".

    Better explanation: you don't know how to debug template code. Sad for you, but not a strike against the language.

    "(2) Some compilers will choke on the code, or compile it wrong in subtle ways due to differing interpretations of some obscure section of the enormous C++ language spec."

    Oooh...scary! Guess what, mate: some FORTRAN compilers choke on legitmate F77 code for the same reasons. This is nothing but a FUD tactic, dressed up as informed criticism.

    Boost is well-tested against the major C++ compilers, and you can always find out the status of the various sub-libraries by going here.

    "(3) The error messages from the compiler are useless. You have to run them through a filter to even figure out what they mean."

    See #1, above.

    "(3) Bugs in the library are very difficult to fix. Template metaprograms are essentially programs written in a functional language, except one that has horrible syntax. This is not the stuff that normal C++ programs are made of."

    I think your second, third point says volumes about your problems: if you don't know how to use it, then it isn't "normal".

    Sometimes, you have to learn new things to be productive in a new programming style. I could spend a great deal of time proving to you that there are many thousands of expert C++ developers who know how to do all of the things that you claim to be "impossible", but it isn't worth my time. I'm just hoping that a few knowledgeable developers will see this, and remove the ridiculous "Insightful" moderation from your rant....

    --
    Let's try not to let fact interfere with our speculation here, OK?