Slashdot Mirror


Code is Too Hard To Think About (theatlantic.com)

From a longform piece on The Atlantic: What made programming so difficult was that it required you to think like a computer. The strangeness of it was in some sense more vivid in the early days of computing, when code took the form of literal ones and zeros. Anyone looking over a programmer's shoulder as they pored over line after line like "100001010011" and "000010011110" would have seen just how alienated the programmer was from the actual problems they were trying to solve; it would have been impossible to tell whether they were trying to calculate artillery trajectories or simulate a game of tic-tac-toe. The introduction of programming languages like Fortran and C, which resemble English, and tools, known as "integrated development environments," or IDEs, that help correct simple mistakes (like Microsoft Word's grammar checker but for code), obscured, though did little to actually change, this basic alienation -- the fact that the programmer didn't work on a problem directly, but rather spent their days writing out instructions for a machine. "The problem is that software engineers don't understand the problem they're trying to solve, and don't care to," says Leveson, the MIT software-safety expert. The reason is that they're too wrapped up in getting their code to work. "Software engineers like to provide all kinds of tools and stuff for coding errors," she says, referring to IDEs. "The serious problems that have happened with software have to do with requirements, not coding errors." When you're writing code that controls a car's throttle, for instance, what's important is the rules about when and how and by how much to open it. But these systems have become so complicated that hardly anyone can keep them straight in their head. "There's 100 million lines of code in cars now," Leveson says. "You just cannot anticipate all these things."

20 of 397 comments (clear)

  1. FFS this again? by avandesande · · Score: 4, Insightful

    It's lousy requirements, fickle customers, bad environments and tools. The code is the easy part.

    --
    love is just extroverted narcissism
  2. Obviously bullshit statement there by Rockoon · · Score: 4, Insightful

    "There's 100 million lines of code in cars now"

    No, there isn't. So this guy, criticizing, is making shit up in order to do it.

    Whats he selling?

    --
    "His name was James Damore."
    1. Re:Obviously bullshit statement there by Kjella · · Score: 4, Insightful

      You got that far? My bullshit meter overflowed when he started ranting about binary instead of assembler which they've had from the very beginning as simple text substitution...

      Anyone looking over a programmer's shoulder as they pored over line after line like "100001010011" and "000010011110"

      --
      Live today, because you never know what tomorrow brings
    2. Re:Obviously bullshit statement there by Anubis+IV · · Score: 4, Interesting

      Assembly wasn't available right from the start, nor on all systems. I used to work with a couple of NASA subcontractors who talked about when they would code by flipping 8 switches and then pressing a button to push that single byte of code into the computer.

      I thought about putting code in quotation marks, a la "code", since it bears little semblance to modern coding, but then I realized that would be an utter and complete disservice to the absolutely herculean effort those people went through back then to build what were in many cases mission critical systems.

    3. Re:Obviously bullshit statement there by michelcolman · · Score: 5, Insightful

      I would bet most of it is in libraries. We need to display this little triangle widget on the screen... ok, found it in this 100 MB library, so we'll just include it and move on to the next problem. Programming is easy!

      There's no way you actually need 100 million lines of code to control a car.

    4. Re:Obviously bullshit statement there by narcc · · Score: 3, Informative

      I used to work with a couple of NASA subcontractors who talked about when they would code by flipping 8 switches and then pressing a button to push that single byte of code into the computer.

      That wasn't uncommon for early personal computers either. Try this in-browser simulations:

      Kenbak-1 Emulator

      MITS Altair Simulator

    5. Re:Obviously bullshit statement there by boa · · Score: 3, Informative

      "I didn't bother counting, but I doubt there were more than 10K LOCs in the Apollo code, "

      Well, you're wrong. Way off, actually.

      Code is available here: https://googlecode.blogspot.no...
      Here are some crude stats (from a source tree I know nothing about...)

      [boa@localhost trunk]$ for i in Artemis072 Colossus2* Comanche055 Luminary* Solarium055; do printf $i; find $i -name \*.agc | xargs wc -l | grep total; done
      Artemis072 64444 total
      Colossus237 62565 total
      Colossus249 64223 total
      Comanche055 65585 total
      Luminary099 65058 total
      Luminary131 63217 total
      Solarium055 30074 total
      [boa@localhost trunk]$

  3. What's the point of this article? by xxxJonBoyxxx · · Score: 4, Insightful

    If you think "code is hard", then maybe SlashDot isn't the right site for you.

    1. Re:What's the point of this article? by computational+super · · Score: 4, Insightful

      Hmmmm.... well, hang on - I don't think this is what you meant, but you seem to be implying (and certainly a non-coding reader would infer from reading your comment) that code is actually easy. Code IS hard, and it takes a lifetime of discipline to master, and when actual, human safety is on the line, it should absolutely be left in the hands of experienced professionals.

      --
      Proud neuron in the Slashdot hivemind since 2002.
    2. Re:What's the point of this article? by gweihir · · Score: 3, Insightful

      If your critical thinking/programming skills are up to par, all you need is an honest interest in what it is you're programming for.

      And I disagree on that. Rather strongly in fact. I am not talking about algorithms you can copy from a book or find in your run-of-the mill libraries. And I am certainly talking about related issues like cache-awareness, doing your own custom memory management, doing good privilege-separation on the architecture side, understanding side-channels, etc. Most coders just scratch the very surface and then mistakenly think they are good at it.

      --
      Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
  4. Not "too" hard, just hard by gweihir · · Score: 5, Insightful

    At least not too hard for everybody. But the simple plain fact is that thinking about code above a certain minimal complexity requires special talent. Tools, languages, coding-styles, etc. make no real difference.Those that do not have it ( probably something like 95% of all people) should stay away from professional coding. Incidentally, the same applies to mathematical thinking and reasoning, for example. Nothing surprising here, just too many people writing code that do not have what it takes.

    --
    Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
    1. Re:Not "too" hard, just hard by Wrath0fb0b · · Score: 3, Insightful

      Spoken like someone that has never actually worked on a variety of complex projects with different amounts of legibility.

      There are any number of things that a talented team will do to make code much easier to work with: consistent interfaces, explicit contracts, thoughtful modularity, high-level documentation, intuitive log/trace functionalities, unit tests*, etc. Conversely, there are all kinds of traps that make a complex project much more difficult to work with: spaghetti code, completely lack of diagnostics, tight coupling that makes unit testing impossible, principle-of-most-surprise.

      Don't get me wrong, there is absolutely such a thing as special talent. But the more I've worked with software, the more I realize that this talent consists of building complex things in understandable & predictable ways. The real superstars are the ones that build frameworks that merely-good programmers can understand and use to build upon. These things absolutely make a huge difference. The better the design/implementation, the less talent is needed to build on top of it with messing things up.

      And by the way, this was kind of supposed to be the point. We were supposed to throw open the benefits of computing to everyone. That requires more work to make languages/frameworks readily understandable to the less talented and less of the view that only the elite should code and more of the view that the elite are needed to build the foundation for others to use.

      * Actually, one of the hidden benefits of unit testing, besides forcing you to create generic interfaces that can be mocked/stubbed out, is that it provides an instant way to learn about a component of the system. Don't know how foo works, run the unit test and watch it work. Want to know the contract between foo and the rest of the system, look at the pre/post conditions the tests are asserting.

  5. I think there's something missing here... by bogaboga · · Score: 3, Informative

    "The problem is that software engineers don't understand the problem they're trying to solve, and don't care to,..."

    I think they do understand the problem and that's why things generally work, or don't they? I think they do work on the whole.

    The reason is that they're too wrapped up in getting their code to work.

    To this, I must rephrase:

    "The reason is that they're too wrapped up in getting their code to work, as they should..."

  6. Stupid Topic by Murdoch5 · · Score: 4, Informative

    Before a single line of code hits the IDE, you plan out what you're trying to solve, the problems you have to deal with, and how the logic will have to act. Coding happens after the "hard" work has been done, once you have a good idea of what has to be done and how to do it.

    If anyone thinks that a true software engineer just sits down, starts slamming on some keys and then says "Oh well, I wrote code, let's see how the throttle handles it", then they don't understand software development or software engineering.

  7. Re:Then they're idiots by gweihir · · Score: 5, Insightful

    Same here. But I see tons of people that either only understand the problem but cannot code or the other way round. Of course there are also people that suck at both. The fact of the matter is that only a small number of people can both code well (including understanding design, architecture, performance, security and reliability) and can understand the application problem well at the same time. Of course the latter is with the help of the customer or user, but even that seems to be too hard for many coders.

    It is not laziness or unwillingness, IMO, it is simple inability. And people that can do one of these things well cannot be called stupid by any sane measure either. The problem of doing both things well is just very, very hard.

    --
    Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
  8. Let me guess by 110010001000 · · Score: 3, Insightful

    Visual programming is the "answer"? Every decade some non-programmer discovers visual programming and says we are all going to be creating programs by dragging blocks around. No, I didn't bother to RTFA.

  9. No, the problem is coding is just too new. by 140Mandak262Jamuna · · Score: 4, Insightful
    At the start of industrial revolution, since around 1750 approx, lathes were turning out nuts and bolts. But you needed to buy a matched set of nut and bolt. There were no standards, no interoperability between nuts and bolts from different manufacturers. At around 1840 a man named Whitworth painstaking collected nuts and bolts from various manufacturers, found the most common thread profiles and published a "Whitworth thread profile". This eventually became British Standard thread profile, and almost all the nuts and bolts we take for granted came from that standardization.

    Software is still in that era. Each machine built then was made from the scratch, with custom built parts. There were no standard off the shelf components then. We still don't have a standard reliable gui that can be assumed to be supplied by the OS in linux. Windows guarantees a mouse/screen but it can't even give multiple customizable desktops in 2017 Windows 10.

    If I am designing an electric motor, I don't have to worry about the anchoring bolts. I know the power and torque and weight of what I am shooting for. I will simply pick from well tested components library a set of four, six or eight bolts with known tensile strength, corrosion resistance, temperature profiles, cost and provide for holes large enough for the anchor bolts. If I am designing the controller for the same damned electric motor, every interaction the motor has with the micro processor that controls it is custom made. Several device control muPs each with its own protocol for data, feedback and error handling.... If I am designing a mortgage consolidation program for the asset management of a bank, every data feed I get, every data output, feedback, and error handling is custom built. That is why software reliability is poor, security holes are ill understood and development is insanely complex.

    Having said that, we have made great strides in standardization. File IO within a system, of https requests across the network is getting standardized. XML is helping a lot. Entrenched players deliberately mess up interoperability with ulterior motives. But as the end users become more and more aware of switching costs and vendor locks, eventually these things will dry up and interopera bility will improve.

    Well tested, well understood components are the key to building large, complex but reliable machines. We are getting there. Serious computation is a mere 60 year old technology. Hardly two and a half human generations, coping up with 45 generations of computational technology evolution. It will take a couple of human generations before we have senior managers who grew up with technology who would not fall easily for the sales tricks and demand real tested true interoperability and well tested well understood components.

    --
    sed -e 's/Chuck Norris/Rajnikant/g' joke > fact
  10. If code is too hard to think about by guruevi · · Score: 4, Insightful

    You shouldn't be in the field of software development. Whoever uttered that statement should be fired from any programming related job.

    It does require a special sort of insight (eg. being able to keep track of state and thinking much more abstractly about computers than what you're used to) which can be both acquired or natural but is only improved by practice but it's by no means impossible to think about code and what it will end up doing. In most cases, programmers have thought about ways the program can fail (eg. buffer overflows) and either think it's no big deal (it will never get connected to the Internet) or have to give up finding solutions for it due to lack of time or funding.

    --
    Custom electronics and digital signage for your business: www.evcircuits.com
  11. Lack of understanding inflates code by rbrander · · Score: 3, Interesting

    Tight code that just does the job and no more can be done, but the writer, or the guy standing over him, has to *deeply* understand the problem, from the inside. Frankly, I think it's easier to teach the problem-expert programming than it is to teach a programmer the problem.

    I worked for my local water/sewer utility, first as their IT head, then moved back to my first degree, engineering - but it was my IT that got me the engineering job, which was putting all our pipes, valves and other assets into a giant database that was also a "GIS", a map. We had already for years been switching to mapping with CAD, and had various macros and programs written within its development environment to make, say, placing a hydrant a single graphic operation.

    So I got the one contract CAD programmer to greatly expand his "macros" into a comprehensive drafting system where the draftsman first drafted the underlying network, then all the pipes and other assets on top of that; the database understood the connected network and could trace it, analyse flow. The coding from the one former draftsman, who completely understood the drafting problem and the needs of his fellow-draftsman customers hired a couple of young programmers,made sure they were doing what his customers needed, and was done in a year for about $400,000. The IT department charged me much more than that to just supervise him and make sure he "met all corporate standards"!

    Well, the IT and Mapping departments hated this software because it ran on top of the CAD package, Microstation. They insisted this was at end-of-life and all mapping was going to an "All-GIS" environment in the 800-lb gorilla of the GIS market, ESRI. They went over me (multiple levels) to get a huge project approved to replace my little $400K amateur effort from a mere engineer.

    Long story short, that project peaked at 35 staff, went 3 years, spent $8 million and generated I can't imagine how much code because it was all with Microsoft programming tools that load in whole libraries every time you do anything.
    At that point, management realized that it was another $2M-$3M to finish it, and testing showed it would offer no improvements and maybe some slowdowns.

    They cancelled it.

    My $400,000 CAD software is still there, not yet "end of life" at the age of 20, some 8 years after it was declared good-as-dead. Pity about the lost $8M. What I could have done with that! (There is, by the way, no sign of the whole CAD market vanishing in favour of GIS. Not surprising. Our IT and mapping people also picked Microsoft Silverlight as a winner.)

    Whenever I read about giant code messes, I wonder if good, working software for the same problem would be less than a tenth that size. And it isn't bad programmers, it's bad project management. You should never put IT in charge, always their customer. This absolutely requires IT-savvy customers, and these horrors will go on until we get some.

  12. Requirements, not coding, at heart of article by Koreantoast · · Score: 3, Insightful
    I think this quote from the article said it best:

    “Typically the main problem with software coding—and I’m a coder myself,” Bantégnie says, “is not the skills of the coders. The people know how to code. The problem is what to code. Because most of the requirements are kind of natural language, ambiguous, and a requirement is never extremely precise, it’s often understood differently by the guy who’s supposed to code.”

    My reading of the article is that it's not coding itself that's the problem, we can do that, the problem is that we're struggling to develop requirements for more and more complicated systems. As systems become more flexible and their environments more variable, it's becoming harder to write them.