Slashdot Mirror


Real World Code Sucks

An anonymous reader tips an article at El Reg about the disparity between the code you learn at school and the code you see at work. Quoting: "There is a kind of cognitive dissonance in most people who've moved from the academic study of computer science to a job as a real-world software developer. The conflict lies in the fact that, whereas nearly every sample program in every textbook is a perfect and well-thought-out specimen, virtually no software out in the wild is, and this is rarely acknowledged. To be precise: a tremendous amount of source code written for real applications is not merely less perfect than the simple examples seen in school — it's outright terrible by any number of measures."

292 comments

  1. must read: "worse is better" by Polo · · Score: 5, Interesting

    It might be interesting to read The Rise of "Worse is Better"

    1. Re:must read: "worse is better" by Anonymous Coward · · Score: 1

      The article isn't even talking about "worse is better" or "the right thing". Those are both design approaches with different tradeoffs. The article is talking about just badly done code. Badly done code doesn't follow a design methodology, that's part of the problem. Bad isn't a pattern, and bad can't be described simply.

    2. Re:must read: "worse is better" by firewrought · · Score: 4, Insightful

      It might be interesting to read The Rise of "Worse is Better"

      That's a great article for high-brow programmers who want to triple-plus-abstract and design-pattern everything. You know... the folks who Joel Spolsky calls "architects astronauts". However, notice that this article is readable and thoughtfully characterizes the two coding styles it trying to differentiate. Fundamentally, this person knows their craft.

      This is unlike some of my coworkers, who still embedd SQL straight into their GUI's. (I know of one of our apps where all the methods have the same 30+ parameters being slopped around [to represent a row from table X] because the original dev team couldn't be bothered to create a class called "X" to represent the concept of X and so pass around 1 reference.)

      These people aren't heroic real-world veterans who sagely ignore the pretentious chatterings of academics... they're simply folks who don't understand how to express themselves clearly in code, much less the runtime environment, compilation process, or other fundamentals of the basic tools they've worked with for the past ~5 years.

      --
      -1, Too Many Layers Of Abstraction
    3. Re:must read: "worse is better" by PRMan · · Score: 1

      It might be, if it weren't black on gray with no contrast. But since it is, I'll never know.

      --
      Peter predicted that you would "deliberately forget" creation 2000 years ago...
    4. Re:must read: "worse is better" by pixelpusher220 · · Score: 5, Insightful
      Summarized as follows:

      "In theory there's no difference between theory and reality....in reality it's the other way around"

      Seriously, real world code is by definition 'real world' and doesn't live by the theoretical pillars of design. It has to deal with actual deadlines, finite resources and of course office politics.

      --
      People in cars cause accidents....accidents in cars cause people :-D
    5. Re:must read: "worse is better" by Anonymous Coward · · Score: 0

      Are we talking about PHP? Because I agree.

    6. Re:must read: "worse is better" by icebike · · Score: 5, Insightful

      Summarized as follows:

      "In theory there's no difference between theory and reality....in reality it's the other way around"

      Seriously, real world code is by definition 'real world' and doesn't live by the theoretical pillars of design. It has to deal with actual deadlines, finite resources and of course office politics.

      Exactly.
      Where the professor can take 6 months to prepare a small simplistic demo application custom tailored to demonstrate his (pet) coding methods and design standards, in the real world you have to get things done, not in 6 months, not in 6 weeks, and seldom in 6 days. You might have 6 hours on a good day.

      Does too much of this quick hacks find its way into production?
      Absolutely.
      Do bad 2x4s find their way into house construction? Of course.

      But corporate world code runs every single day, not twice a semester. Its "good enough".
      And if it starts to fail it get rewritten, or patched. The truth of the matter is that corporate
      systems are long lived, and few if any are fully understood by the current staff, because the guy who wrote it moved on 8 years ago.
      And Yet, it gets the job done day after day, year in and year out, because people watch it and know what to expect.

      Do houses fall down because of bad 2x4s? Virtually never. Maybe after years of
      remodeling, rewiring, re-plumbing, the place will burn down, but there is usually
      a recent idiot involved, rather than the original builder.

      We build things "good enough" in this world. Not Perfect.

      --
      Sig Battery depleted. Reverting to safe mode.
    7. Re:must read: "worse is better" by Anonymous Coward · · Score: 4, Insightful

      It's not even that. These academic examples are small and trivial. They don't have to adapt or integrate with other systems. They are toy examples and it's really damn easy to make those 'perfect.' How many god damn quick sort examples in Haskell convert to anything in the really real world?

    8. Re:must read: "worse is better" by kestasjk · · Score: 4, Insightful

      To be honest more often than not poor code will just be about getting something out there with the minimum work, rather than because of deadlines. The code is usually boring, and/or it's already poor, so few will come along and sort it out to make things easier down the line (especially when even the best rewrites are usually more risky than a minor hack to a hacked up system, in the short term).

      --
      // MD_Update(&m,buf,j);
    9. Re:must read: "worse is better" by pixelpusher220 · · Score: 4, Interesting

      academic examples aren't bad in and of themselves. They are specifically teaching you how to do 'X'.

      In production you have to know how to apply X, Y, Z, B, E, and G. But you don't start by trying to learn all of them at once. You learn simplistic examples that hopefully teach you the theories and best concepts for 'X'.

      --
      People in cars cause accidents....accidents in cars cause people :-D
    10. Re:must read: "worse is better" by Tagged_84 · · Score: 3, Interesting

      I was tasked with getting a multi-user database and customized front-end up and running by the time the field staff were ready in a couple weeks. I ended up having to patch and fix it as it was being used for weeks before requesting that I then start on another one.

      In their almighty wisdom they thought I wasn't doing as great a job and replaced me with some kid straight out of university who had never programmed in his life. The entire data team crashed, stopped accepting data and had a huge backlog, cost tens of thousands of dollars in lost productivity and project holdups. It was my state government btw and it taught me that my imagination is lacking when it comes to government waste and abuse.

    11. Re:must read: "worse is better" by TheLink · · Score: 4, Insightful

      True but I haven't seen much academic example code that has plenty of logging in them.

      In the real world much good code is filled with exception handling and logs. Because for almost anything that you try or call something wrong/else could happen or something could send you a SIGTERM or similar. You'd leave out the logging in the high performance processing loops, but in the real world those often are only a very small part of the code.

      So it's not just most real world code that sucks in the real world, most academic style code would also suck too. ;)

      Yes there are different logging systems, but you can pick one or two as examples - after all there are also many computer programming languages and most academic courses still teach at least one programming language.

      Anyway the story also reminds me of: http://www.ariel.com.au/jokes/The_Evolution_of_a_Programmer.html ;)

      --
    12. Re:must read: "worse is better" by Anonymous Coward · · Score: 0

      Perfect is the enemy of good

    13. Re:must read: "worse is better" by smellotron · · Score: 1

      black on gray with no contrast

      The great thing about web browsers and the nature of CSS is that it is typically easy to disable garish styles on well-mannered websites (those built simply or with accessibility in mind):

      • Opera: Page > Style > User Mode. Easy peasy.
      • Firefox: View > Page Style > No Style. Seems to require "Menu Bar" to be visible, which is annoying.
      • IE: View > Style > No Style. But wait, this seems to do nothing! Oh well... Alt+F4.
    14. Re:must read: "worse is better" by luis_a_espinal · · Score: 2

      Summarized as follows:

      "In theory there's no difference between theory and reality....in reality it's the other way around"

      Seriously, real world code is by definition 'real world' and doesn't live by the theoretical pillars of design. It has to deal with actual deadlines, finite resources and of course office politics.

      True that, but none of those facts intrinsically preclude people from laying out some structure into the code they churn.

      Proper indentation, sticking to the object/verb pattern of naming objects (or data types) and methods (or functions), closing the resources you open, programming defensively (instead of nillie willie happy go lucky programming), keeping your functions small. All those things good developers can use and deploy as they put out fires in the real world and all the challenges therein.

      A good developer will churn code of some quality under strenuous conditions because he automatically thinks about a certain type of attributes that must be present in code. Any kludge that he/she might produced is done from a position of knowledge, as an intelligent compromise done to meet a challenge.

      OTH, a shitty code monkey will crap out a fetid turd even in the presence of ample resources and fixed requirements.

      So, no, real software might run in the real world, but the real world does not produce shitty code. Shitty developers do.

    15. Re:must read: "worse is better" by dbIII · · Score: 1

      Which means spending more time supporting utter pieces of shit than it would take to rewrite them because office politics doesn't let us upset the guy that unleashed a piece of shit thinking it would only be used for a month or two (six years ago) until somebody had time to do it properly. That's why I had to give all MS Windows users on a network full admin access for a few years until at least the piece of shit was polished enough that it could be run by a normal user.

    16. Re:must read: "worse is better" by dbIII · · Score: 2

      In a lot of cases the shit code is also "toy examples", especially where somebody's personal nasty little flat file storage system becomes some sort of inventory "database" for a department.

    17. Re:must read: "worse is better" by drinkypoo · · Score: 2

      Do houses fall down because of bad 2x4s? Virtually never

      Houses are engineered structures. We have building codes which demand so many studs per so many feet because the math (or experimental home building, often experimenting with the buyer's money) has been done to figure out that only a vanishingly small percentage of homes will experience a lumber-related failure if you use at least this much lumber, even though modern lumber is crap in every way except for being milled smooth. But choosing the wrong operator in the wrong function can result in your program producing invalid output every time you run it. If you eliminated almost any one 2x4 from the design of a decently-designed house, just forgot to install it entirely, it would not substantially affect the function of the house whatsoever. Only a few around doorjambs and such would really be missed. (Or, of course, the top or bottom of any frame...)

      Most software is apparently not "engineered" and even where it is it doesn't happen in the same sense as a house because it's a very different realm. Unless it's actually fully proven, you can't be engineering it in the same sense you do something here in meatspace.

      --
      "You're right," Fisheye says. "I should have set it on 'whip' or 'chop.'"
    18. Re:must read: "worse is better" by znanue · · Score: 1

      Bad is a pattern... I've seen it repeated everywhere. If I were to write it up it would go something like this...

      Semi-competent coder becomes de facto lead developer and in a mixture of fear and unwillingness to do research before starting to architect a large new system just goes to town building it with all the methods he knows of and ends up with a rickety shack that a team of developers have to maintain and improve without refactoring the massive investment in core code.

      Or the other really common bad pattern where a team of semi-competent coders without real leadership architect a system by fighting against each other in format wars and a mixture of well intentioned decisions independently made that work very poorly together via hacks and elbow grease.

      Incompetent lead developers.

      Z

    19. Re:must read: "worse is better" by jellomizer · · Score: 1

      I think there is an XKCD reference for this. But real world developers often need to do things that hasn't been done before, because otherwise your product will not have a competitive advantage. There is often no text book good solution for it, until after you do it.

      It is also what usually pisses me off on the help boards for programming. I have tried the normal ways but it doesn't quite fit my circumstance. I see a similar question and I see a response of "Why do want to do it that way? Use the method that didn't work in the first place."

      Even most of the modest apps push at the boundaries a little.

      --
      If something is so important that you feel the need to post it on the internet... It probably isn't that important.
    20. Re:must read: "worse is better" by maxwell+demon · · Score: 1

      In their almighty wisdom they thought I wasn't doing as great a job

      If you didn't tell them up front that in the given time frame it would be impossible to do a system which wouldn't need to be fixed and patched later on, you weren't doing a good job. Of course if you did and they ignored that, it's clearly their fault alone.

      --
      The Tao of math: The numbers you can count are not the real numbers.
    21. Re:must read: "worse is better" by Anonymous Coward · · Score: 0

      A baller hacker like you an you don't
      a) use lynx?
      b) use a text formatting bookmarklet on your browser like readability?

    22. Re:must read: "worse is better" by fatphil · · Score: 1

      > high-brow programmers who want to triple-plus-abstract and design-pattern everything.

      In my experience, which can be measured in decades, the worst programmers I've ever worked with have been the ones who design patterned everything. They were the guys who didn't even know what Big-Oh was, and decided that O(n^3) was sensible where n would be measured in the thousands, and where amortised O(n) or lower algorithms existed. I think the problem was that they didn't even know what an "algorithm" was.

      --
      Also FatPhil on SoylentNews, id 863
    23. Re:must read: "worse is better" by dkf · · Score: 1

      These academic examples are small and trivial. They don't have to adapt or integrate with other systems.

      The academic examples have to integrate with the rest of the course within which they are taught, and they must show exactly the principle being taught and as little else as possible. The aim is to get the... "less able" students to understand what is going on with as little extra effort on the part of the tutor as possible (because there will always be more than enough to be done teaching them anyway). Yes, the best students could learn from a more complex example with more different things going on, but the reality of teaching is that it isn't just for the best students.

      Writing code is much easier than teaching!

      --
      "Little does he know, but there is no 'I' in 'Idiot'!"
    24. Re:must read: "worse is better" by Tagged_84 · · Score: 2

      Of course I did, the fact they thought someone who never programmed could pick it up within a week really highlights how incompetent they were.

    25. Re:must read: "worse is better" by torroid · · Score: 1

      True but I haven't seen much academic example code that has plenty of logging in them.

      Amen. Logging well is an un-taught art.

    26. Re:must read: "worse is better" by Anonymous Coward · · Score: 0

      “He who loves practice without theory is like the sailor who boards ship without a rudder and compass and never knows where he may cast.” -- Leonardo da Vinci

      I agree and I would be harsher about it. Replace :
      “ [They] don't understand how to express themselves clearly in code, much less the run time environment, compilation process, or other fundamentals of the basic tools they've worked with for the past ~5 years.”
      with
      “Stupid code monkeys who are aggressively ignorant and have no desire to get beyond the 'Larry the Cable Guy' and a 'git'er done!' mindset when they code.”

      They are actively ignorant and proud of it. They passed a vendor certification cram course, so they must be competent!

    27. Re:must read: "worse is better" by TheLink · · Score: 3, Interesting

      Yeah I still have no idea how to do logging well.

      But what I like to do when performance is not an issue is to log everything (DEBUG etc) into a context ring buffer. Then normally only log messages above the configured log threshold will appear in the logs (e.g. INFO, NOTICE, WARNING). The DEBUG stuff won't appear. BUT if a log message above a log the context threshold occurs (e.g. ERROR, CRIT) the contents of the context buffer is logged followed by the actual triggering log. This way I don't have to turn debugging on. It can always be on BUT I don't have my logs full of the debug level logs unless "stuff happens".

      This context logging stuff is bad for performance, but so far it's not a problem for the stuff I do (and can be turned off). It does make it easier to figure out what happened while creating less DEBUG noise.

      As part of my log messages I also have hashes and dots, e.g.:
      DEBUG = one hash = #........
      INFO = ##......
      NOTICE = ###.....

      This way I can easily "grep" log files for logs above a particular threshold. If you're Google or Facebook scale you'll have to do things a bit differently because there'll be zillions of logs, you can't have half a million machines send logs to one log server ;). So you'd need a way to summarize logs.

      It might also be nice if the CS lecturers spend some time discussing the merits of different exception handling approaches in various scenarios. Instead of just stuff like this: http://www.cs.auckland.ac.nz/compsci105s2c/lectures/adriana/Lecture06.pdf

      Doesn't need to be as detailed and extensive as this: http://www.amazon.com/Advances-Exception-Handling-Techniques-Computer/dp/3540419527

      Just some basics that might open up student eyes to how things work in the real world and more importantly how things could fail, and how one might deal with them.

      FWIW I didn't do CS. I did EE. So maybe this stuff is actually covered in some CS courses. I doubt it was covered in my colleagues CS courses though ;).

      --
    28. Re:must read: "worse is better" by styrotech · · Score: 1

      Houses are engineered structures. We have building codes which demand so many studs per so many feet because the math (or experimental home building, often experimenting with the buyer's money) has been done to figure out that only a vanishingly small percentage of homes will experience a lumber-related failure if you use at least this much lumber, even though modern lumber is crap in every way except for being milled smooth. But choosing the wrong operator in the wrong function can result in your program producing invalid output every time you run it. If you eliminated almost any one 2x4 from the design of a decently-designed house, just forgot to install it entirely, it would not substantially affect the function of the house whatsoever. Only a few around doorjambs and such would really be missed. (Or, of course, the top or bottom of any frame...)

      Based on experience in my jurisdiction (disclaimer: probably not your jurisdiction or the same codes), a one size fits all building code for houses that overspecifies everything to accommodate as many potential cockups as possible is practically the opposite of an engineered structure. The code is designed to allow a builder to build a house without needing engineering calculations for everything.

      Sure there was engineering input into the code, but the only engineering input into individual houses is when they (or specific parts of them) fall outside the general code. eg some sort of wacky bespoke architecture, unusual wind zones, weak ground conditions, large spans, high retaining walls etc. In these cases the specific engineering codes take over that require calculations based on the specific circumstances.

      The mangled structural engineering comparison with creating software is almost as much a slashdot tradition as the tortured car analogy.

    29. Re:must read: "worse is better" by bug1 · · Score: 1

      real world code

      Software is real now ?

      Descartes would be rolling in his grave.

    30. Re:must read: "worse is better" by hazah · · Score: 1

      Competence is gained through experience. In the race to the bottom to hire cheap, I've had the unfortunate "pleasure" of being that incompetent "lead developer". There was no time to become "competent", as it were, given that the whole platform was constantly on fire. In a setting such as this, competence was a delusion.

    31. Re:must read: "worse is better" by Anonymous Coward · · Score: 0

      You're joking, right?

      "....But corporate world code runs every single day, ...."

    32. Re:must read: "worse is better" by multicoregeneral · · Score: 1

      I've seen what they study in school these days, and I think it's bordering on fraud to call anything in a computer science curriculum perfect. Often times, the code written for these courses is deeply flawed, written by people who have no real world experience at all. There's a big difference between studying a platform in a vacuum, and working on the same platform in practice. Is it any wonder that kids straight out of school are totally lost when they hit the production floor?

      And then he goes on and on about things he knows nothing about. Sighting examples that other people have come up with. And then he has the audacity to talk about people being poorly trained when he can't even understand what the code in his own system is doing? Come on now.

      Look, I get it. Programmers are an awful lot like mechanics, in that you'll never see one admire the work of another unless both of them have the same idea of what perfect is. That's okay. I also understand that we as programmers do this kind of thing to justify our own existence. I've done it. You've done it. Just the way it goes. But I think it's telling, that this guy is doing it in a way that his own technical shortcomings are readily apparent in the article itself. I hope he's using a pseudonym.

      --
      This signature intentionally left blank.
    33. Re:must read: "worse is better" by drinkypoo · · Score: 1

      The code is designed to allow a builder to build a house without needing engineering calculations for everything.

      Yes. An engineer had to figure it out. They ran the numbers and figured out how others could build a house without having to do as much engineering themselves. That's called engineering! HTH, HAND.

      --
      "You're right," Fisheye says. "I should have set it on 'whip' or 'chop.'"
    34. Re:must read: "worse is better" by ahabswhale · · Score: 1

      I do a similar thing using aspects to make sure context information is logged whenever errors/exceptions occur.

      --
      Are agnostics skeptical of unicorns too?
    35. Re:must read: "worse is better" by mike4ty4 · · Score: 1

      These people aren't heroic real-world veterans who sagely ignore the pretentious chatterings of academics... they're simply folks who don't understand how to express themselves clearly in code, much less the runtime environment, compilation process, or other fundamentals of the basic tools they've worked with for the past ~5 years.

      So where does one get that knowledge, then?

    36. Re:must read: "worse is better" by loneDreamer · · Score: 1

      So where does one get that knowledge, then?

      Reading around and/or having a mentor. There is the people that want to get better and others who just want to get something done, even if they realize they have no idea what is going on.

    37. Re:must read: "worse is better" by TheLink · · Score: 1

      Any examples or details of how you do it?

      --
    38. Re:must read: "worse is better" by ahabswhale · · Score: 1

      I'm sorry but I can't provide that since it's proprietary code. However, it's pretty easy to do with aspects. Just research "around advice" and it will be pretty obvious what you need to do from there. Keep in mind that aspects are done via proxies so you need to be sure that you're only aspecting what you need to.

      --
      Are agnostics skeptical of unicorns too?
    39. Re:must read: "worse is better" by WuphonsReach · · Score: 1

      Well, in Java, it's now as easy as writing your logging stuff in AspectJ and having that advise the method. Any cross-cutting stuff (logging, exceptions, security) gets moved out to a common aspect which is then applied to all methods that either implement an interface, are annotated, or match a calling pattern or name.

      If you're dirtying up your Java business object classes with security / logging / exception handling, you're still doing it the hard way.

      --
      Wolde you bothe eate your cake, and have your cake?
    40. Re:must read: "worse is better" by TheLink · · Score: 1

      I don't see it as dirtying. Very often I don't need to comment my code because of all the logging - from the logs you'd know what the code is trying to do and sometimes what might be happening when it fails.

      I often like descriptive messages in my logs, how would I do that if the logging is in an aspect and applied to all methods? The descriptive messages don't tend to apply to all methods.

      --
    41. Re:must read: "worse is better" by godefroi · · Score: 1

      Algorithm, is that a pattern? It's not in the GoF book, it must not be any good.

      --
      Karma: Poor (Mostly affected by lame karma-joke sigs)
    42. Re:must read: "worse is better" by cwsumner · · Score: 1

      It's not even that. These academic examples are small and trivial. They don't have to adapt or integrate with other systems. They are toy examples and it's really damn easy to make those 'perfect.' How many god damn quick sort examples in Haskell convert to anything in the really real world?

      The academic examples are -Not- perfect, the professors only think they are. And maybe that is what they need for teaching. But they totally lack any error handling, in the larger sense where problems must be solved (not just halt the program). Real programs must have "defense in depth", or:
      "If Engineers built buildings the way Programmers write programs, the first woodpecker that came along would destroy civilization!"

    43. Re:must read: "worse is better" by fatphil · · Score: 1

      I might need to re-jig it a bit, but I think I can make good use of that line - thanks!

      I think I'll try a naively-voiced 'How about we use the "clever algorithm" design pattern?' on my nerdier mates tomorrow.

      --
      Also FatPhil on SoylentNews, id 863
  2. Captain Obvious? by Anonymous Coward · · Score: 5, Insightful

    This just in: real world a lot harder than school.

    Gee, thanks Slashdot!

    1. Re:Captain Obvious? by K.+S.+Kyosuke · · Score: 5, Funny

      The first thought that occurred to me is the equivalent situation in literature: People go to school, read and learn from Shakespeare, Austen, Melville, Twain, Hemingway, Faulkner, Tolkien...and then they go out and write Twilight and Hunger Games. I guess some people simply aren't cut for it?

      --
      Ezekiel 23:20
    2. Re:Captain Obvious? by Smallpond · · Score: 2

      This just in: real world a lot harder than school.

      Gee, thanks Slashdot!

      The reason is pretty obvious. The 25-line program you write for a school assignment is not the same as the 5000 lines you are writing to implement a set of vague business requirements.

    3. Re:Captain Obvious? by Austerity+Empowers · · Score: 1

      Not at all, most of the real world problems are problems you see solved in academia, very well. The code quality is a direct result of the "coding to the business need" principle, where everything is done based on a business identified function/schedule.

      The persistent problem with purely competitive environments is that there will always be an incentive to beat the other guy, at any cost.

    4. Re:Captain Obvious? by ShanghaiBill · · Score: 5, Insightful

      The 25-line program you write for a school assignment is not the same as the 5000 lines you are writing to implement a set of vague business requirements.

      Some of those 25-line programs are not so good either. If you really think students write good code, get a job as a TA and grade some assignments.

    5. Re:Captain Obvious? by Penguinisto · · Score: 5, Interesting

      It's even worse than that.

      These folks learn the classics, but then go out and are forced to make a living by making new editions of Twilight, Hunger Games, etc. As a bonus, they're not allowed (by edict and budget) to change more than 25% of the nouns (in aggregate, not as categories).

      --
      Quo usque tandem abutere, Nimbus, patientia nostra?
    6. Re:Captain Obvious? by Phrogman · · Score: 5, Insightful

      Then in school they should be recreating the actual real world experience, you know:
      * a representative from the "Business" comes to you with a vague concept of what they want, mostly consisting of "Something like X" but more like "Y" with some of the features of "Z" (3 completely different things that have no apparent relationship to each other). After a few days of meetings you determine that what the person wants is based more on the colors used and the layout being pretty to them and not at all on the features or functionality.
      * You then seek out a group of various people who actually know what might be required, and grill them to try to get an idea of the features and functionality required. From this you create an initial design document.
      * You run the design document that describes what you think are the features and functionality past the people above who all agree you are on the right track. You add more details and they all agree its perfect. Mostly they don't actually understand what you are talking about but they nod their heads sagely and agree because they don't want to look incompetent.
      * You begin coding (or possibly get together with a team and fight over things for a few days/weeks/months) and get a prototype built. You show it to those you have spoken with and again its on the right track.
      * You code up the first version. You reveal it to people and its "great".
      * Then the people start filtering in with design "suggestions" that mean massive changes to what has been written and done, possibly shifting the entire project in a different direction. These conflict with each other and trying to find the middle ground occupies as much of your time as actually trying to write anything.
      * The marketing people come into the picture and it turns out that *they* are the ones that really have the authority to make the design decisions, not the people who you originally talked to, but as an added bonus the marketing people don't have the slightest clue about the required features or functionality - just what they think they can sell to customers. Getting their salable features shoe-horned into the program becomes your top priority now.
      * The program also has to look "pretty" so the art department enters the picture and they demand massive changes so that the layout is much nicer and easier for them to do, minimizing their workload as much as possible because they are completely overworked and under-budgeted. You meet with artists in rooms that are completely dark and stare at photoshop images that are renderings of what they see the program looking like. It bears no resemblance to what you have been working on and they have made massive changes to everything renaming all the menu entries etc. It is however pretty, or rather the 3 different versions of it are pretty, and you have to wait until marketing determines which one is the best.
      * now you are way off schedule because of all the monkeys who are making changes based on whats the most important thing from their perspective.
      * Eventually its all nailed down and you hurriedly code the new first version up as fast as possible because of pressure from above to be "done this thing already".
      * At the last moment when its done, it gets cancelled to be replaced by some other project which is higher priority, or they announce it must be entirely recoded in a different language/script.

      Shove that student into this environment. Get people to play the various roles that are about as knowledgeable as people you will encounter in the corporate environment - which is to say find the most qualified idiots you can and put them in the roles.

       

      --
      "The first time I got drunk, I got married. The second time I bought a chimpanzee, after that I stayed sober" Arian Seid
    7. Re:Captain Obvious? by Penguinisto · · Score: 2

      ...to say nothing of the fact that instead of writing a program from scratch, you're forced to maintain others' programs instead, or to add what you write to existing (fundamentally crap, poorly-maintained) code.

      Yay?

      --
      Quo usque tandem abutere, Nimbus, patientia nostra?
    8. Re:Captain Obvious? by RabidReindeer · · Score: 1

      This just in: real world a lot harder than school.

      Gee, thanks Slashdot!

      PHB: Nonsense! Programming is dead easy. My 10-year-old nephew wrote a program just the other day. It makes a little square box bounce around on the screen. We don't need these overpriced prima-donnas spouting techno-babble about Separations of Concerns or stuff like that. A half-hour and you can have web pages on the screen and ready for production tomorrow. All You Have To Do Is...

    9. Re:Captain Obvious? by Anonymous Coward · · Score: 1

      Suicide among teenagers is bad enough, man.

    10. Re:Captain Obvious? by DragonWriter · · Score: 1

      Not at all, most of the real world problems are problems you see solved in academia, very well. The code quality is a direct result of the "coding to the business need" principle, where everything is done based on a business identified function/schedule.

      Perhaps more precisely, that the code produced in the "real world" is often "graded", in the immediate term, by a PHB that will be satisfied if it superficially appears to work (they'll eventually get upset at the costs produced by less-obvious defects and poor design, but at the point they often won't be punishing anyone for it, except probably by making them "fix" it -- to the same flawed standards as before -- if they are still around.)

    11. Re:Captain Obvious? by Macman408 · · Score: 3, Interesting

      This, and even the *book* is wrong half the time. Given the pressure to come out with a "new edition" every couple of years that many publishers and authors face, they re-write many parts of the books, including examples and problems. Often, it's clear that what the author wrote hasn't even been compiled before, as there are glaring syntax errors. (Obviously, some books are better at this than others.)

      Most of the people I work with produce much better-looking code than a college student. Interns come in periodically and help prove that point; they write for ease of coding, not ease of reading or maintenance or reuse or anything nice like that. The code from more experienced people is by no means perfect, but they've at least seen both good examples and bad examples when they have to touch somebody else's code, and they tend to pick up a few of the good habits while dropping a few of the bad ones.

    12. Re:Captain Obvious? by Anonymous Coward · · Score: 0

      ^ wonderful post. perfectly captures what i've had to deal with many times.

    13. Re:Captain Obvious? by clemenstimpler · · Score: 2

      My questions are not tainted by real world experiences, so feel free to enlighten me. 1. If it is the marketing people who have the final say, why aren't they part of the process from the beginning? 2. If design people can throw in fundamental changes to UI, why are they the last to be asked? In sum: Is this just mismanagement or is there some fundamental truth about real world development that escapes me somehow?

    14. Re:Captain Obvious? by TheSpoom · · Score: 1

      Honestly, this should be the final project of any decent software development course.

      --
      It's better to vote for what you want and not get it than to vote for what you don't want and get it.
      - E. Debs
    15. Re:Captain Obvious? by Anonymous Coward · · Score: 1

      I only wrote one 33 line program in my academic career. at the very beginning. Most modules were between 3~4k lines, and final projects ran 10~15k. Algorithms and OS design were 38k, and the final OS design probably close to 100k. I did not get my CS degree from the back of a box of Cracker Jacks, I got it by working very hard at demonstrating complex ideas in an elegant ways. Its going to be either MIT or Stanford for grad school.

      The results you get out are the results of what is put in. If you have vague business requirements, you will get crappier code than written by monkeys, you might as well get a boat and outsource it, which is what one of the companies I worked for did. They got utter crap in return, and not in enough time to get things cleaned up. They have a partial system, that will be more expensive to maintain then to start from scratch, but someone is going to continue to make money on them. Not me.

      Give your CS assignments back to General MIlls. They need a good laugh once and a while.

      The Ivory tower days are for beginning programming students, not for serious academics or for future coders. We all know how to write crap, but it really costs MORE to write un-maintainable code. Perfect example: Facebook.com

      Get a clue. The real world I worked for is a Linux var, and their configuration scripts were utter crap. After I cleaned it up, we could branch out and add a lot of customization features, specifically lamp servers. Along came openStack, and Its a thrill to see how much they reinvented in a good way. There are as many open source examples of great code as examples of nightmares. Nightmares go away to die, and products like Netscape become things like Firefox.

    16. Re:Captain Obvious? by jimshatt · · Score: 4, Interesting

      Reminded me of a comic by the oatmeal: http://theoatmeal.com/comics/design_hell

    17. Re:Captain Obvious? by greg1104 · · Score: 2

      Even your longer example doesn't do enough justice to how much of this problem is management based. This article was terribly biased toward blaming programmers for these issues. Schedule pressure to release on a date no matter what causes more bugs than anything else. Having some sort of deadline is necessary; if left on their own, programmers like to tinker with stuff forever. But you can only compress things so much, and management requirements are often impossible to hit. The standard example here is the Fred Brooks one of "9 women can't make a baby in 1 month".

      If companies valued their programmers doing high quality coding, I'd make a living teaching classes in things like error handling paranoia. But they don't. The developers are just an expense to be reduced, and there's almost no business environment that values high quality software correctly.

    18. Re:Captain Obvious? by JosephTX · · Score: 0

      Maybe you should try sitting down with the marketers, artists and executives all at the same table and have them all come to an agreement right there instead of being antagonistic and letting basic things drag out for months. If any business really gets this bad, that's a failing of ALL involved employees.

    19. Re:Captain Obvious? by Mandatory+Default · · Score: 2

      Because an incredible percentage of products get canceled and the marketing people have learned not to waste their time on some shiny new idea that's probably going to get canceled anyway. Wait a few months and see if the project survives and it's worth investing your time, because if you touch/interact with a project and it's canceled, that of course makes you look bad and has wasted your time. There's the additional benefit that, if the developers are late, that gives you a scapegoat if your marketing campaign isn't ready. And if the developers waste a million dollars redesigning and making changes, it's not your budget and your promotion doesn't depend on helping other departments save money.

      So basically the whole corporate culture exists to make sure that developers can't get meaningful feedback in a timely manner.

      And that's how everything works in a moderately well-run organization. A dysfunctional organization is much, much worse.

    20. Re:Captain Obvious? by Anonymous Coward · · Score: 0

      Mismanagement is the norm in many software development settings.

    21. Re:Captain Obvious? by UnknownSoldier · · Score: 1

      Of god that is so true it is not even funny. :-)

      "Politics" (and ego) is the number one reason "Real World" software sucks so much.

      --
      "If engineers built buildings the way programmers write code then the first time a woodpecker came along it would destroy civilization."
          -- Murphy's Computers Laws (Murphy was an optimist!)

      http://www.murphys-laws.com/murphy/murphy-computer.html

    22. Re:Captain Obvious? by New+Breeze · · Score: 2

      That's not the way businesses operate, and the larger they are the more layers of BS things filter through. The person who champions the project hands it off to a subordinate, who hands it off again, etc. By the time it gets to the poor sap who had to bid out the project you're lucky if you get a cocktail napkin sketch of a UI concept and a few vague notes about what it should do.

      There is another form of this that I deal with quite often, where upper management concieves of something that is totally impractical for the people who will actually need to use it. You go through all the look, feel and features stuff to get what the corporte folks envision and then install it only to find that the operations people won't use it.

      It can be extremely frustrating, but if you were smart about collecting your money you've gotten paid and you're never going to have to support the code.

    23. Re:Captain Obvious? by UnknownSoldier · · Score: 4, Funny

      * Meskimen's Law: There's never time to do it right, but always time to do it over.

      * Ninety-Ninety Rule of Project Schedules: The first ninety percent of the task takes ninety percent of the time, and the last ten percent takes the other ninety percent.

      http://www.panopticoncentral.net/2010/08/01/murphys-computer-law/

    24. Re:Captain Obvious? by angel'o'sphere · · Score: 1

      Best /. comment since years.
      More scary however is that Twilight and Hunger had so many readers they made movies from it ... (still cosidering if I missed something in not reading/watching them)

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    25. Re:Captain Obvious? by Anonymous Coward · · Score: 0

      1. The marketing people are part of the process. "The requirements people" apparently talked to them but since they are marketing, they have absolutely no idea what actually has to be build. They are just a communication medium.
      2. "The design people" are asked, but you missed the part about how overworked and under-budgeted they are. The UI designs are simply not ready until the development is pretty much done.

      It is mismanagement, but since the development is the last in the development chain, the blame for problems rarely falls on management. Those gannt charts looked so very well thought out. Those requirements are represented using very pretty and detailed UML diagrams. The image in the PhotoShop looked beautiful on 30" Mac. It doesn't matter that the project schedule is completely arbitrary and unrealistic. It doesn't matter that those requirements are in conflict with itself. It doesn't matter that screen layout requires 50 complex queries that has to execute under a second, looks horrible on a typical screen or requires some kind of AI that has not been invented yet. If there is a fault, it must be those weird developers. The people who made that PowerPoint presentation will get a promotion for basically mismanaging the project. We have generations of management that has been rewarded for bad management. The good management got punished for not being bold and ambitious enough.

      That is the fundamental truth about real world development.

    26. Re:Captain Obvious? by Anonymous Coward · · Score: 1

      What generally happens is that you have one or two points of contact with 'the business'. These people can be anything from the CEO down to the actual users.

      Each point of contact will have their ideal view of what it should look/work like and what features it will need. If you have, say, a marketing person and a user, the marketing person will want it to stay within their guidelines and the user will want features X, Y and Z. However, if your contacts are in finance and a different user, it will need to cost less than $M and the second user will want features A, B and C.

      What they really need is features F and R because those are the features that 95% of users actually use. Only one user in a hundred (or more, sometimes by orders of magnitude) will tell you the actual truth rather than what fancy things they've seen Facebook do.

      I was once told to make something with an intricate security model (from a user) on a specific platform (from my boss, or his boss maybe). A month or two of wrestling with the platform and I got it to work. I presented it to a group. They also happened to be users. I showed them the security in action. Two people said that that was essentially the complete opposite of what was needed and the rest of the group agreed. The first user, my contact, did not stand up and say that it was what had been specified. They basically went 'Oh' and then agreed with the rest of them.

      The fundamental truth is that most development is like herding cats. The people requesting it want a load of buzzwords to be checked off. Finance ideally wants it done for free. Marketing wants it to be a work of art. Security wants it to be able to withstand a thousand years of attack by quantum computers. HR wants anyone to be able to use it (security-wise) including people outside the organisation. If you have Architects, they'll want it to conform to whatever is the currently favoured methodology.

      It is not unheard of for no input to be obtained from the people who will actually use it.

      If any of these people change during the development, no matter how far along said development is, the new person will want to 'make their mark' on the project and will want something changed or will want the project cancelled completely.

      When someone wants a bridge built, they don't suddenly change where one end starts and realise that they want it made from cottage cheese. Some people will talk about this being an issue with requirements gathering but there is only so much you can do when literally anything about what the program does could change at any time. Oh, and if you gave an estimate or deadline it will become an immutable fact of the Universe :) They will still want to know why it isn't finished in the time originally specified.

    27. Re:Captain Obvious? by Anonymous Coward · · Score: 0

      Or expecially the next 50 lines you have to write when handed that 50K line behemouth for the first time because some critical bug was found and needs to be fixed right away

    28. Re:Captain Obvious? by Anonymous Coward · · Score: 1

      To be fair, some of Shakespeare's works have had several movies of them made.

      Having read and enjoyed the Hunger Games trilogy (it's YA lit, nothing too deep, but they aren't poorly written), I'm amused by the anti-populist dismissal of it in this thread: it's an intentionally unsubtle jab at the obbession with reality TV and violence in our culture.

    29. Re:Captain Obvious? by Phrogman · · Score: 4, Insightful

      That implies that all of those people care to spend the time meeting - and they often don't - and also know or are willing to listen to a detailed explanation of what is involved - and they aren't or are not capable of it. Everyone knows the problems, no one admits to their part of the problem.
      Also management tends towards Seagull management - arrive suddenly, shit all over everything until everyone is worked up, then leave. Rinse, repeat until the project is done or cancelled.
      Honestly I have been through this sort of cycle a few times, and despite the best efforts of the developer side to get management to agree to the design document as defined, the end result is featuritis, people sticking their nose in who shouldn't be able to but who are higher up in the food chain than you (or anyone else in development) is etc.
      Half of the art of software design is dealing with people who don't understand it, or care to learn.

      --
      "The first time I got drunk, I got married. The second time I bought a chimpanzee, after that I stayed sober" Arian Seid
    30. Re:Captain Obvious? by chrismcb · · Score: 1

      I agree
      While the 25 line sample might be perfect, 99% of the class will turn in utter garbage. Nothing that even comes close to that 25 lines of perfection. And then HALF of those people will go out in the real world and get a job. And then continue to write the same crappy software.

    31. Re:Captain Obvious? by New+Breeze · · Score: 3, Interesting

      The creaping featuritis thing amazes me to this day. I am a codeslinger, if you want it I'll write it. But I will tell you if I think you're making a mistake.

      One of my old bosses put it well when a customer was questioning my opinion on some of their stuff I was pushing back on.

      "If he thinks it's a bad enough idea to tell you that you shouldn't have him do it, you should f'ing listen. You do remember he bills by the hour? If he's telling you it's not something you want him to do he's doing you a favor. And if he won't do it there's no way in hell we'll do it for you, he's the guy we send people to for crazy shit."

    32. Re:Captain Obvious? by Fierlo · · Score: 1

      You probably shouldn't include Twilight and The Hunger Games in the same comparison. While the writing in both is geared towards their target audience (young adults/teenagers), The Hunger Games doesn't read like it was written with a thesaurus. The Hunger Games has a story that is more intricate than "I am a boring girl who loves a vampire that sparkles."

    33. Re:Captain Obvious? by Anonymous Coward · · Score: 0

      In school you get to write up to 10k lines of works. I remember there wasn't much emphasis on code comprehension though. Perhaps that could be a science on its own with methods and principles, instead of an IQ and concentration test.

    34. Re:Captain Obvious? by Hyperhaplo · · Score: 1

      You ask good questions. Here is the answer: Money

      Most likely you'd like a longer answer.

      1) The marketing people generally will have a 'final say' as they are 'closest to the customer'. Depends. All it takes is for any person who is deemed to be higher in the food chain to trump those lower down and chaos can ensue.

      People like marketing generally don't get on the ground floor because there is nothing to see. No product. Nothing to toss around, perhaps there might be mock ups or diagrams.

      What *should* happen is that the UI should be mocked up and flagged with any group with an interest. Problem there is that sometimes the UI doesn't exist until the software is half written because the functional requirements determine what is on the UI and the functional requirements were not completed until the coding was 1/4 done.

      Google why the Waterfall Model is no longer in use outside big business. You need the whole spec up front, business spec, tech spec, functional spec, you get the idea. This costs MONEY. It is expensive to do and expensive to change. In the real world you need code up running and out the door as fast as possible.

      I lost count of how much code I've seen in Production with no specs at all.

      2) Mostly because there is nothing to see
      Unless you are designing the next Photoshop, the UI is not the first thing to be designed, and can change. Also, these people tend to be visual and don't always respond without images or a good specification in front of them.

      Now imaging this and comment on it... oh no, it's not build yet, and there is no prototype.. just imagine it.

      As it happens, I've seen a board put together to stop this sort of problem from happening. What happens then is that programmers, business people, project managers, test managers and anyone else with a stake on getting this code into production yesterday complains about the extra layer of red tape needed to release code.

      Sigh.

      See also: Money

      Lack of organisation, lack of coordination, lack of methodology, not adhering to the agreed methodology, bad management, good management, bad programmers, good programmers, coding in the real world can be "very interesting" in the manner of 'may you live in interesting times'.

      --
      You have a sick, twisted mind. Please subscribe me to your newsletter.
    35. Re:Captain Obvious? by gnasher719 · · Score: 1

      Some of those 25-line programs are not so good either. If you really think students write good code, get a job as a TA and grade some assignments.

      Here's a seven liner published at thedailywtf.com. Some presumably professional programmer managed to write a function removing space characters at the end of a string with worst case quadratic runtime, linear stack usage, a possible crash, and incorrect results in border cases.

      char *trim_right(char *str)
      {
      int len = strlen(str) - 1;
      if(len == 0 || str[len] != ' ') return str;
      str[strlen(str)-1] = '\0';
      return trim_right(str);
      }

    36. Re:Captain Obvious? by Anonymous Coward · · Score: 0

      This reminds me of a project I'm embroiled in right now - which has a deadline of 1 jan 2013. Vague clinical rules (yes, I'm in pharma/disease management) for a critical oncology therapy and script system...

      I've had to cancel my leave, and cancel the leave of the single programmer who's assisting.

      Fucking joke, and all for money. It would be funny if it wasn't so sad for the patients involved.

    37. Re:Captain Obvious? by Phrogman · · Score: 2

      I recall reading about someone being brought in to replace the (sole) developer for a key piece of business software because the previous one had been fired. (Caveat: I have no idea if this is true and can't recall where I encountered it).

      They opened up the source code to give it a check and discovered that the previous developer had used variable names that varied mostly in the number of letters used. So you had variables named like:
      $m, $mm, $mmm, $mmmm, $mmmmm, $mmmmmm,
      $sa, $saa, $saaa, $saaaa

      and so on. Not a single variable that appeared in the software had an even vaguely informative name. There were no apparent notes to help translate it at all (the previous developer likely left with them).

      Massive job security I suppose but I think I would want to hunt them down and murder them myself.

      --
      "The first time I got drunk, I got married. The second time I bought a chimpanzee, after that I stayed sober" Arian Seid
    38. Re:Captain Obvious? by Phrogman · · Score: 1

      At one place I worked, I was in the IT department. One of the guys there managed the company servers (all running Redhat wherever possible), his name was Rob.
      Rob needed to check something to do with the software the company was producing so he cobbled together a rough tool (programmed in perl I *think*) that let him do the stuff he needed to do. He was not a developer as I said, he wrote it to do what he needed and didn't worry about anything other than that. I think he essentially learned to program in perl (or whatever it was) on this little program.

      One day someone was down from Sales to ask Rob about something, and he opened up this tool to check something for the Sales guy.

      Three days later the Sales guy phoned down to Rob and asked him about that little tool he had seen him use. Was it easy to use, was the documentation any good (there was none) and what was it called exactly (it had no name). Rob asked why he needed to know those things, and the Sales guy said "Oh well we just got a big contract signed for the company software but I had to promise we would include that tool you showed me a few days ago to cinch the deal, so I just wanted more details so I could provide the customers with them".

      The result: several folks in development had to drop everything and then after grilling Rob on what his tool was used for, code up a whole new version of it in a more polished manner so it would be ready for the customer's use. The Art department had to do emergency design work, a half dozen people worked overtime etc, rewriting the tool in C++, we had to write a short but complete user's guide etc. In short it cost the company a lot of man hours and money to create this new management tool and only because the Sales guy would say yes to anything that clinched the deal - and without checking on anything first, like say, does the product in fact exist.

      Many non-developers do not get it and will never get it with regards to programming/development.

      Oh and while I think of it, I recall sitting talking to the Boss of a local small development company/ISP in my home town. He got a call from a potential customer asking if they had software that did X. He said sure we do and can the guy hold for a sec. he put him on hold for a minute, while he and the head developer thought up a good name for the product, then got back on the line and told the guy the name and proceeded to answer questions from the customer on the features. Amazingly it had all of the customer's required features. He took notes for the requirements as he talked to the guy, then took his CC info and processed the sale (I think $1800 but I can't recall exactly). Then he hung up.
      Then they discussed writing it. All the while I was sitting as witness to this process and I said to him "Isn't the guy gonna want his software right away?" and he said oh we can whip something up in a few days and ship it out, it should work well enough for us to produce the "upgrade version" that really works properly. He then started working on the label art.

      There are some shoddy people out there in the computer world I can tell ya. I decided not to see if I could work there.

      --
      "The first time I got drunk, I got married. The second time I bought a chimpanzee, after that I stayed sober" Arian Seid
    39. Re:Captain Obvious? by jafac · · Score: 1

      . . . and how would you even GRADE such a project? It's kind of a tall request. To grade one student. To grade 20 students - in the last week at the end of the semester . . . this would be very very difficult to do objectively.

      --

      These are my friends, See how they glisten. See this one shine, how he smiles in the light.
    40. Re:Captain Obvious? by Penguinisto · · Score: 1

      So you had variables named like:
      $m, $mm, $mmm, $mmmm, $mmmmm, $mmmmmm,

      Oh, that's from the Crash Test Dummies Style Sheet. :)

      (no, really...)

      --
      Quo usque tandem abutere, Nimbus, patientia nostra?
    41. Re:Captain Obvious? by lennier · · Score: 1

      It's even worse than that.

      These folks learn the classics, but then go out and are forced to make a living by making new editions of Twilight, Hunger Games, etc. As a bonus, they're not allowed (by edict and budget) to change more than 25% of the nouns (in aggregate, not as categories).

      So, just like any writer working on an existing universe, like Marvel, DC, or Star Wars, then.

      "Okay, so focus groups this summer show that teen vampires are the new hotness. Write us a six-novel series set on Endor immediately after the destruction of the Second Death Star involving Ewoks, summer school, vampires and flying unicorn ponies. Make Luke Skywalker and Han Solo the main male leads, but you can't give either of them any kind of dramatic arc. But he needs to be dark and brooding and intense. Oh, and since Disney just bought the rights, we'll need you to have Minnie Mouse and the Little Mermaid as competing romantic interests. And we've also got videogame rights, but no guns are allowed, so if you could work in at least two platform-jumping sequences, that would be great. We need to achieve a target audience buy-in of at least 80% with the first book, rising to 95% by the third, and your pay will be scaled accordingly. You've got six weeks; that should be enough to complete the series, right?"

      Welcome to the Real World of legacy code and conflicting requirements.

      --
      You are not a brain: http://books.google.com/books?id=2oV61CeDx-YC
    42. Re:Captain Obvious? by lennier · · Score: 1

      it's an intentionally unsubtle jab at the obbession with reality TV and violence in our culture.

      A "jab" at violence-porn which creates more media product of exactly the same kind that it claims to mock, and profits exceedingly by it.

      Yeah, I'm going to go out on a limb and say that that's not only "unsubtle", it's exploitation, not satire.

      --
      You are not a brain: http://books.google.com/books?id=2oV61CeDx-YC
    43. Re:Captain Obvious? by sjames · · Score: 1

      It's a fundamental truth of management. Managers are mostly about building personal fiefdoms and marking other manager's territory as their own (the same way dogs do). Any benefit to the company is purely accidental. The project doesn't start out with marketing having any authority over it at all, but if it goes well, they'll eventually realize they are in danger of not having their names on a successful project, so they latch on. They know their late influence is more likely to sink the project than help it, but it's win-win for them. If it sinks it is naturally because the other managers were incompetent and didn't bring them in soon enough. If it succeeds, it will naturally be because they saved it from itself at the last moment.

      The one thing marketing really knows how to sell is themselves.

      The vast majority of really successful projects that come out of the corporate world run as a couple of people killing time somewhere who then spring the already completed application on the company at large only after it is clearly too late to make changes to the 1.0 version.

      New versions sometimes struggle out fairly unscathed mostly because they can build on a completed core and so have a ready made excuse to not make too many radical changes to a successful design.

    44. Re:Captain Obvious? by sjames · · Score: 1

      Good luck! You won't be able to get them all to show up at the same time. They prefer to ignore your project for a while so if it fails early their names won't be anywhere near it.

  3. Obligatory XKCD by doubleplusungodly · · Score: 5, Funny
    --
    ---
    1. Re:Obligatory XKCD by Anonymous Coward · · Score: 0

      This is why those of us who can work fast and well make so much money.

    2. Re:Obligatory XKCD by Anonymous Coward · · Score: 1

      Obligatory website: http://thedailywtf.com/

  4. same... by jimpop · · Score: 2, Insightful

    It's no different than business school examples vs real world practice.

    1. Re:same... by Anonymous Coward · · Score: 4, Funny

      It's no different than business school examples vs real world practice.

      And English class samples (such as books and essays that they have you read) versus the comments you read on YouTube.

    2. Re:same... by maxwell+demon · · Score: 1

      Of course the people who write comments on YouTube usually are not paid for it.

      --
      The Tao of math: The numbers you can count are not the real numbers.
  5. Sounds like sour grapes to me. by Jane+Q.+Public · · Score: 2, Interesting

    Author of TFA had some bad experiences, worked for some bad software houses, generalizes it to "everybody".

    I do not agree that his generalization is necessarily valid. Sure, code in the real world seldom looks like code in textbooks, because code in textbooks is usually designed to solve a discrete problem in a stand-alone way. In the real world, this code will be part of a larger system under circumstances that are less ideal. (Different business requirements, or slightly different mode of operation, etc.)

    1. Re:Sounds like sour grapes to me. by thetoadwarrior · · Score: 1

      I'd say in most cases he's right. I've worked in places with people of all varieties of skill levels and education and there is one consistent thing and that is code quality gets compromised. If you're lucky it's just a few bodge jobs, if not, then you have a whole heap of shit that has no value.

  6. Given by vanyel · · Score: 2

    It's "rarely acknowledged" because it's just a given...

  7. Its a joke right? by Anonymous Coward · · Score: 0

    Are you kidding? I do systems programming code all day In C/C++, and the hacker code in the ANSI C book is a steamy pile of crap. We would have security problems, and hard to find bugs all over the place. This is not to mention that our static analysis tools would prevent such code getting into our code base.

    1. Re:Its a joke right? by RabidReindeer · · Score: 2

      Are you kidding? I do systems programming code all day In C/C++, and the hacker code in the ANSI C book is a steamy pile of crap. We would have security problems, and hard to find bugs all over the place. This is not to mention that our static analysis tools would prevent such code getting into our code base.

      Try the Enterprise Java books, instead. J2EE has a built-in security framework. It's not very sophisticated, but it's well-tested and it intercepts many types of exploits before they can get anywhere near the application code.

      On the other hand, I've seen many DIY login/security systems over the years and most of them are total tissue paper security-wise.

      So what do all the Enterprise Java books use for examples? DIY login screens!

    2. Re:Its a joke right? by lgw · · Score: 1

      Hehe, systems programming in Java, that would be a thing.

      --
      Socialism: a lie told by totalitarians and believed by fools.
    3. Re:Its a joke right? by Anonymous Coward · · Score: 0

      I had a sun spot once and it was awsome

  8. not true by technosaurus · · Score: 1

    Most of the code that I spent time reading was my own, and trust me - it wasn't perfect... probably should have bought the text book.

  9. School code by phantomfive · · Score: 5, Insightful

    The opposite is true too: code you see in textbooks is often horrible. It omits error checking, often uses global variables, makes assumptions, etc. Someone mentioned that K&R has memory leaks all over the place, because it's more readable.

    The goal of textbook code is to be readable, to communicate, not to handle every possible case. This means industry code is often less readable, but more solid. I'm sure I've missed other ways academic code is bad.

    Of course a lot of industry code is unreadable and also not solid. That's another issue.

    --
    "First they came for the slanderers and i said nothing."
    1. Re:School code by GGardner · · Score: 4, Insightful

      I'm sure I've missed other ways academic code is bad.

      The biggest difference is that academic code is _short_. If your whole code base is 10k lines, it's easy to cover all the requirements in a clean design. If you are dealing with millions of lines, there's all kinds of oddball unforeseen interactions and requirements that pop up way late in the game.

    2. Re:School code by Anonymous Coward · · Score: 1

      Another difference between real world code and school code...

      Real world code is actually doing something at this moment in the real world, unlike theoretically perfect academic example code.

      Just sayin...

    3. Re:School code by arielCo · · Score: 2

      Textbook code is meant to illustrate only the thing being discussed. A book would be less readable if every snippet contained the proper boilerplate for exception handling, pre-execution checks, malloc+free tracking, etc... That's usually covered in separate sections, and the professional coder should be aware of the need even if K&R didn't lecture him on it.

      --
      This post contains no rudeness or derision of any kind. All arguments are friendly. Terms and exclusions may apply.
    4. Re:School code by SydShamino · · Score: 3, Insightful

      This is what I came here to say. (Disclaimer: I'm a hardware engineer and most of the code I write is in HDL.)

      There are two factors at work.
      1. With the exception of big thesis-style projects, most academic work is scoped for you by the nature of the assignment or the teacher. This is almost never true in the real world.
      2. When options are available, the proper way to write code is the way that is most readable and supportable. However, the most readable way to write a given piece of code varies by its scope.

      Thus, as you work on real-world code, you might design something a certain way because it's the cleanest, most readable way you know. Then, later, as the scope of the project is made more clear, either through your own investigation or through changing business requirements, you have to modify the code, but you don't have enough time to toss it all out and start over with a new design that is the most cleanest, readable way to do things given the new requirements. This is most especially true when the scope changes in little steps, each one of which seems small enough to not be a big deal.

      My example is with state machine design. For a simple system that moves between a few states and has a few Moore outputs, a single-process state machine with good state names and a few comments is readable and supportable - it all fits on one page. But if I'm designing a 50-process state machine to handle a big, complex process (and can't break it down into multiple machines for timing or whatever reasons), then I'll use a multi-process state machine, with state and nextstate separated, and probably a dedicated process for each I/O or group of I/O signals, where each one can get it's own page-sized bit of code and comments. The latter style is much harder to read and follow for simple systems, but if the former type morphs into the latter type, I need to cut it out and start over. That's only possible when time permits, and I don't own my time when I'm on the job.

      And all of this assumes that you even bothered to write the code the most readable and supportable way the first time. Far too often the first time code is written, it's written to get "something out there working" so the analog guys or marketing can test their stuff or show it off. And then you don't get time to even fix that code into something readable in the first place. With a project manager and a few software and analog engineers waiting on you, demanding time to do things right the first time can be challenging.

      --
      It doesn't hurt to be nice.
    5. Re:School code by Anonymous Coward · · Score: 0

      Someone mentioned that K&R has memory leaks all over the place, because it's more readable.

      K&R is pretty short, so if it's in there, you could show some references (ha ha, pointer humor)

      otherwise, I don't think there are many full programs in K&R, so it would be hard say. maybe some example sort function doesn't free some mallocs, but I really doubt it.

    6. Re:School code by Anonymous Coward · · Score: 1

      >>Of course a lot of industry code is unreadable and also not solid. That's another issue.

      I had the source for windows 2k for a while, and marveled at how it could actually run for more than say... one minute.
      but the other developer snippets for both Vista and 8? You could not pay me enough to write for that crap?

      Metro has got to be the ultimate cesspool of 'commercial' software, like Taco bell is to tacos.

    7. Re:School code by phantomfive · · Score: 1

      Yes, yes, but that doesn't make it good code.

      --
      "First they came for the slanderers and i said nothing."
    8. Re:School code by ranton · · Score: 1

      Don't forget that most academic code (assignments and projects) is horrible just because it is written by the same bad programmers that will eventually write crappy code for the companies they work for. I wouldn't want to work with at least 80% of the students I have ever been in classes with. In graduate school, my final in our Design Patterns class was so easy I couldn't imagine getting anything wrong, but the average grade with around 65%. And obviously the school decides to curve it so people can pass without actually learning anything.

      There is simply far too much software that needs to be written and too few people capable of doing it. That leads to crappy developers getting hired anyway and good developers being rushed.

      --
      -- All that is necessary for the triumph of evil is that good men do nothing. -- Edmund Burke
    9. Re:School code by phantomfive · · Score: 1

      Maybe. I was a horrible programmer in college compared to where I am now.

      --
      "First they came for the slanderers and i said nothing."
    10. Re:School code by Anonymous Coward · · Score: 0

      I'm sure I've missed other ways academic code is bad.

      The biggest difference is that academic code is _short_. If your whole code base is 10k lines, it's easy to cover all the requirements in a clean design. If you are dealing with millions of lines, there's all kinds of oddball unforeseen interactions and requirements that pop up way late in the game.

      The biggest difference is that in the real world, in order to understand the code, you will need to go to some outside document repository which details all the "3rd party" dependencies. After exhaustive searching, you will discover the most recent update to the reference material came just before the critical feature you're trying to fix was added.
      In school, there will be a variety of other texts available with the ideal solution and a full explanation.

    11. Re:School code by jhol13 · · Score: 1

      I'd say biggest difference is that academic code always adhere to standards. If you have a "cat", it will allways "meow" in the examples. In real life "this particular cat may not be tried to meow as it will end up in catastrophe" situations happen all the time.

      Then the academic books always can agree on the specifications. In real life should a "cat" "meow" if the "meow time" is zero? Ten "cats" by ten programmers and I am certain someone will "assert" and worse.

    12. Re:School code by narcc · · Score: 2

      Good as in what?

      Good as in "pedagogically sound"? As that is the sole purpose of the code in question, if it meets that criteria, then it's good code.

      Colleges and universities aren't trade schools, you know.

    13. Re:School code by narcc · · Score: 1

      I was a horrible programmer in college compared to where I am now.

      Save a recent example of what you consider exemplary work on your part and take a look at it a few years from now. You'll think that you were a raging moron when you wrote it. I figure that a good chunk of bad code comes from good programmers from the past. That doesn't mean they were bad programmers then, just like you're probably not a bad programmer now -- but you'll think that you were in a few years!

      Part of that is because we tend to continuously improve over time, as we gain wisdom and experience. Part of that comes from buying in to the latest fads, "best practices", etc. only to discover how horribly misguided we were later on. The crazy part is that we often don't recognize that we've bought in to the latest myth! (Remember when Java sucked because it lacked multiple inheritance and everyone, a majority on Slashdot at least, thought that multiple inheritance was not only a good thing, but essential?)

    14. Re:School code by phantomfive · · Score: 1

      Good as in code that anyone would want to run anywhere near production lol

      --
      "First they came for the slanderers and i said nothing."
    15. Re:School code by phantomfive · · Score: 1

      No, I do write good code now. A lot of times it could be made better (especially when solving tasks I've never solved before), but it is always:

      1) Functional, it does the task required.
      2) Readable, although to a degree this is subjective.
      3) Flexible, when you need to change it or add to it in the future, you will have no problem.

      Furthermore I can achieve all these things in nearly any language, from C to assembly to Erlang to Perl, although readability might suffer somewhat in assembly due to its verboseness.

      Academic code often doesn't even achieve #1, the books say things like, "If you actually want to use this you'll have to add error handling/code for special cases." It's a subset of the code required to achieve the task. Of course, they are only using it to teach, so that is what they want, but it doesn't mean you'd ever want to actually run that code.

      --
      "First they came for the slanderers and i said nothing."
    16. Re:School code by chengiz · · Score: 1

      > Someone mentioned that K&R has memory leaks all over the place, because it's more readable.

      Well, someone is wrong. K&R code is very, very good; among the best you'll find in any programming language book.

    17. Re:School code by phantomfive · · Score: 1

      Well, someone is wrong.

      Yes, you. Look on page 109, section 5.6, in the readlines() function. He's allocating a full array of strings there, where is that getting released? And I found that after 60 seconds of searching. There are others.

      --
      "First they came for the slanderers and i said nothing."
    18. Re:School code by chriscappuccio · · Score: 1

      I marvel at how you think you even know what the fuck you're talking about. You sound like an utter moron.

    19. Re:School code by WuphonsReach · · Score: 1

      Java's single inheritance still sucks, but it does keep you from doing stupid things.

      At least now, with aspects, you can do things like have a class implement an interface while also supplying a default implementation of that interface.

      --
      Wolde you bothe eate your cake, and have your cake?
  10. True by Anonymous Coward · · Score: 0

    I must agree... The company i work for now has amassed some of the shittiest code ive seen in my whole life and ive been coding professionally for 12 years now.

  11. No surprises here. by csumpi · · Score: 5, Insightful

    Because in real life:

    - specs change constantly
    - need to work with crap that's already there
    - there are deadlines
    - need to get stuff done

    And I'm pretty sure I'm forgetting some other points.

    1. Re:No surprises here. by Anonymous Coward · · Score: 1

      And I'm pretty sure I'm forgetting some other points.

      No, I think you covered the most relevant ones pretty well.

    2. Re:No surprises here. by Anonymous Coward · · Score: 1

      The consequences of making a mistake (bug) are very low for most software: just fix it and release a new version. When the consequences are higher (medical equipment software, Mars rover) the code quality will probably be better too.

    3. Re:No surprises here. by Anonymous Coward · · Score: 0

      - you have less resources than the scope of work would actually require if done idealy

    4. Re:No surprises here. by Xtifr · · Score: 3, Insightful

      - Requirements are messy (even not counting the fact that they change constantly)
      - Textbook code is designed to look clean, but often ignores important edge cases for the sake of simplicity. (See previous point.)
      - Cleaning up the code may potentially introduce bugs, so once the code gets past QA, it's often considered untouchable until a demonstrable problem is found.

      I'm sure there's even more...

      (Test-Driven Development (TDD) is supposed to help address that last point, but A) it's not always perfect, and B) it's not universally used.)

    5. Re:No surprises here. by jnaujok · · Score: 3

      You forgot:

      - No one is willing to fix code that already exists because it works "good enough"
      - No one is willing to expend the resources (read time and money) to go back and rewrite bad piece of code.
      - Fear of new code exposing how bad the other code is.

      (32 years of real world coding.)

      --
      Life, the Universe, and Everything... in my image.
    6. Re:No surprises here. by gutnor · · Score: 2

      Another one: in real world you get stuff wrong.

      • * Because you are just human and if you code 8 hours a day, 250 days a year, a few of your numerous mistakes will made it through to the client.
      • * Then you get stuff wrong because you are not alone, and communication between humans is hard, so hard that it is another profession altogether. Something will eventually be lost in translation situation between you, your team, your bosses, your client.
      • * More importantly, unlike in the books, most of the choices you make do not have a right or a wrong answer. You chose a solution and you know if you right down the line.

      Being wrong require costly rework, or the mythical "phase 2".

      Last one: code in books and academia sucks.

    7. Re:No surprises here. by Anonymous Coward · · Score: 0

      Some other possibilities:

      - The company had half or more of the project done by the lowest bidder.
      - There are mutually exclusive requirements that *must* be fulfilled, by any means possible.
      - The two best programmers have two completely different styles and each threatens to quit if forced to conform to the other's standards.

    8. Re:No surprises here. by Anonymous Coward · · Score: 0

      Those are good points.

      From an Object Oriented standpoint though as soon as you run into transactions, sessions, and databases,

      1) Data gets ripped out into data objects
      2) Behavior gets sucked into services
      3) There goes your "objects"

      More generally, code gets written in horizontal layers rather than vertically as it really should, this is again, because of using the same underlying technology.

      Also, Rails, Grails, etc perpetuate this by encouraging the lumping of all controllers together, all services together (at least in examples). There is no emphasis on the actual domain and what actually makes good sense to logically clump together, that would actually lead to much more robust code. Unit tests are not usually technically logically thought out components that are tested, just end-to-end tests that happen to cover a component rather.

      Its hard to fight quick and dirty when requirements are changing as you code. Disheartening, the system works against you, really.

    9. Re:No surprises here. by Anonymous Coward · · Score: 0

      * Because you are just human and if you code 8 hours a day, 250 days a year, a few of your numerous mistakes will made it through to the client.

      8 hours a day? I want your job.

    10. Re:No surprises here. by jimshatt · · Score: 2

      In my company too, refactoring is considered taboo. (hey, that rimes!) Code gets copypasted all over the place because nobody dares touch a piece of working code. So when a bug is found in the duplicated code, it's fixed in 7 out of 10 (all slightly different) duplications (or worse, just the one place the bug shows up).
      I rather take the blame when a new bug is introduced by refactoring a piece of code so it can be used from multiple sites, than create another duplication. I then usually mumble something about not having unit tests, but I know that even with that minor new bug, I've probably saved the company 10 major bugs (and a few depressions from later maintainers)

    11. Re:No surprises here. by jimshatt · · Score: 1

      Ah yes! And what I also really hate, is people not telling each other that their code isn't good. I mean, everybody makes mistakes, but for the love of code, let's prevent the same mistakes from happening over and over again.

    12. Re:No surprises here. by Anonymous Coward · · Score: 0

      "consequences are higher (medical equipment software, Mars rover) the code quality will probably be better too."

      FDA will ban sales if they think your code or docs are bad. And they actually inspect.

    13. Re:No surprises here. by gspec · · Score: 1

      Another point: Hundreds of people touching the source code. In college, how often does one work with multiple people on a same source code for more than 2 semesters?

    14. Re:No surprises here. by JasoninKS · · Score: 1

      One noticeable thing you forgot: multiple layers of people (most of whom wouldn't know a good design if it bit them in the aft end) offering their non-optional opinions, therefore fudging up the whole process.

    15. Re:No surprises here. by maestroX · · Score: 1

      And I'm pretty sure I'm forgetting some other points.

      Yes, mostly Perl related though.

    16. Re:No surprises here. by loom_weaver · · Score: 1

      Lots of good points but there's a doozy that didn't really exist even 10 years ago.

      24 hour development.

      I travel a lot for work and I get to observe monster codebases (10 MLoC+) in very large companies. The typical setup kind of looks like this:
      * Project managers and build and release engineers in North America in 2+ locations
      * Development groups in India, China, Eastern Europe, and maybe a few token devs in North America

      Non-stop development from teams of various level of proficiency constantly checking in code. Due to the nature of the geographically disparate teams there isn't any decent windows for downtime, refactoring, and maintenance. Add in all the communication challenges and needless to say real world code sucks even more than it used to.

    17. Re:No surprises here. by Anonymous Coward · · Score: 0

      What are these "specs" you speak of?

    18. Re:No surprises here. by Anonymous Coward · · Score: 0

      I saw a spec once, it spread it's little wings, jumped out of the nest, fell to the ground and the cat ate it.

    19. Re:No surprises here. by maxwell+demon · · Score: 1

      Are you sure? If he codes 8 hours a day, he probably has at least 10 hour of work per day after you add in meetings, code review and bureaucracy.

      --
      The Tao of math: The numbers you can count are not the real numbers.
    20. Re:No surprises here. by ccguy · · Score: 1

      You forgot: Because developers are in general worse than they think they are.

    21. Re:No surprises here. by Anonymous Coward · · Score: 0

      refactoring is considered taboo. (hey, that rimes!) Code gets copypasted all over the place because nobody dares touch a piece of working code

      Ironically, refactoring is the process which you can transform the code safely so you wouldn't break the system with the implicit assumptions lingering in the paste.

  12. School v. Reality by girlintraining · · Score: 5, Insightful

    This just in: Examples provided in school have no practical real world application. Duh. In the real world you have things like deadlines, bosses, and clueless managers. When you screw up in class, the teacher tells you where you messed up and you get a chance to do it again. In the real world, when you screw up you probably won't know what you did, at least not right away. And you're going to have to figure it out while everyone is mad at you, calling your phone, and asking why it died.

    I don't know where this idea of the Zen Programmer(tm) comes from with visions of calm blue waters and bright bleached sand and everything is calm, thought out, and composed. Programmers I know hammer down mountain dew like it's nobody's business. They do not spend months debugging and thinking about it academically: If it works, you move on to the next thing. Don't bitch about the quality of the code (manager or academic) in the real world because there are almost no programmers in the corporate world that sit around thinking in O notation and figuring out the best and worst case scenario for every line of code. They bang out 500 lines in a few hours and then hit compile and hope to god it works on the first go.

    That's reality people -- you don't have the time, the resources, and if you took the academic attitude to work with you, you'd be cut up and used as shark food by everyone else for being so damn slow and pragmatic when they need things working tonight so they can go home after being there for 15 effing hours to make the latest milestone.

    --
    #fuckbeta #iamslashdot #dicemustdie
    1. Re:School v. Reality by neminem · · Score: 2

      Really? Generally speaking, when I was in school, when I turned in a homework assignment, I was told where I messed up, and then went on to the next assignment. Only rather rarely was I given even one assignment to fix any of my previous mistakes, as far as coding went, and the only time there was any kind of "keep fixing it until it's fixed" mentality to any school-related project was my whole-year-long senior project... which was part of a program designed to give us real-world experience by giving us actual real-world assignments paid for by companies. (The company I was working for that year hired me when I graduated, and I'm still working there!)

      Yes, sometimes due to deadlines (or simple cost-benefit analysis), not everything will always be perfect when it ships, but I'd certainly always take code written by a company and designed to be shipped, over code designed to be written and turned in as a homework assignment...

    2. Re:School v. Reality by betterunixthanunix · · Score: 1

      Homework assignments are different from real-world code. Homework assignments are rarely built on code written by other people. Homework assignments are rarely checked for robustness against bad inputs; students usually know exactly what sort of input to expect and need not worry about anything else. Homework is usually small -- rarely do you see homework assignments exceed 1000 program statements in any language.

      Real world code is not like the code students are assigned in school.

      --
      Palm trees and 8
    3. Re:School v. Reality by SirLurksAlot · · Score: 3, Insightful

      Don't bitch about the quality of the code (manager or academic) in the real world because there are almost no programmers in the corporate world that sit around thinking in O notation and figuring out the best and worst case scenario for every line of code. They bang out 500 lines in a few hours and then hit compile and hope to god it works on the first go.

      That's reality people -- you don't have the time, the resources, and if you took the academic attitude to work with you, you'd be cut up and used as shark food by everyone else for being so damn slow and pragmatic when they need things working tonight so they can go home after being there for 15 effing hours to make the latest milestone.

      You're working with the wrong programmers then. See, you want the ones that write quality code and test-drive the crap out of everything so they don't have to put in 15 hour days to make the latest milestone. By the way if you're working 15 hour days it means you're mismanaging your manager and their expectations (and/or you suck at your job).

      --
      God, schmod. I want my monkey man!
    4. Re:School v. Reality by girlintraining · · Score: 1

      when I was in school, when I turned in a homework assignment, I was told where I messed up, and then went on to the next assignment.

      Me too. They changed that though when the parents complained that their precious snowflake wasn't getting first place in everything; So they abolished competitions. Now there's no such thing as an 'F' in many schools, and they have about half a dozen more letters to represent just how exactly their kid didn't 'F'ail. It is (as my teenage sis would say) "ridonkulus".

      Yes, sometimes due to deadlines (or simple cost-benefit analysis), not everything will always be perfect when it ships, but I'd certainly always take code written by a company and designed to be shipped, over code designed to be written and turned in as a homework assignment...

      So would I: Because there's a use for one, rarely for the other. Articles like this are like saying "We shouldn't use cars because they pollute" and then suggest we all switch to bicycles until the One Perfect And True Green Solution(tm) arises, perhaps powered by crystals shoved up your butt or some other damn thing. There are programmers who build things academically, and there are programmers who build things like engineers. Engineers give you a best fit solution for a given amount of resources. Academics will always be trying to modify your requirements to fit with this latest paper by some guy who said that the bogo sorting genetic algorithm has the lowest O notation for your use case ever and... zzzzzz... you're already asleep. -_-

      --
      #fuckbeta #iamslashdot #dicemustdie
    5. Re:School v. Reality by phantomfive · · Score: 1

      there are almost no programmers in the corporate world that sit around thinking in O notation and figuring out the best and worst case scenario for every line of code.

      Wow, speak for yourself. I DO think of this on every line of code I write.

      Of course, the vast majority of code is either O(n), O(n^2), or O(1), so usually this isn't actually hard, unless you put vectors in your stacks or something.

      The question is, why aren't you thinking about how long your code will take to execute?

      --
      "First they came for the slanderers and i said nothing."
    6. Re:School v. Reality by cas2000 · · Score: 1

      so what you're saying is that programmers need to stop being such fucking wusses that they put up with shit working conditions like 15 hour work days?

      or maybe they should form a union.

    7. Re:School v. Reality by mikael · · Score: 1

      Hardware and software was a lot simpler back 30 years or more. One of our courseworks was to write keyboard and network card device drivers along with a text editor and simple chat programs. A keyboard driver could be written using BIOS interrupts in page of code. Same with a network card driver and text editor/chat program. Even source code control was done using SCCS which meant that only one file could be checked out at a time by one person.

      Applications programming was straightforward - create a main window widget, some auxiliary screens and link everything together with callbacks and parent/child hierarchies. A large application might be split into a couple of threads; user input, background processing, and immediate commands.

      Now, a modern application is going to split into multiple languages; plugins, scripts, CUDA/OpenCL and DirectX/OpenGL shaders, multi-threading API's, C++ class hierachies using STL/Boost/Boost++, other middleware API's, animated 3D GUI's. If one part of the application fails it can take everything else done with it. While changes can be reverted, it does cause slowdowns for everyone else.

      --
      Vintage computer adverts: http://www.vintageadbrowser.com/computers-and-software-ads
    8. Re:School v. Reality by Anonymous Coward · · Score: 1

      Generally speaking, when I was in school, when I turned in a homework assignment, I was told where I messed up, and then went on to the next assignment.

      As in so many things, it's much easier for academia to allow a little inaccuracy than to explain everything; and that's exactly what happens in academia.

      Academia is nothing like the "real world" because in Academia, you're told (in big red letters) where the mistake is.

      In the commercial workforce, if someone messes up properly, it whizzes past code reviews, and makes it into the finished product. Happens all the time, at even the most serious of development houses.

      When schools start handing out broken million-line codebases, and tell you to fix it, then I'll consider it "real world" coding. And that's the problem: Academia is more concerned with writing new code than they are in maintaining and/or fixing pre-existing crap. There's no textbook named "Polishing Turds: Improving Crap Code"

      Academia has a number of "basics" they consider important - and academia's basics often have absolutely no bearing on what is important in the workforce.

    9. Re:School v. Reality by angel'o'sphere · · Score: 1

      I rather think an hour and then crank out 200 lines of code per hour, that solve the same problem, and go after 7 hours work into the park (summer) or pub (winter) ....

      Your world must be full with incompetent programmers.

      You now: less is more ...

      (And milestones are so 1980s ...)

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    10. Re:School v. Reality by jareth-0205 · · Score: 4, Insightful

      You're working with the wrong programmers then.

      Yes, because it's always possible to work with the best programmers the world can provide. In the *real* world there is a finite availability of top programmers, and they might not be working where you are.

      You show yourself to be very naive if you think that every business has the time to let you do TDD, and will provide you with a perfect, experienced team of developers.

    11. Re:School v. Reality by Anonymous Coward · · Score: 0

      LOL, you think TDD creates good code. I am maintaining some code written by a guy that is the poster child for TDD. His code is a huge nasty mess of abstractions, interfaces, and transformers that we task only our most senior devs on. It's disgusting to work with, everyone hates it, it's nearly impossible to debug, etc. TDD isn't the reason the code is miserable, but it sure as heck didn't stop him from making the code miserable. Good code is code that does really complex stuff that can be maintained by a junior programmer. Because in 90% of cases that's who is going to be on the maintenance team. The senior and/or most talented devs move onto the "next big thing" and the code is left to dregs of the (offshore) maintenance team. TDD is nice, but it's tangentially related to good code.

    12. Re:School v. Reality by Anonymous Coward · · Score: 0

      Jeez and I wonder how many planes would fall out of the sky if every aircraft engineer thought that way.Or how many peoples
      Cars would blow up if they were pushed out the production floor onto the streets in the hope that they would just work.
      No wonder where having so many problems!.

    13. Re:School v. Reality by the+eric+conspiracy · · Score: 1

      That's about right.

      In the stuff I'm doing all I have to worry about is if it's worse than O(n) or not.

      If it is it's too slow.

      Done.

    14. Re:School v. Reality by the+eric+conspiracy · · Score: 1

      > ridonkulus

      So your sister is Sarah Palin?

    15. Re:School v. Reality by Anonymous Coward · · Score: 0

      See, you want the ones that write quality code and test-drive the crap out of everything so they don't have to put in 15 hour days to make the latest milestone. By the way if you're working 15 hour days it means you're mismanaging your manager and their expectations (and/or you suck at your job)

      It's not always about you.
      "Uh, ya so we finally canned Jim and Sure As Shit he had been sitting on a whole assload of projects. We tossed dice, and it fell on you to go in and completely re-write the backend for this system. It's gotta be done by end of business tomorrow, by the way. I know you've got it in you to bust this one out for us."

    16. Re:School v. Reality by Anonymous Coward · · Score: 0
    17. Re:School v. Reality by thethirdwheel · · Score: 1

      I don't know where you work, but the complexity of the algorithms we're using comes up every day at work. The difference is that you can't just implement the "assume without loss of generality" version of the algorithm; you have to actually make the damn thing work. And you have to handle possibly corrupt inputs, and up and downstream failures, and your problems span multiple algorithms feeding into and through one another.

      So yeah, its complicated, and there's time pressure, but at good development shops people think about quality. It's just that quality is a much higher bar when you're trying to develop supportable systems for complex and evolving problems. What looks like ugly code to academics is, often as not, just hardened code, code that deals with the mess of disk failures and language-level memory leaks and all the detritus that piles up around our implementations of the turing machine. The big challenge is that the particular crap around the turing machine shifts over time, and no one has enough time to pay down technical debt all the time.

    18. Re:School v. Reality by Psychotria · · Score: 1

      They bang out 500 lines in a few hours and then hit compile and hope to god it works on the first go.

      That's reality people -- you don't have the time, the resources, and if you took the academic attitude to work with you, you'd be cut up and used as shark food by everyone else for being so damn slow and pragmatic when they need things working tonight so they can go home after being there for 15 effing hours to make the latest milestone.

      Huh, surely the pragmatic person would leave the academic attitude behind, and your sentence is backwards. Mainly because the most common definition of pragmatic is "Dealing or concerned with facts or actual occurrences; practical." That's why there's #pragma... it may not be "right" but it's available and used because it's practical. Similarly the pragmatic programmer is probably faster than the non-pragmatic programmer because the pragmatic programmer does take into account the time, the resource, and the desire to go home at night.

    19. Re:School v. Reality by narcc · · Score: 1

      I rather think an hour and then crank out 200 lines of code per hour

      Only a retarded dog would measure developer productivity in lines of code per hour.

      Your world must be full with incompetent programmers.

      Considering that you replied to him, I'd say that there is at least one incompetent programmer in his world.

    20. Re:School v. Reality by angel'o'sphere · · Score: 1

      Productivity is not measured in lines of code but features done. My point is: I rather write less code than more code to do the same thing ... he seems to believe it is cool to write a lot of code.

      What you want to say is not really clear to me ...

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    21. Re:School v. Reality by smcdow · · Score: 1

      See, you want the ones that write quality code and test-drive the crap out of everything so they don't have to put in 15 hour days to make the latest milestone.

      Yes, exactly. So that when the inevitable mid-project changes to requirements, scope, and/or milestones happen, they'll be better able to cope with throwing away all that up-front planning and preparation -- and start working 15 hour per day to meet the new deadlines.

      --
      In the course of every project, it will become necessary to shoot the scientists and begin production.
    22. Re:School v. Reality by lennier · · Score: 1

      That's reality people -- you don't have the time, the resources, and if you took the academic attitude to work with you, you'd be cut up and used as shark food by everyone else for being so damn slow and pragmatic when they need things working tonight so they can go home after being there for 15 effing hours to make the latest milestone.

      And that attitude towards correctness and security is exactly why we have a Net filled with tens of millions of infected botnet hosts.

      --
      You are not a brain: http://books.google.com/books?id=2oV61CeDx-YC
  13. From the article by phantomfive · · Score: 1
    Wow, check out this quote from the article:

    in casual discussion, developers and tech managers will talk about all the wonderful things their system does, the stellar technical skills of their team, and how much their users love them — and all that may be true.

    Do developers and tech managers really go around talking about how much their users love them? Why have I never met any of these developers and tech managers?

    --
    "First they came for the slanderers and i said nothing."
    1. Re:From the article by Samantha+Wright · · Score: 4, Funny

      The last page bashes Haskell using a snippet from Uncyclopedia as anecdotal evidence that it is "all but impossible to write readable code" in Haskell.

      Beyond it is another dimension: a dimension of whinge, a dimension of fallacy, a dimension of diminished journalistic integrity. You're moving into a land of more shadow than substance, of vague and half-baked wit; you've just crossed over into the Register.

      --
      Bio questions? Ask me to start a Q&A journal. Computer analogies available for most topics!
  14. My life is hell by Anonymous Coward · · Score: 0

    Picture this kids: Object-oriented jscript based Classic ASP website using a VB6 DLL querying a SQL server databse with stored procedures longer than 20,000 lines, very poorly commented and not documented at all. Plus there's hardcoded bullcrap in with all that code that should have been made database driven, functions that are redundant, variable declarations and comments in Indian (not English). And then there's enough views-upon-views-upon-views in the database to make your head spin and causing all the slowness in the world, client very angry because it takes so long to deconstruct and boil it all down to a single stored procedure so they can get some performance back.

    DIE IN A FIRE WHOMEVER YOU ARE WHO WROTE THIS CRAP!!!

    1. Re:My life is hell by gagol · · Score: 1

      Crappy, hard to maintain code helps you stay employed...

      --
      Tomorrow is another day...
    2. Re:My life is hell by CodeBuster · · Score: 2

      Crappy, hard to maintain code helps you stay employed

      How would you feel if the people that made your car shared that sentiment? It's attitudes like that that give the profession a bad name. Take some pride in your work and don't be the guy that's cursed by everyone who comes after you.

  15. Just like the movies by overmoderated · · Score: 1

    In the real world, there no chance that a single man takes out entire armies. There is also no chance that CSI detectives drive Hummers. Academic code is better, because the purpose is entirely different. Once you start coding for a company, you basically become a code monkey under strict financial and other constraints. It's slave labor.

    1. Re:Just like the movies by Anonymous Coward · · Score: 0

      It's slave labor.

      Are you not being compensated?

      Are you not permitted to find alternative employment?

      Then it's not slave labor.

      Period.

    2. Re:Just like the movies by overmoderated · · Score: 1

      Alternative employment is also slave labor. Actually, anything that is based on monetary gain is slave labor.

    3. Re:Just like the movies by Anonymous Coward · · Score: 0

      um, except you can leave at any time for another programming job with better pay. i've done this twice. now i have a job i really enjoy without much pressure and a nice paycheck. it's a good business to be in.

  16. School != World by fahrbot-bot · · Score: 1

    To be precise: a tremendous amount of source code written for real applications is not merely less perfect than the simple examples seen in school — it's outright terrible by any number of measures.

    Life is messy and the real world is complex; deal with it.

    --
    It must have been something you assimilated. . . .
  17. In Other News... by SirLurksAlot · · Score: 4, Insightful

    Water is wet, the sky is (perceived as) blue, the world *did not* end, etc.

    On a more serious note I wouldn't describe any of the code examples I encountered in school as perfect or "well-thought-out" specimens." Nearly every one of them was a trivial case which ignored most error cases and expected the client human/system/software to be well-behaved. I've often thought that Comp. Sci. students (3rd or 4th year) should be forced to pick up someone else's code and refactor it into something workable. I'm not talking about the disgustingly huge and unmaintainable messes that we work with out in the real world, but something big enough to give them an inkling of the kind of scope they'll be expected to deal with.

    I also think that if you're not learning TDD in school these days you're not getting your money's worth, and you'd actually be jeopardizing your career by not learning this early, as it is a life-saver out in the real world.

    --
    God, schmod. I want my monkey man!
    1. Re:In Other News... by Anonymous Coward · · Score: 0

      TDD meaning 'test driven development" where code is written after functions are written to test that the code does what it needs to.

  18. A soccer team analogy . . . by PolygamousRanchKid+ · · Score: 4, Insightful

    In the academic world, if you were tasked with picking a perfect team, you would steal players from Real Madrid, FC Barcelona, a fistful of Germans, Franck Ribery, etc.

    In the real world, if you are tasked with managing a programming project, you don't get to pick the best. You are given some young kids with more energy than sense, an old, wise, but disgruntled experienced guy, who nobody listens to, a few folks who really don't give a damn, and most of them really truly detest each other. So you try to make out as well as you can, with what you've got.

    Hey, Mercedes are great cars, why isn't every car built like them? Well, not everyone can afford a Mercedes, and maybe most folks can get by with just a Ford.

    It's just the reality of life vs. theoretical academics. Despite the physics problems you solved in college, there are no frictionless surfaces. Or the ones that are available, you just can't afford.

    --
    Schroedinger's Brexit: The UK is both in and out of the EU at the same time!
    1. Re:A soccer team analogy . . . by Ryanrule · · Score: 0

      Fords these days are better put together than MB's

    2. Re:A soccer team analogy . . . by LDAPMAN · · Score: 3, Informative

      Wrong. My Benz has 11 airbags. My Fordrd does not. My Benz has massive brakes that can bring me to a stop in 1/3 less distance. The list goes on and validates the previous posters point.

    3. Re:A soccer team analogy . . . by Legion303 · · Score: 1

      That just sounds like really horrifying pornography.

    4. Re:A soccer team analogy . . . by Anonymous Coward · · Score: 0

      1/3? Specify the models you are comparing please

    5. Re:A soccer team analogy . . . by Anonymous Coward · · Score: 0

      Yeah, and my Mercedes was basically a glorified Chrysler which broke down constantly and eventually caught on fire. Your point?

    6. Re:A soccer team analogy . . . by Ryanrule · · Score: 1

      Are you plain retarded?

      What was the price for each? Are you comparing a 25k car to a 80k car?

    7. Re:A soccer team analogy . . . by LDAPMAN · · Score: 1

      Actually, the nearest vehicle Ford makes to my 450GL is over 60K well equipped. I was simply refuting the assertion that Fords are better put together than MBs. I have both...it's not even close even though the price difference is under $20K.

    8. Re:A soccer team analogy . . . by Ryanrule · · Score: 1

      Oh you drive suvs. Your opinion on cars is void.

  19. Yes. by Anonymous Coward · · Score: 0

    When I first came out of university, I came in contact with a C++ code base consisting of ~100 000 files, with hundreds of developers working on the code.

    There are files of 10 000 lines of code or more. There's code that used to be good, but got missed up by so many people doing small changes, slowly turning it to crap.
    There's also the code that was always crap, and just became crap on top of more crap.

    And every so often, you find a little jewel, and try to make sure it doesn't become crap.
    Or you refactor some code in hope of making it somewhat decent.

    But that's just a whole lot harder than what you read about it 'in theory'. In practice, you have to get your features done, and the time to improve code is limited. It's possible, but it's not easy. And some people simply don't care about quality or don't want to spend any time on it, that doesn't exactly help.

  20. Skimmed article - more than it deserves. by Anonymous Coward · · Score: 1

    Everyone is a moron who doesn't code to the style they were taught.

    I was taught at Yale that a programming language was just syntax - algorithms are what's important. All this horseshit about the right tool for the job was just that - horseshit.

    I've personally witnessed some awesome code written by so called "morons" and some shitty code written by "geniuses".

    What's the difference? people skills.

    That's right asshole, programmers are just as gullible to smooth talkers as people to politicians.

    Now, go back to your bitching about nonsense.

    1. Re:Skimmed article - more than it deserves. by c0lo · · Score: 1

      Now, go back to your bitching about nonsense.

      And don't forget to apply the only insightful solution suggested by the article (after whining about various kinds of crap you should expect in real-world code, the last phrase):

      there’s one simple and completely painless way to prevent future generations from cursing you when they look at your code: Include some comments!

      If you can explain what your are doing, good chances that your code has some merits. If you can't, then nobody will be able to understand it.

      --
      Questions raise, answers kill. Raise questions to stay alive.
    2. Re:Skimmed article - more than it deserves. by Jeremi · · Score: 2

      Ah, Slashdot... where a post about the importance of "people skills" can't go for more than a sentence without calling someone a "moron" or an "asshole".

      I get the feeling that Anonymous Coward was actually this guy.

      --


      I don't care if it's 90,000 hectares. That lake was not my doing.
  21. I think he's mostly correct by Chirs · · Score: 4, Interesting

    I work in enterprise embedded stuff where the systems are five nines reliable, and even there we've got problems. We recently ran into a day-one bug that suddenly turned and bit us because we switched to a different brand of hard drive.

    1. Re:I think he's mostly correct by Anonymous Coward · · Score: 1

      because we switched to a different brand of hard drive.

      .. What?

      Abstraction is for sissies! Pff. What do those kernel devs know about drivers? All those APIs just getting in the way! By god we'll grab hold of the SAS port by it's balls and bit bang the data on to the drive ourselves! Take THAT latency!

    2. Re:I think he's mostly correct by Anonymous Coward · · Score: 0

      day-one bug

      What does this even mean in this context? ...that couldn't be said without using the words 'day one' at all.

  22. most claiming crap code by codepunk · · Score: 3, Insightful

    Most of the time the person claiming the code is crap is the one I find to be most to blame.

    --


    Got Code?
    1. Re:most claiming crap code by Anonymous Coward · · Score: 0

      Because they just took over spaghetti code they won't touch with a pitchfork?

      Good. They probably saved your company alot of errors and customer grievances.

    2. Re:most claiming crap code by Anonymous Coward · · Score: 0

      Most of the time the person claiming the code is crap is the one I find to be most to blame.

      So what you're actually saying is that you'd rather shoot the messenger.

      In my experience both good and bad coders complain about the bad code of others.

  23. other way around? by Anonymous Coward · · Score: 2, Interesting

    I've worked in opposite land apparently... Code quality output by a team of well-vetted coders that I used to work with was high by my standards - low bug rate, decent code coverage for unit tests, generally well documented.... Then I moved to a place where the product was a postgraduate project from a dozen or so CS students. No documentation, ill thought through design, no unit tests, and unmaintainable architecture choices. Why? No real-world experience and no reason for polish, so long as a "working" proof of concept doesn't fall over while being evaluated. (Among other things.)

  24. Wrong Comparison by bossk538 · · Score: 1

    Wrong comparison. Most programmers don't write for textbooks, and those that do I would think are exceptionally good coders. A more apt comparison would be between the code written for CS students for academic projects and that written by working professionals in the field.

  25. Academic by zieroh · · Score: 1

    Personally, I find academic code -- that found in textbooks and other teaching materials -- to be poor specimens. These are examples that teach methods and concepts, but utterly fail to account for edge cases and real-world scenarios. Real-world code may not always be pretty, but it is a lot more comprehensive than what you will find in textbooks.

    The author of the TFA is, IMHO, misguided.

    --
    People who say "sheeple" have about as much sophistication as an AOL user, and in fact are probably actually AOL users.
    1. Re:Academic by DragonWriter · · Score: 2

      Personally, I find academic code -- that found in textbooks and other teaching materials -- to be poor specimens. These are examples that teach methods and concepts, but utterly fail to account for edge cases and real-world scenarios. Real-world code may not always be pretty, but it is a lot more comprehensive than what you will find in textbooks.

      IME, the exact opposite is true; code in textbooks is far more often to address a specifically defined problem domain correctly (often, a problem defined in such a way that edge cases which might be important in a "real world" program are outside of the problem domain, but nevertheless the specified domain is correctly addressed -- the exception being code in textbooks that exists specifically to support exercises which address identifying and addressing edge cases that are within the problem domain), whereas with real world code it is often the case that the problem domain is -- even if you are lucky enough to have design documentation accompanying the code -- poorly specified, and quite often the code is not correct for the problem domain and fails to account for edge-cases and real-world scenarios that occur both in the defined problem domain (to the extent that such a thing exists) and the actual domain in which the program is applied.

      Though its true that the real world code is often more "comprehensive", if by that you mean the opposite of "concise" rather than the opposite of "incomplete".

  26. Never met anyone who learned to code in school by Anonymous Coward · · Score: 0

    You go there only to get the paper.

  27. and in IT / admin jobs CS is way off base to the p by Joe_Dragon · · Score: 1

    and in IT / admin jobs CS is way off base to the point where a tech school is like a real workplace (IT setup wise) and in a tech school you learn very hands on VS the theory of it all.

  28. Extra word in the headline by Anonymous Coward · · Score: 0

    You could leave out "Code" and it would still be true. We live in an imperfect sublunary realm, not the eternally ideal empyrean.

  29. We hire only the best by Anonymous Coward · · Score: 0

    Every company I've interviewed at, and by extension, every company I've ever worked for (a subset), told me that their software devs were the best and the brightest. Top notch people, all of them.

    And then I got there and dived into the code. Well, it's never been all bad,

    And then my captcha for posting this is trough, as in pig trough. How'd they know. ;-)

  30. Obvious Observation, Misleading Conclusions. by VortexCortex · · Score: 5, Informative

    Yeah, they're right about the state of things, but they get the "why" part totally fucking wrong:

    The most common reason for the existence of bad software is bad programmers.

    NOPE! Bad software is a result of BAD Code, even good programmers can write bad code...

    At the other end of the spectrum, many projects are sabotaged by developers who are “too good”

    NOPE! Maybe those scare quotes are there for a reason, but "doing things the most complex way possible" is usually because coding is iterative and there was no way for you to know of the unforeseeable future requirements.

    And then there’s “bad” laziness, the kind that leads programmers to cut corners or do things in the quickest possible way, rather than taking the three extra hours to do them right.

    NOPE! You're assuming that the programmer WANTED to do things the quickest way possible...

    If the system is working, almost no manager will pay just to have you recode a piece of it “the right way,” without adding any new functionality. There’s always something more important that needs to be done—until that quick-and-dirty fix blows up and (because it’s urgent) gets replaced by another quick-and-dirty fix.

    BINGO! This. Everything, all of the other bullshit is due to Management. Not just not paying to have things done right (see: Fast, Good, Cheap), but also unrealistic schedules and deadlines, new features being promised by sales without consulting the programmers, etc. Deadlines exist. That's why even a good programmer hacks in a kludge ridden short cut instead of taking the time to do it the right way: There is no time to take! The most common reason for bad software isn't bad programmers, is bad management and terrible working conditions. See also: Getting what you pay for when you outsource the programming department. The outsourced workers will get it done cheaper in less time -- Cheap, FAST -- What's missing here, eh? GOOD Sadly to compete with the fast and cheap the goodness of the software must be sacrificed.

    As mentioned above, C++, despite its superficial similarities to Java, is infinitely easier than Java to write impenetrable code in. And one language I’ve been warned about, though I’ve never had the opportunity to use it, is Haskell, an offshoot of ML. According to a friend in academia who’s studied it, it’s “the Taliban version of ML,” in which it’s all but impossible to write readable code.

    Just stop talking noob.

    In the real world, tight budgets, shortsighted managers, and unreasonable expectations from non-techies almost always conspire to make developers do things too quickly.

    You mention this and yet you somehow fail to realize THIS, not Languages, not Laziness, not Ignorance, not Hubris, is what is really the root cause of all the damn evil?! Fuck you, man. You're part of the problem.

    In conclusion: Bad software is primarily a result of GREED.

    1. Re:Obvious Observation, Misleading Conclusions. by PRMan · · Score: 1

      You make a good point about greed, but I think it's "e. all of the above."

      I have seen developers that were so bad they couldn't write anything good if they tried. Managers typically don't know enough or don't have time to do anything about it. Besides, they are already trying to add 2 more people. If they fire that guy, they have to add 3.

      The worst failures we have at my current company (which hires very well) are problems caused by too smart developers being too clever, creating code that is unmanageable for anyone with less than 140 IQ and stellar recall skills, which less than 10% of programmers have. And we have some very poor beginner developers that can write working, easily-readable, easily-maintainable code. I'll take that any day.

      There are developers that never get around to anything and then rush at the last minute. That's largely gone away now due to Agile. But laziness is typically good as lazy developers tend to use libraries and write as little as possible, leading to the less bugs, more readable code, etc.

      And the final reason is everything is cheaped out and rushed.

      --
      Peter predicted that you would "deliberately forget" creation 2000 years ago...
    2. Re:Obvious Observation, Misleading Conclusions. by Anonymous Coward · · Score: 0

      +1

    3. Re:Obvious Observation, Misleading Conclusions. by Anonymous Coward · · Score: 0

      I agree with what you said and want to add one thing.

      The market doesn't pay for perfect code. It rewards good maintainable code later in the lifecycle when unanticipated features are needed for an existing codebase. We are all at the mercy of the market.

      If MySpace had perfect code and Facebook had sloppy code, it wouldn't change a thing.

    4. Re:Obvious Observation, Misleading Conclusions. by Anonymous Coward · · Score: 0

      BINGO! This. Everything, all of the other bullshit is due to Management. Not just not paying to have things done right (see: Fast, Good, Cheap), but also unrealistic schedules and deadlines, new features being promised by sales without consulting the programmers, etc.

      How come that Uncle Bob says that professional developers should say no?

  31. Managerial problem by Anonymous Coward · · Score: 0

    Do you promote writing 5,000 lines of spaghetti code that 95% of the mortal coders can relate to and maintain? Or do you thank your guru for writing 500 lines of crisp, clean code that nobody will be able to maintain when the guru quits?

    The crisp, clean implementation has fewer if statements because the corner cases are covered by the well chosen constructs. The clean methods have a simple loop in the middle and 25 lines of code. Methods of ordinary coders have 150 lines of meandering code with confused and misleading comments that apparently made sense to somebody at one time.

    However, that meandering corresponds more closely to the thought processes of the mortal coder and the superfluous if statements give them a better conviction that all corner cases are covered. In reality, the clean method covers them all and the meandering code ignores a few crucial special cases, but the mortal maintainer of the code will see just the opposite.

  32. How to make real code that is good by Brett+Buck · · Score: 2

    The article appears to mostly be self-indulgent/elitist crap, but there is a kernel of reality in it.

          What some of my colleagues and I have done to avoid the "obscure features" problem of "expert coders" is to ban their use. A particular language we use permits many fairly obscure features that lend themselves to writing mystery code. We simply don't use them unless absolutely necessary. This is embedded spacecraft code, we only need basic relational statements, math functions, and minimal pointer use. So we don't use some of the more obscure features (doubly-defining tables, unnecessarily complex data structures, the more bizarre capabilities of pointers, etc). The code is still maintainable 30 years later, people can pick it up and read it from cold, and modify it with ease and safety.

  33. Between This and the Last Story by Anonymous Coward · · Score: 0

    I'd say the front page is a direct result of how vacation days increase with the amount of time someone has been at a company. The last two stories were clearly written by recent college grads, because anyone with more than eight months of experience knows that code standards are important and not all of your coworkers write the best code. I just assume they made the front page because all of the folks with experience have today off and weren't around to submit better stories.

    Not me, though. I hate Christmas.

  34. communicating well is hard by binarstu · · Score: 3, Insightful

    From TFA: "Good software, misleadingly, is usually easy to read, but it’s not easy to write."

    What is misleading about that? The same could be said for any of the formal mechanisms we've invented for expressing our thoughts and ideas to other humans. Good oratories, good lectures, good books, good journal articles, and so on, are all easy to consume, but speaking or writing well requires tremendous effort and practice.

    1. Re:communicating well is hard by Anonymous Coward · · Score: 0

      The statement isn't even true. I stepped through a linked list using a double pointer and I had to explain to someone on code review what I was doing, line by line.

    2. Re:communicating well is hard by Nemyst · · Score: 1

      Perhaps the author was misled into believing writing good articles was easy?

    3. Re:communicating well is hard by binarstu · · Score: 1

      Love it! If I could mod your post up "funny," I would.

  35. Undergraduate OS class and reality. by Anonymous Coward · · Score: 0

    This conflict is why, when I taught Operating Systems, I assigned code modification tasks. I had never been taught how to work on other people's code, and it is a skill _every_ professional programmer will need. The programming project was to modify an OS (Minix at the time, now I'd use FreeBSD or Ubuntu) in some relatively non-trivial way. Lectures included a trip through "how to read code you don't understand" and "how to investigate if something looks fishy."

  36. Amount of code by shdowhawk · · Score: 1

    I don't think i've seen school code that ever made it past 1,000-2,000 lines of code

    My last few projects were in the 100,000+ lines of code range (multiple employees)

    Regardless of school code being good or bad, it's easy to write good code when you have clear business rules for needs to get done and you only have to write something small

    1. Re:Amount of code by Anonymous Coward · · Score: 0

      Most of my college assignments were on the order of 10k. In courses with term projects (maybe 1/4 to 1/2 of courses, depending on which upper-level courses you decided to take) assignments were often on the order of 100k.

      100k is small, even for a school project. Our freshman get up in the 10k range for term projects. I've never worked on a "real" codebase smaller than 1 mloc. I have real in quotes because at my institution, term projects often turn into startups and/or small side project revenue generators for students.

      Out of curiosity, where did you go? Was in a super theory-heavy program or just bad?

    2. Re:Amount of code by shdowhawk · · Score: 1

      Ohio/Northern Kentucky area schools (jumped between a few schools because I moved a lot). Most were theory heavy (senior year project example: write a solitaire game that plays itself to figure out how often it can't win. no UI, just output results of each game), "fix the problem in code" projects, or lots of on paper stuff. We did do stuff in various languages as well. The C projects were always smaller than that java ones.

      I should mention that this is undergrad, not a masters or phd. Still, i jumped between a few different schools and it all seemed to be the same.

  37. Just like the Boy in the Bubble by Dave+Emami · · Score: 3, Interesting

    You look at it as "the real world sucks." I look at it as "college doesn't prepare you for the real world." It doesn't prepare you, because it doesn't expose you to it at all.

    In college (at least, when I was there), the focus was entirely on showing you good code, not showing you bad code. This is like running a medical school where the doctors-in-training only see top-form athletes and never get a glimpse of sick people. Beyond lack of experience, a lot of the time the best way to understand why certain standards or principles are good is to see what happens when they're not followed, and you just don't see that in a classroom.

    At the risk of drifting into "get off my lawn!" territory, allow me to give an example I experienced.

    During my classes ("software engineering principles" or something like that), one of the things we went over was coupling, and why loose coupling was better than tight coupling. Passing parameters is better than using a global variable, which is better than reaching into another module's guts, etc. All very reasonable, and everyone agreed that it made sense. However, nobody, including myself, seemed to give it much weight. Most of us already coded that way, anyway, so it wasn't any big revelation.

    A few months later, at a job that involved maintaining and extending a decent-sized (by early 90s standards) application, I had to work with code by a guy who declared a single variable, "s", as an 80-char string, and used that all over the place. Different functions read and wrote to "s" at their whim and without regard for what other code might be doing with it. It was used in place of function parameters, in place of function results, and sometimes just as a temporary variable. Naturally, this caused all sorts of difficult-to-predict bugs. It was when dealing with this crap that a light went on in my head and I realized, "Oh! This is what the prof meant when he said tight coupling was bad!"

    --

    "The Greens lynched a hacker in Chicago. Last month, but I think the body's still hanging from the old Water Tower."
    1. Re:Just like the Boy in the Bubble by bio_end_io_t · · Score: 1

      Right on. Schools do a horrible job of teaching how to code. Too much theory; not enough memory alignment or thinking about cache boundaries. Not enough about error checking or the graceful handling of errors. But hey! They teach Chomsky Normal form!

      --
      bio->bi_end_io(bio, error);
    2. Re:Just like the Boy in the Bubble by Anonymous Coward · · Score: 0

      School is about memorization and regurgitating crammed texts.
      You can automate the process and optimize exam results using computer technology.
      Thus, modern schools are redundant.
      It'd even be a fun exercise! ;-)

      Do you want to be a machine, or human? If you wanna be a machine, you're already outsourced.

    3. Re:Just like the Boy in the Bubble by Anonymous Coward · · Score: 0

      Agreed, If college was the real world, the bottom half of the class would be expelled before the end of the first semester. You pay to go to college, they don't pay you, that's the difference, it distorts everything else. How could it ever be like the real working world?

      Ideally people would learn to learn in college, so they can keep learning afterwards, learning the current state of the art is good but secondary. The reason being that 5 years from now it won't be state of the art and without continual learning then what? More college?

  38. Perfect is the enemy of good by gestalt_n_pepper · · Score: 1

    Ideally, we'd all sit in a room and model our system, identify the classes, define all the member functions, embed all the unit tests, error conditions and comments first, and then as an afterthought, fill in the code.

    The requirements of the real world, of course, make this impossible. The real world says, "get it out on time and good enough to make money."

    --
    Please do not read this sig. Thank you.
    1. Re:Perfect is the enemy of good by volvox_voxel · · Score: 1

      Le mieux est l'ennemi du bien. (The best is the enemy of the good.) -- Voltaire

    2. Re:Perfect is the enemy of good by angel'o'sphere · · Score: 1

      The real world I live in requires that 85% and more of the code is covered by tests.

      They don't care if it is developed TTD, or if the tests are mere unit tests or scanario/story based tests for business requirements, though.

      Nothing is impossible, and stuff many programmers believe 'impossible' only need a few things: experience, skill and dedication.

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
  39. when you devise the problem and solution... by Anonymous Coward · · Score: 0

    I'd like to see a textbook case of converting a legacy spreadsheet codebase to support an email client, or some other such nonsense.. I'd be a whole lot more interesting than another freaking Fibonacci sequence generator. If you control the problem and the solution, of course it's a cakewalk.

  40. The Author Clearly Never Had A Job As A Programmer by assertation · · Score: 1

    The conflict lies in the fact that, whereas nearly every sample program in every textbook is a perfect and well-thought-out specimen

    The person who wrote that clearly never had a job as a programmer.

    These days, you can't even count on code from computer books compiling, let alone being exemplars of good code.

  41. Best code I've seen ... by PPH · · Score: 1

    ... was written by the groups that used it.

    Management gave us (Engineering) a task to complete. Either do it by hand or automate it. They didn't care. Just get it done right, on time and for a reasonable budget.

    The code started to get shitty when the computing group found us writing our own tools and took the task away. The code stank, but it was blamed on poorly defined requirements (which they collected). The s/w folks didn't have any responsibility for actually performing our work and missing schedule was our problem, not theirs. As long as we waited patiently in line for their change process, they didn't get dinged for delays. And to top it all off, when they took over our apps (NLP of engineering requirements documents to produce executable code), they just started pulling claims of NP-hard out of their backsides as to why they were getting into trouble. We (Engineering) would never have dreamed of lobbying management for the responsibility for a task and then turned around and claimed we didn't understand how to do it.

    --
    Have gnu, will travel.
  42. Related, featured on /. a few months ago by arielCo · · Score: 2
    --
    This post contains no rudeness or derision of any kind. All arguments are friendly. Terms and exclusions may apply.
  43. You think that's bad by HangingChad · · Score: 4, Insightful

    Obviously the author has never tried to untangle outsource code. If he thinks home grown code is bad, wait until he wades through a bowl of Bangalore spaghetti code. Yummy.

    Although I did make a lot of money sorting through that crap. Many companies would just assume outsource code would work when they needed it and couldn't figure out how come their wonder app, that they got done for half of what U.S. programmers would have cost, kept crashing.

    --
    That's our life, the big wheel of shit. - The Fat Man, Blue Tango Salvage
    1. Re:You think that's bad by CodeBuster · · Score: 2

      YES! The Indian outsource shops especially are notorious for producing poor quality code that fails to meet required minimum standards for what's acceptable in most American and European companies. To any managers out there reading this, beware of outsourced development. IBM and other big tech companies get away with it because they run their own operations in India and hire the better people. This leaves only the bottom of the barrel for your next outsourced project. That bid was cheap for a reason so don't be fooled. Hire an American instead or you'll be wishing that you had when the consultants hand you their bill for what it will cost to "fix" the outsourced project.

  44. It's all relative by davidbrit2 · · Score: 2

    This is why I use Access a lot. Compared to the awful ERP and operational software that's out there, the little things I throw together look perfectly fine. And if I can go from concept to deployed application in an afternoon, then that's less cost to the business. We had an old RMA tracking application written in VB6, that had the database server name hard-coded. I spent a couple of hours with Access, totally rewrote it, and actually made it better. I certainly wouldn't write an entire accounting system in Access (probably), but in a world of software written with necessary business constraints and compromises in mind, do as the Romans do.

  45. Haskel bashing by Anonymous Coward · · Score: 0

    I am working with Haskell for a long time and don't understand the Haskell bashing in that article. Hard to understand code samples can be created in any language and give zero insight into how working with that language is like. I think the guy just wanted to post an unqualified rant and does not deserve the Slashdot attention he got.

    TL;DR: That article is pretty ignorant.

    1. Re:Haskel bashing by maestroX · · Score: 1

      I am working with Haskell for a long time and don't understand the Haskell bashing in that article.

      Neither do I. Elegance vs readability.

      There is, however, a more pressing Haskell issue:
      (diary excerpt)

      • 2002-01-01: plan hobby project to nurture and show off ego
      • 2002-01-02: decided to try and port ghc to msvc++ in a few weeks/months
      • 2002-01-03: figuring out compiler structure
      • 2002-01-05: WTF frigging perl demangler
      • 2002-01-16: sjeesh assembly
      • 2002-02-01: christ cygwin-less build system
      • 2002-02-05: nearly done.., need some nfo, just a sec

        WHAT? this guy Simon Marlow allocated 3-5 FSCKING days ("difficult") for the port of GHC to the Microsoft Visual C++.
        O M G ! ! ! F E E LS S O D E P R E S S E D * *
      • 2003-02-01: Perl job application accepted.
  46. Academia is not the real world by Anonymous Coward · · Score: 1

    I bet most academics who preach about how to write good code have never worked in the real world or written a program more than 10k long

  47. Academic Code Blows by Anonymous Coward · · Score: 1

    Most programmers I've known that spent their life in academia write crap. I've seen very well engineered software "in the wild" by seasoned experts (i.e. +10,000 hrs of real world coding). Also, most academics or new grads have little to no experience with Software Engineering practices such as Agile, Scrum, TDD, etc. Not saying that any one of these automatically makes you better. But unless you written unit tests (many of them), you have no idea how to do it. Alot of academics will "analyze" their code, and let the compiler have a go at it. If their "analysis" and the compiler think its okay, then its okay. I always say "1 test is worth 1000 expert opinions". That is why I test my code, and why I've learned so much by testing my code.

  48. Once upon a time ... by rover42 · · Score: 1

    I woked as a texg writer at a large company that I won't name. The group I was in developed test tools for internal use company use, nothing that got shipped to clients. They had 600,000-odd lines of C code in the tool set. One day I did some grepping through it. I cannot recall everything I checked, but all my results were awful. Things I do recall: A couple of thousand uses of functions that could fail like fopen() or malloc() without the idiom (fp = fopen(...)) != NULL or the same with ==. I checked a few manually, and none had any other error checks. Only about 5% of switch() statements had a default case. There were under 10 uses of the assert() macro in the whole set, all in one guy's code.

  49. Not surprising by Anonymous Coward · · Score: 0

    In the real world the goal is good enough; not perfect. The definition for good enough comes from the customer; not necessarily the end customer, but like Dell for computer components. Is it any wonder that less time is spent cleaning up the code after it is proven to work? Also in the real world the code will be worked on for years with bug fixes and enhancements (an old patched up house isn't is pretty as a brand new house). I see no surprises here.

  50. The real world sucks, the code is just inside it by caywen · · Score: 1

    It's not that real world code in particular sucks. The world sucks. The code is in it. If nature provided practically unlimited general computing power really easily, code would be frickin beautiful. Computing power is woefully constrained, so code, the tools the process it, and the systems that execute it are woefully constrained. So, bad code becomes easy to write.

  51. I beg to differ with the author by volvox_voxel · · Score: 2
    Most text books are very simple relative to real-world code, and a great many books out there are average or poor. A large percentage of the code that you find on the internet is also bad, but it's often better than what you can find in textbooks. I've been a programmer for more than 10 years. Most of the code I have been exposed to has been pretty elegantly written. Well written code is probably more common than poorly written code for software engineers in Silicon Valley, though my vantage point is rather limited. Employers don't pay through the nose for Spaghetti code.. Silicon Valley is, by and large, a meritocracy. Well written code begets higher titles, salaries, other ventures with the like-minded.. Well written code is easily recognizable by your colleagues.

    I've always held that 90% of anything is bad with respect to books, movies, music etc. After 10 years, the good authors tend to stand out.

  52. Real world code rocks by iamacat · · Score: 1

    Do you cook by following a fancy french cookbook line by line? Do you drive like on DMV test? Then why do you expect anyone to code by textbook?

    Real world code is great because it works, solve a problem and puts food on the table of company's employees. If it becomes so successful that the problems are noticeable, then there is enough funding to write version 2.0. But in the beginning its more important for the product to be out of the door as soon as possible.

    1. Re:Real world code rocks by the+eric+conspiracy · · Score: 1
  53. real world code by Anonymous Coward · · Score: 0

    Real world code is written by all sort of people with all sort of background. A majority of code is from folks that has no computer science background. In my case, majority of code is from physics/math majors with experience writing Matlab.

    ask the math folks how to write a double array vs array of pointers

  54. Academia Isn't the Real World? Who knew??! by mckellar75238 · · Score: 1

    So, "real world" code isn't clean and elegant. So what? Get over it. In case you haven't noticed it, most of us out here don't look like high school or college athletes, either. Life is a compromise between avoiding problems and getting things done. Look at the problem you've been dealt, do the best you can with it, and go on to the nest one.

  55. NOT by Anonymous Coward · · Score: 0

    Management has dictatorial powers and they hide behind your bullshit argument to cover their asses when shit hits fan.

  56. Unit tests by mrprogrammerman · · Score: 1

    Unit tests allow you to refactor without fear.

    1. Re:Unit tests by smellotron · · Score: 1

      Unit tests allow you to refactor with less fear.

      FTFY. There are certain classes of modules which can be tested with 100% coverage of code paths and input data ranges, but not all.

    2. Re:Unit tests by Xtifr · · Score: 1

      Well, you can refactor without fear if you're overoptimistic. And when it comes to writing code, aren't we all overoptimistic? :)

      But yes, relying wholly on tests assumes your tests are without flaw, which is about as likely as the code being without flaw in the first place. Still, it's better than the alternative--not relying on tests. :)

  57. Requiring communication among stakeholders? by lenski · · Score: 1

    BLASPHEMY.

    At least from the point of view of the executive manglement team.

    The last time I saw a mid level manager require written documentation from more than one stakeholder (marketing, business analysts, etc.) at a time, he was FIRED, for "being inflexible". This after he offered *many times* to help shepherd the process including discussing the effort of various options that might be chosen for implementing the ideas under discussion. Also after >3 years of trying to implement under-specified, over-promised features whose priority was always greater than refactoring and cleanup as the application experienced shifts in functional emphasis to match changing market conditions.

    I've been doing this stuff since 1977 and the most consistent statement that could be made about top management people was "he or she has never felt the pain of an ink pen in hand". Fear of commitment. Frequently we who had to keep things going just did as much work as possible, hoping for the best. Unfortunately, even with the willingness to get into the work, our vision was necessarily limited, and consequently so was our success rate.

    Beyond a certain point, high level managers become extremely risk-averse. It's explainable: The challenges of getting details right are many, and the likelihood of success is small due to the vicissitudes of most business marketplaces. I believe this is why there's lots of talk about "taking risks" but truth be told, risk taking is such a fear-inducing process that it's never used.

    With that complaint out of the way, I agree with your premise. I merely observe that I've seen it carried through about once or twice in 35 years.

  58. Fad-based programming by Anonymous Coward · · Score: 0

    The one other major contributor to "maintenance hell" that I've seen is fad-based programming. At some point, someone comes up with the idea that new technology X is the bee's knees, and starts to apply it extensively in the code-base (without having any significant prior experience in it). This doesn't work so well, and it winds up being dead weight rather than beneficial. This may be because X was just hype, or because the programmer really didn't know how to use X properly (and your damn production code was the WRONG place to conduct your learning experience).

  59. WTF/minute by Anonymous Coward · · Score: 1

    I prefer this one:

    http://www.osnews.com/story/19266/WTFs_m

  60. Reality by degeneratemonkey · · Score: 2

    Code is bad because of deadlines, everyone seems to agree.

    Bad is relative though. If the software satisfies its business case, and ultimately doesn't have unmanageable maintenance costs associated with it, it's basically good regardless of its failure to meet standards of elegance and clarity.

    People write good real-world code all the time, and most of it is open-source. You can attribute bad industry code to greed, and that's valid, but it doesn't necessarily imply that the result is bad. Greed isn't going anywhere and greed builds some useful stuff amidst all the messes it creates.

    Even in the projects where time is not a constraint, growing complexity often leads to programmers making design compromises. These aren't necessarily as heinous as what you find in profit-driven code, but they exist because software is hard to get right when the problem being solved (i.e., the set of requirements) is almost always a moving target.

    There is always a compromise between toiling endlessly in the realm of over-engineering, or shipping a release some time in the next century.

  61. but non progamming stuff works.. by Anonymous Coward · · Score: 0

    yeah, right
    welcome to the real world, where screws don't fit, the parts are poorly designed, etc etc
    what on earth gives you programmers the arrogance to think that you are any different then anyone else ?
    you really think great design and engineering are found outside of coding ?
    get real - sturgeons rule applys equally to everyone and everything

    a few years ago, Boeing had the smart idea of asking the ground crew what they wanted in a new plane.
    The guys at O'hare in chicago said, you know, it would be nice if we could open the fuel tank without having to take off our gloves....

  62. Things must have gotten better by Anonymous Coward · · Score: 0

    Most code I've seen in textbooks is written assuming that everything will work (very little error handling) and that the code will be used by people who know how to use software and can accept garbage-in/garbage out. Most of those examples wouldn't make it into a real product.

    Of course, I admit that a lot of the code I work with is a mess. It would be great if we could afford to fix it, but if it works it's hard to get management to spend the effort.

  63. Code is considered to have little no value by pudknocker · · Score: 1

    So it is hacked, poorly designed, and gets more fragile with each fix/change. Experience coders know: You may not have time to do it right, but you'll have time to do it again. I was surprised to see all the comments justifying crappy code.

  64. Oh hell yeah by holophrastic · · Score: 1

    Having owned and programmed my own software company for twenty years now, absolutely real-world code is crap. It's horrible. At least 30% of my code is detrimental to my business, and at least 50% is just plain embarassing. But that's never been the point. If the point were to write good code, I'd need another source of income.

    I work for small and medium businesses. And each and every client couldn't care less about the code. They ask the same questions: "will the bad code still work?" and "will you be there to fix the problems when it doesn't?". Since the answer to each is "yes, absolutely", the bad code would be a waste of time to write better. Every client will choose more bad code over less good code every time.

    And it makes sense. Another feature is something a business can flex. Better code isn't.

    So much of my code is ugly, some holds together well but just barely, and some requires my personal input or maintenance on a routine basis. But my clients don't care what work the code does and what work I do. It's all the same to their bottom-line.

    As for the article's last comment that comments improve things, that's absolutely incorrect. Bad code may be bad, but with enough time and focus anyone who knows the language can figure out what the code does. Bad comments, on the other hand, are a con job. And since comments become stale as code grows and changes, comments are terrible things.

    So instead, I format my bad code in a very legible manner. It may be bad, it may be slow, and it may be weird, but read it enough times and you'll know what it's doing. There are no comments to confuse you.

  65. the best companies have both by RedHackTea · · Score: 4, Insightful

    When I first graduated college and got a programming job, I thought the code was a bit shit too. Then I learned about deadlines and most importantly Bit Rot. I soon realized that you need both strokers and crankers to make a successful company (I like bowling terms).

    Crankers bang out code like there is no tomorrow. When good managers find these people, they immediately put them in the department of developing new features. Competition is fierce, and a lot of times it doesn't matter about quality but about who gets there first. End of story.

    Strokers take their time with code. They are fit for the "support queue," debugging, and any specific jobs that require needlework precision. I work in this department. I fix a lot of code made by Crankers, taking in both memory-efficiency and speed-efficiency. So when a customer finally does have 10,000 loads which the Cranker didn't foresee in his/her code, I fix it, and the customer is happy. I also provide a lot of options to the user instead of forcing the user down one path. Lastly, I do jobs that require excellent quality. Do not give money-critical new features to Crankers; give them to Strokers. I actually have used a lot of the the computer sciencey things that I learned in college like Big O, various Dijkstra algorithms, etc.

    Tweeners are the in-betweens. They are good for the basic infrastructure/architecture. They write the base library fast and with decent enough quality. For example, they may write layers around the database, GUI, etc. to make life easier. If you don't have a Tweener, then use a Stroker. If you need the product out fast though, use a Cranker and then a Stroker later on to refactor, or use a Cranker and Stroker in unison.

    To make a killer software company, you need all three. And the companies that last a long time, have managers that know how and where to place these people.

    --
    The G
    1. Re:the best companies have both by RedHackTea · · Score: 1

      Well, I actually meant Software Rot, but I hear most people in my community say Bit Rot for hardware and/or software.

      --
      The G
  66. Call me crazy by eWarz · · Score: 2

    Call me crazy, but i think we spend too much time on complex OOP based code. No I'm not making this up, I might know more languages than you, but I've also had the unfortunate opportunity of working on more shit code than most people. We need to go back to basics. When a company can hire a 3rd party team to write a 3rd party CRM cheaper than it is to modify an internal CRM there is a problem. Pay attention to this next part: When a class library becomes so complex it takes more time to maintain the library than to write new functionality, you have a problem. It should be easy to understand a code-base without spending days learning an API. code needs to be more adaptable to chancing situations. When a pharma company can spend $600,000 per year to maintain a 3rd party CRM because a first party CRM costs millions to mod, there is a problem. Just my observation though. *glares at top 20 pharma companies* thx for the awesome paycheck.

    1. Re:Call me crazy by eWarz · · Score: 1

      Sorry for the crap spelling folks...1am here...good night all.

    2. Re:Call me crazy by narcc · · Score: 1

      No worries, you're not alone.

      Though I've got to say, having read your post, that your .sig has me absolutely baffled!

    3. Re:Call me crazy by Anonymous Coward · · Score: 0

      You might take a karma hit for this one, but you're absolutely right. People need to justify all their zany models and patterns somehow. There's this palpable vitriol laden with insecurity that comes blurting out here anytime someone simply doesn't like using them. It's really quite pathetic.

  67. Does it work? by ducomputergeek · · Score: 1

    Usually when I am coding something I have some task that needs to be done. Often it's something that is thrown together using CPAN modules, but the end result is something that gets the job done. Could it have been done better or more efficient in another language or by a better programmer? Probably. But honestly for most tasks today computing power isn't a problem or near the expense time is. I'm still surprised at the fact that some of our core scripts and programs we use are things I put together years ago in as little as an afternoon. But they ain't broke so no one bother to "fix it".

    --
    "The problem with socialism is eventually you run out of other people's money" - Thatcher.
  68. It's Terrible Because Nobody Wants to Pay by CodeBuster · · Score: 3, Interesting

    The simple truth of the matter is that most commercial code is written by overworked developers on tight schedules and with miniscule budgets. The managers crack the whip and rush things along because the people who sign the checks don't care about quality code if it means that they won't have a "first mover" advantage in the marketplace. This is particularly true in the consumer space and the phone app world. Much of that code is just pure shit. Ironically, some of the best and worst code that I've seen in the wild comes from the open source community. Is there any good commercial code out there? I'm sure that it does happen from time to time in mature products. The engine control unit in your car or perhaps the drill bit controllers on oil field equipment or maybe the hard disk controller, but in my experience crappy code is the rule and quality is the exception. Users rarely perceive quality as long as they system works, so few are willing to pay more for it in either time or money.

    1. Re:It's Terrible Because Nobody Wants to Pay by Anonymous Coward · · Score: 0

      > Ironically, some of the best and worst code that I've seen in the wild comes from the open source community.

      Posting anonymously so I don't lose my mod points.

      There's nothing ironic about it, if you think for a moment. A large open source project is a collaboration between many programmers scattered all over the place. It MUST be readable or the project will never happen.

      Since there's little or no economic component, the programmers do the work out of pride and enjoyment, so they take the time (and HAVE the time) to do a better job.

  69. a music version by KingAlanI · · Score: 1

    "I would rather play Chiquita Banana and have my swimming pool than play Bach and starve." - Xavier Cugat

    PS
    I resent Hunger Games being associated with Twilight, much deeper despite some surface similarities

    --
    I listen to both RIAA and non-RIAA stuff if I like the music, tangential business/politics nonwithstanding.
  70. Business Is Messy by Anonymous Coward · · Score: 0

    After 20+ years of programming professionally, I've learned that even if I can get all my code into a good framework and documented and tested and 90% or so ship-shape, someone in the company will think of some new requirement that creates a whole new series of knots in my software. A sales guy just has to have some special terms for this quarter's "hot" customer, or a new product we sell has an accounting code convention that doesn't fit with the rest of the system, or marketing wants to combine products into some hitherto-unforseen chimera of a product. It just never ends.

    I joking call it "Domain Specific Knowledge", but it is the ever-changing petty demands of actual people and business conditions that constantly thwart our attempts to structure our world using logic.

    1. Re:Business Is Messy by wdef · · Score: 1

      Right, the constantly shifting sands of new requirements quickly cover up the original good code design and you end up with quickie kludge after quickie kludge after kludge. You breath a sigh of relief when the code actually runs, as much by luck as by skill, even though you can barely read it anymore, am I right? The eternal struggle between developers and product/marketing teams goes on ....!

  71. Bad code is the result of bad programmers by Anonymous Coward · · Score: 0

    Bad code is the result of bad programmers. End of story. If you blame management for your bad code, it's because you suck. A real professional is able to work with people who are not in their field in order to create something that is useful to those people.

  72. Lower quality or else.... by Anonymous Coward · · Score: 0

    Me and my team has been TOLD to lower our quality on a couple of occasions. Because it is not good business to raise customers expectations and standards. It makes it harder to sell low quality stuff. I get that completely and have no problem with it.

  73. Academic software quality by Anonymous Coward · · Score: 0

    A lot of the software that is produced in academia is horrible. No meaningful error messages, strange behaviour in corner cases, incomplete and sometimes inconsistent documentation (if there's any documentation except for a few incomprehensible examples). And that's only the user's perspective. If you look at the source code (provided that it was released at all) you can be in for a few surprises as well. Software development is never perfect and people in academia who should know better often make the most blatant mistakes.

  74. Agile & Scrum are perfect... by Anonymous Coward · · Score: 0

    so why isn't the the code coming from them perfect?

  75. Automation Industry by Anonymous Coward · · Score: 0

    I suppose you guys have never seen real world PLC code. Code that runs on Programmable logic controller.

    It is simply unbelievable how bad software can be written. Sometimes I'm really astonished, why not about 80% of all the factories worldwide just blow up given the crappy PLC code on their manufacturing machines.

  76. Code reviews by Anonymous Coward · · Score: 0

    Code reviews. Seriously. We use Atlassian Fisheye, and it's a great tool for this. Code reviews mean you have more people who will know what you wrote and how you wrote it. Your code might help them be better programmers; their comments might help you be a better programmer.

    Oh, and unit-test everything. Writing unit tests will also force you to write better code (smaller functions, more tightly defined, fewer code paths), because it's a pain to write a good unit test for poorly-written code.

  77. One person's "good" code is not universal by cervo · · Score: 1

    Different people create things that they think constitute "good" code, and to that person it makes perfect sense. But to another person that's an unmaintainable mess or unclear. Fortunately code reviews can help this situation. But sometimes a developer could have spent a lot of work re factoring (really re-designing) parts of a system, and by the time the code review comes, you can spend some time helping make it a little clear, but if the whole design is unclear often you are stuck with it and things go live.

    The way much code ends up more readable is by introducing abstractions, but if those abstractions only make sense to one developer (or a group of developers who are all best buds) then they don't really help and can make things more complicated.

    In reality some people say 500 line methods are unclear, and often they are. But if the object oriented alternative has really shoddy naming, and people were unreasonable so multiple class hierarchies are involved, each one throwing code in constructors, and multiple methods which often have side effects in multiple objects...that 500 line "bad code" starts looking pretty good to the alternatives. But to the developer who wrote the object oriented solution, his code is good and the 500 line method was a monstrosity.

    Sometimes even the same developer changes his/her mind about code being good/bad. Six months ago, it was good, now it sucks....

    And there also seems to be no universal agreement. At work they have coding standards, but they are constantly changing. Heck for a while design patterns were considered the stuff.....use them wherever you can. Then design patterns were too complicated....use them sparingly. The definition of good vs unmaintainable mess is constantly changing.

    So due to this whole "good" vs "bad" being not universal and the definition of "good" changing over time...it is hard to justify taking the time to do something "right" when often you end up with the same unmaintainable mess. In fact over 4 jobs (about to start number 5) I have not met code that I think is a pleasure to work with or is GREAT. I definitely think some was better than other code, but even that wasn't great. And when I look back at code I did, often I am not thrilled and think I could do better. But the reality is that at the time of designing the system, there was no way to anticipate when things changed, and the deadlines were pretty arbitrary/tight. If someone says you have 1 day to get this web page done....I would start writing inline HTML/Database queries to crank something out probably in 1.5-2 days (and possibly try to convince someone to let me write it in Perl for a 1 day special).

  78. YAG - yet another generalization by Anonymous Coward · · Score: 0

    this is a generalized academia versus the real world diatribe. In effect what they don't teach in academia is that software is not done in a "lab" where each person's skillset is on par with each other. A real world project is decomposed into a tremendously vast amount of work tasks that need to be choreographed to manage resource availability , resource skillset, organizational dynamics , organizational politics, competency of management, and elasticity to scope creep. Let's also add in that the resources may be in different countries. So add into that the cultural differences, managing two sets of holidays, language differences, time delay's, that they may not have the availability to get their questions answered or understand the requirements thoroughly due to the availability of the SME's and the time differences...

    I work for a well funded company and I am a manager of development projects. You have an organic team and can't expect that each person is interchangeable. In addition, we all at times function above and below our abilities due to external distractions and pressures. The same thing happens in sports. Just because you are the top of your game, you will have off days or off weeks. In addition to the project you have the long term picture of trying to grow the resources you have. If you can afford to do so, you try and grow the junior resources to handle the harder challenges. In doing so, you expect the code quality to be less than what is done in capable hands.

    And management isn't prone to having off days or also being grown to a higher level of competency. It's a generalization to think that all software managers are idiots and that if it was just code and people coding the world would be a great place. What is often forgot is that the code is part of a larger ecosystem full of users, other systems, changing requirements and business processes and politics.

  79. Professors Vs Real World by sycodon · · Score: 1

    How Professors Program:

    Show up at "work" at 9 or 10.
    Have coffee and pastries at a faculty meeting.
    Sit down at desk and code for several hours.
    Break for lunch, office hours, check out the hot coeds (maybe even do one...who knows)
    Back to programming until 4.
    Leave for the day.

    Repeat, except for all Federal, State, and Local Holidays.
    Get the book published
    Require ALL the incoming students but it at $89.95

    How a Real World Developer Programmer:

    Show up at work at 7.
    Consume a breakfast taco with bad coffee at your desk while reading emails sent by managers last night at 10PM
    Prepare your Status report, listing changes that occurred since you last status report...last night at 6.
    Attend the morning status meeting
    Go to meeting with users to get vital information so you can move forward. Except they cancel.
    Sit down to code.
    Answer call from user wondering "where we are at".
    Code some more.
    Reboot your computer
    Answer call from help desk. The CSC controlled Virus scanner has kicked off at 10 AM instead of 10PM and is killing the server....find and Pause it.
    Code some more
    Meeting with supervisor, recapping everything you recapped yesterday.
    Code some more
    Reboot your computer
    Lunch. Surf the web while eating instant noodles.Half the sites blocked by CSC.
    Post on Slashdot, see your Karma destroyed when you post that has been no Warming for the Last 16 years.
    Talk about the Hot blonde down stairs and how she has a nice ass.
    Code some more.
    Help Desk call about the server running out of disk space because some idiot "Power user" is using a temp table to do a million line query of some kind, for some reason.
    Compact the TempDB, nicely tell the "power user" to use real tables (which are on the SAN drive.)
    Reboot computer
    Code some more.
    Going away party for yet another person being laid off. At least this time they weren't secretly escorted from the building.
    Leave the premises, drive to Quickie Mart to pick up a Monster drink and donuts. Say hello to Apoo.
    Code some more.
    Try to move test app to the test system. CSC blocks you due to some new restrictions.
    Track down supervisor (who is in his own personal Hell) to make the move for you.
    Meet with users to show the latest version of the app.
    Users add 53 new requirements and tells you that most of what you've done is not needed anymore due to process changes.
    Deliberately walk back to your desk via the aisle the Hot Blonde works in. She's not there,
    Reboot computer.
    Start working on new Status Report
    Help Desk call...ID10T issue.
    Finish Report, email it.
    Leave for the day.

    --
    When Fascism comes to America, it will call itself Anti-Fascism, and tell you to give up your guns.
  80. Sox prevents refactoring by Maxo-Texas · · Score: 1

    Until about 2004, we were able to refactor and improve the quality of code.

    Now, those changes must be approved by management. And management never approves refactoring changes and always approves adding new features.

    It used to be easy to improve code... now it's almost impossible in any sox controlled environment.

    --
    She was like chocolate when she drank... semi-sweet at first and then increasingly bitter.
  81. All wrong by Anonymous Coward · · Score: 0

    Crappy code is caused only by crappy programmers in the first place. Make excuses about spec changes all you want, but a good programmer will adapt, or has already forseen this, and still writes good code.

  82. Re:The real world sucks, the code is just inside i by starfishsystems · · Score: 1
    The world sucks. The code is in it.

    Nicely said. It's true that code shares characteristics of the world at large because it exists to model that world.

    Though I can't verify your premise that the world sucks, I can still enjoy it as rhetoric. Certainly the world is complex, and so our efforts to reduce that complexity to something more tractable will meet with varying success. Here are a couple of examples that go against the claims in TFA:

    • When I was an undergrad, computer science was just starting to take off as a distinct discipline. Some excellent work had been done in theory of computation - because there is a strong meritocracy operating in the field of mathematics - but no such meritocracy had yet been established for the art and science of writing software. I saw a lot of code on the blackboard and in textbooks that, even to my inexperienced eye, was obviously flawed. The presentation was aesthetically unpleasant and stylistically not even self-consistent. Most of it wouldn't compile, much less produce the expected results. Even then I could do better. I met exactly one prof during those years who actually tested his code before presenting it to the class. So it's not automatically the case that "nearly every sample program in every textbook is a perfect and well-thought-out specimen." I'm sure the situation has improved, because our experience and culture and expectations have changed. I'm sure that it still falls short of perfection, because I can still find occasional errors in CS texts. Not every academic is a great programmer. Some of them are pretty dreadful.
    • As concerns "software in the wild", I have the good fortune at the moment to be working at a stellar software development company. It blows my mind how good these guys are. That's not to say their code is perfect, but as something which is actively involving, it's well on the way to being perfect. As far as I'm concerned, it's as readable and engaging as a good novel. Programming idioms are gracefully executed and nothing seems out of place. It's cognitively consonant. I think it's an amazing human achievement that, in just one generation, we have become conversant to such a degree in this new medium of expression that the medium no longer gets in the way but lets the underlying ideas shine through.

    If nature provided practically unlimited general computing power really easily, code would be frickin beautiful.

    Ah, but it does. What is DNA if not code for operating a certain broad class of 3D printers? But as to whether the code is beautiful, who can say? We can only observe that it produces functional results for the most part. The very fact of its existence in such compact and enduring complexity is a sort of beauty, but is the code itself elegant, efficient, pretty, readable?

    We know that most of the gene in a given strand of DNA are turned off. Does that mean that the code is inefficient, or are these sequences like the methods of an enormous class library, written by the brutal evolutionary hand of trial and error, now dormant but having the potential to be activated should appropriate conditions develop? Sure, we don't need gills today, but sea levels are rising.

    --
    Parity: What to do when the weekend comes.
  83. Agree. by carys689 · · Score: 1

    I am in general agreement that most code out in the "wild" is terrible. However, this assessment may be due to the proposition that very programmer thinks that every other programmer's code is a piece of sh*t.

  84. Stick your neck out, rewrite it by Anonymous Coward · · Score: 0

    The worst code I see is from the f'ng contractors who put out crappy code that they never have to look at again. They produce code I would be ashamed of. Too many programmers put out shitty code just because they can. I've been coding for 35 years and I've seen more than my share of crappy code. As eWalz above says, when the existing code takes days to interpret, it becomes unusable.
    My solution is to rewrite every bit of crappy code I come across. Yep, I take my chances that I will screw up systems from coast to coast. After I've figured out what the code does, I rewrite it to do the same thing 50 times more efficiently. Once I've tested it, and the users have tested it, I'm pretty confident that it right. The benefits are immeasurable. Now I know that code from the inside out, every single line. If a problem comes up, I have a pretty good idea what happened before II even look at the code.
    If my rewrite doesn't work as it should well, I was looking for a job when I found this one. Fortunately,up to this point it's only gotten me a reputation as an excellent programmer.

  85. Enough of the Cruft by pfg23 · · Score: 1

    Working but fragile code delivered today is more valuable than working and maintainable code delivered tomorrow. This is true even though we all know that maintainable code costs less in the long run--that's what the software engineering books say, and they make a solid case. It's true because if the sales don't start coming in as soon as possible there may not be a long run for maintenance. It's hard for me to day this and hopefully without being too discouraging, but the extra time it takes to write maintainable code (not gold-plated code) is, all too often, not rewarded. I say that as a programmer/software engineer/developer/what-have-you for thirty years. I've seen some aggressively stupid code in production. Once, I had to debug a particular function that was ginormous. Thirty-three printed pages long. Hundreds-upon-hundreds of lines of C++. One big honking loop. Written by my manager, who got promoted because he wrote it, it worked (mostly, amazingly), and it was on-time (or close). Apparently, he missed the lecture on stepwise refinement and functional decomposition. When a bug was found, of course, I had to struggle through to find the error. The time it took to understand the code was not appreciated. (Refactoring? Bah, Humbug!) There's the conundrum for a lot of developers. The person who wrote the cruft is rewarded and maintenance can end up being a thankless job. Please don't get me wrong. I've revisited code I'd written in the heat of deadline pressure and found it less than concise too. I'm definitely not holier than thou or anyone else. Although I pretty much try to limit my functions to much less than the length of a single printed page (60 lines). It's unfortunate that the writer of the original article compares code in the field (the "wild" as the author says) to text book code. This is not a good comparison. Text book code is not good production code almost by definition, mostly because it never contains sufficient error checking and handling. If it did, it would obscure the logic. This doesn't invalidate the gist of his argument though, because, from my experience too, code in the wild is generally pretty hairy. Possible solutions? Of course, to borrow a phrase from Fred Books, there's no silver bullet. I do believe we can gradually and incrementally improve the overall maintainability of the national code base. I can envision two potential solutions (at this moment): 1) Tapping legendary 10x developers and 2) High-quality, low-cost (open-source?) static analysis tools integrated into IDEs. 1) The apocryphal 10-times programmer. I say apocryphal, because I have yet to see any one of these programmers identified by name in the literature. Purportedly, the 10-times programmer delivers high-quality code on time--the first time. Great, more power to them, but supposedly they're only about 10% of the programming workforce. Can't we find a way to get these mythical creatures to share some of their secret powers with the rest of us journeymen? Maybe they're just born coding machines. Either way, I suppose we'd have to identify them first. 2) A good, configurable static analysis tool, built into the IDE that runs automatically as you type or at build-time or check-in. Not just lint, but one that can assess conformity to generally (or locally) recognized (published) best practices. Let's hope and strive for the best. Happy holidays.

    1. Re:Enough of the Cruft by pfg23 · · Score: 1

      BTW, my comment was divided into paragraphs by line breaks, but they got stripped out! Sorry.

    2. Re:Enough of the Cruft by pfg23 · · Score: 1

      HTML! Argh! Now I know.