Follow Slashdot blog updates by subscribing to our blog RSS feed

 



Forgot your password?
typodupeerror
×
Programming

Coders' Primal Urge To Kill Inefficiency -- Everywhere (wired.com) 181

For software engineers, lack of friction is an aesthetic joy, an emotional high, the ideal existential state. It's what drives them, and what shapes our world. An excerpt from an upcoming book on coding, via Wired: The thrust of Silicon Valley is always to take human activity and shift it into metabolic overdrive. And maybe you've wondered, why the heck is that? Why do techies insist that things should be sped up, torqued, optimized? There's one obvious reason, of course: They do it because of the dictates of the market. Capitalism handsomely rewards anyone who can improve a process and squeeze some margin out. But with software, there's something else going on too. For coders, efficiency is more than just a tool for business. It's an existential state, an emotional driver.

Coders might have different backgrounds and political opinions, but nearly every one I've ever met found deep, almost soulful pleasure in taking something inefficient -- even just a little bit slow -- and tightening it up a notch. Removing the friction from a system is an aesthetic joy; coders' eyes blaze when they talk about making something run faster or how they eliminated some bothersome human effort from a process. This passion for efficiency isn't unique to software developers. Engineers and inventors have long been motivated by it. During the early years of industrialization, engineers elevated the automation of everyday tasks to a moral good. The engineer was humanity's "redeemer from despairing drudgery and burdensome labor," as Charles Hermany, an engineer himself, wrote in 1904.

[...] Many of today's programmers have their efficiency "aha" moment in their teenage years, when they discover that life is full of blindingly dull repetitive tasks and that computers are really good at doing them. (Math homework, with its dull litany of exercises, was one thing that inspired a number of coders I've talked to.) Larry Wall, who created the Perl programming language, and several coauthors wrote that one of the key virtues of a programmer is "laziness" -- of the variety where your unwillingness to perform rote actions inspires you to do the work to automate them.

This discussion has been archived. No new comments can be posted.

Coders' Primal Urge To Kill Inefficiency -- Everywhere

Comments Filter:
  • by goombah99 ( 560566 ) on Thursday March 21, 2019 @09:06AM (#58309812)

    Numerical Recipes in $LANGUAGE states it is written for scientist not coders because the difference is that scientists work on the next generation of problems on the last generation of computers (and hence need efficiency), while coders solve the last generation of problems on the next generation of computers (and thus make the code more elegant but less efficient).

    • and thus make the code more elegant but less efficient

      Huh??

      • by Anonymous Coward

        It means that when you have lots of resources you are not focused on efficiency in using them. For example a mind set of removing hacks and doing things the right way in a design pattern even if it means lots of overhead per call or memory inefficiency or having to throw more threads at the same task. If you are resource rich you strive for clean, re-usable code not optimizing resource constrained performance on the next larger problem. Look at all the metrics coders use to judge code and you can see it

        • by Anonymous Coward

          It means that when you have lots of resources you are not focused on efficiency in using them. For example a mind set of removing hacks and doing things the right way in a design pattern even if it means lots of overhead per call or memory inefficiency or having to throw more threads at the same task. If you are resource rich you strive for clean, re-usable code not optimizing resource constrained performance on the next larger problem. Look at all the metrics coders use to judge code and you can see it's about clean, re-usuable, APIs

          Ugh.. boil it down to the simple statement. Computers and computer resources are dirt cheap compared to coders, as such the corporate desire is to spend the least amount of money on both that results in "adequate" performance for the masses.

          • by uncqual ( 836337 )

            Computers and computer resources are dirt cheap compared to coders

            In some cases this is true locally but not globally.

            For example, a product like Hadoop is/was very widely used and the aggregate global usage consumes/consumed vast computing resources (and the attendant real estate to house them, energy to power them, energy to cool them, etc -- i.e. TCO). Squeezing, on the average, a 0.5% performance improvement may be well worth the initial development cost when viewed globally across all organizations as

    • by lgw ( 121541 ) on Thursday March 21, 2019 @10:58AM (#58310436) Journal

      Numerical Recipes in $LANGUAGE states it is written for scientist not coders because the difference is that scientists work on the next generation of problems on the last generation of computers (and hence need efficiency), while coders solve the last generation of problems on the next generation of computers (and thus make the code more elegant but less efficient).

      You have a narrow idea of "efficiency". You're thinking about CPU-time, which matters so rarely these days. Good software professionals optimize for human-time, writing code that's easy to support and maintain. That's "efficiency" that will bring a smile. Nothing better than a code review that's "all red", that is, removes a ton of pointless lines of code from a legacy system.

      • by Anonymous Coward

        Those things are important to optimize too, which is why nobody writes SQL database queries in assembler.

        But I've done tons of work to optimize CPU/GPU rendering code, where shaving 75 milliseconds of time out of a loop is the difference between a frustrating user interface and one that is smooth and makes the customer happy. (25 mS render time = 40 FPS, 100mS render = 10 FPS). Humans notice that lag at 10 FPS when interacting with a touchscreen. Customer in this case being the driver of a high end car.

    • by raymorris ( 2726007 ) on Thursday March 21, 2019 @12:20PM (#58310908) Journal

      That's an interesting observation. I'll look for it.
      I suppose I DO see it in programming tools, such as languages.

      I do a lot of code review and mostly I see bad code and good code. Good code tends to be elegant and efficient. Bad code tends to be inelegant and inefficient. They tend to go hand-in-hand. Partly because mathematically they are sometimes correlated, and partly because those who write good code, write good code. I don't often see "good" as in "elegant" code that is also "bad" as is "inefficient".

      I wonder though about whether programmers in general have that instinct, that desire, for efficiency, or if that's just the 10% who are particularly good at it. A lot of people do in fact write crap. Do they have a strong desire to do much better, but just don't know how to learn? I'm not sure. Maybe 30% of my teammates signed up for my last series of classes I taught, so those 30% indicate by their actions that they really want to improve.

      * Talking about teaching classes sometimes makes people think I'm arrogant. I'm really, really bad at singing. Horrible. I can't play any video or board games. I can't draw for shit. I spend all my time learning about programming and designing information systems. I'm pretty good at that one thing.

    • while coders solve the last generation of problems on the next generation of computers (and thus make the code more elegant but less efficient).
      That is nonsense.
      A for loop is a for loop is a for loop. It does not lose efficiency just because a coder gets older and a computer gets faster.

      We lose efficiency because problems and solutions become more complex and coders are forced to deliver in relatively short time. So they rely on frameworks that focus on simplifying work and ensuring "safety" from mistakes (

  • by sinij ( 911942 ) on Thursday March 21, 2019 @09:09AM (#58309824)
    This is just a bunch of feel-good nonsense. While nobody sets out to write inefficient code, most of the code is inefficient due to reuse of generic libraries and lack of compiler optimizations. If you think you are different, then when was the last time you looked at your gcc compiler flags and do you know what each one of them does?
    • Re: (Score:2, Insightful)

      Very true. Most programmers aren't interested having a 100% efficient program at this point. But we are interested in automating tasks. The two things are independent, but the summary conflates the two. Probably written by a non-developer.

    • by Anonymous Coward on Thursday March 21, 2019 @09:20AM (#58309880)

      If you are looking at gcc flags to get overall optimization, you are doing it all wrong. You gain fractions from gcc optimizations. I've refactored code and gotten 1000X from silly stuff that people have done. gcc would have done nothing to make those problems go away.

    • That's because there is an overwhelming lack of understanding of what they write as code and what it actually means as far as instructions to perform it. In fact most of what people think they are doing to help performance is likely optimized away by the compiler.

      Which btw highlights the difference between programmers who write things like compilers and the rest of the "bro programmers". Sadly, guess which ones are likely pulling down more salary.

    • That's not what they're talking about. They're talking about automating *something* with code.

      Even the slowest BLAS libraries are faster than a human at doing matrix multiplication. Having humans do math was inefficient and slow until some coders came up with a way to do it 'automatically'. Then the world moved on.

      Right now I'm Jenkins-ing everything at work. Even trivial stuff that takes time. I just put it in a batch job and let it run.

    • Sometimes spending the time to make something more efficient is inefficient. I'll happily admit that I have code out there that I know is not the most efficient, and I even know the ways to make it MORE efficient.

      I write internal apps for a private business. If one of my webpages takes 10milliseconds longer to load than I could optimize it for... so be it... we're not talking about thousands of people hitting the site at the same time.

      I have a long list of things to work on and I can crank out more pages

      • by Dutch Gun ( 899105 ) on Thursday March 21, 2019 @10:01AM (#58310088)

        A very good point. I work in videogames, which obviously has, as an industry, a great interest in writing efficient code.

        However, in code meant for tools, or even game code that's reasonably far off the critical path, I'll happily sacrifice efficiency in some complex code in order to make it more readable, because that's significantly more important for the those that may come after me who have to maintain it. For code that's in a critical path, only then will I spend the extra effort writing more optimal code. Optimal code sometimes has a price to pay both in the time spend writing it, but also maintaining it in the future.

        There are occasions where more optimal code is also clearer and more elegant, but you have to have a reasonably comprehensive knowledge of both the language and the project you're working on to properly make this call.

        • Optimizing for maintenance and readability is, in itself, also a way to optimice for meta-efficiency. Much like an industrial engineer might optimize a process for overall efficiency, instead of only shaving of some seconds off a single step.
          The older I get, the more I notice that I am way more annoyed by problems in the big picture, vs. some small loop that could be slightly more funkyly coded.
          It is relatively easy to get some super coder to make a routine more efficient, or geek out oneself to hyperfocu
        • by llZENll ( 545605 ) on Thursday March 21, 2019 @11:53AM (#58310748)

          For nearly all code you should write the simplest implementation, selecting ease of reading, security, and maintainability over speed. After your program is nearly done and you begin profiling then start optimizing. People are notoriously bad at guessing where bottlenecks will be and what causes them.

        • by swell ( 195815 )

          And yet--gamers? Let me take a wild guess that game programmers are people who like games.

          Games are the antithesis of efficiency. They consist entirely of a deliberate choice to waste as much time as possible, often to the detriment of useful activity. Even reading books or watching movies can sometimes be considered educational to some extent. Games; not so much.

          Of course many games require extreme speed and efficiency to generate maximum endorphins and adrenaline. That code must be impressive. Congrats if

    • by tomhath ( 637240 ) on Thursday March 21, 2019 @09:50AM (#58310020)

      Not only feel-good nonsense, but it makes a ridiculous generalization about "coders" as if they are some kind of special life form. Do "carpenters" have a primal urge to "kill inefficiency" because they use power tools?

      • by skids ( 119237 ) on Thursday March 21, 2019 @10:08AM (#58310110) Homepage

        Not only feel-good nonsense, but it makes a ridiculous generalization about "coders"

        Yup. After all, the inefficient code that "coders" love to optimize had to come from somewhere. Where, if not from "coders"?

      • by liquid_schwartz ( 530085 ) on Thursday March 21, 2019 @11:40AM (#58310680)

        Not only feel-good nonsense, but it makes a ridiculous generalization about "coders" as if they are some kind of special life form. Do "carpenters" have a primal urge to "kill inefficiency" because they use power tools?

        Close. Carpenters have a primal urge to have more tools, thus the need to buy both hand tools and power tools. You can generalize this from carpenters to all woodworkers to most men quite accurately :-)

      • Using examples of carpenter though, it would be like a carpenter spending hours to make a chest of drawers open more neatly. Most tradesmen I know set a level of quality that is dependent on price though - mostly because the tech and materials are well known. You won't ever need complicated workarounds when making a chair or even a house, you follow established procedures.... unlike coders!
        • by tomhath ( 637240 )

          it would be like a carpenter spending hours to make a chest of drawers open more neatly

          Carpenters don't make chests of drawers. Carpenters build houses, stores and banks [youtu.be]; furniture makers make furniture, it's an entirely different profession.

          And if you think "coders" don't follow established procedures you don't know anything about writing software.

    • No one sets out to be a lousy architect and design code that's inherently inefficient, either. But it sure does happen a lot, and compiler flags or cute tricks inside some routine don't fix that, either. Approaching a problem the wrong way is a main driver of inefficiency, followed by using the wrong tools (language, server, whatever).
      =

      I use C/C++ when computer time is important, and use a lot of the fancy tricks to avoid various dumb things.
      But I also do lots of "research grade" code where I just wan

  • by Bigbutt ( 65939 ) on Thursday March 21, 2019 @09:17AM (#58309860) Homepage Journal

    As an Operations Engineer, I'm also working on improving things. Automation to speed up deployments, monitoring to identify bottlenecks, etc. The bad part is when the provided tools don't give me that visibility so I can make improvements, I deploy my own tools (or write my own). It's probably less efficient but I can then work on improving the environment. My current audit script identifies some 34,000 things that can be improved across our environment.

    [John]

  • Comment removed (Score:4, Interesting)

    by account_deleted ( 4530225 ) on Thursday March 21, 2019 @09:23AM (#58309900)
    Comment removed based on user account deletion
  • FACT (Score:5, Insightful)

    by Rob MacDonald ( 3394145 ) on Thursday March 21, 2019 @09:33AM (#58309946)
    I will spend 4 hours coding something so I don't have to spend 10 minutes doing it manually more than once.
    • In 4th grade (early 90s) I got in trouble for something and had to write out something 20 times.

      I convinced my teacher that typing was a useful skill. I failed to mention how copy and paste worked. So I said I typed it out 40 times to practice and got a congratulations for that.

      Since then my whole career has been slight of hands with managers and code in the background.

      That 4 hours invested will 'break even' after 24 times. Maybe it takes a year or two, but after that you're working on 'free' time.

      Add in a

    • Re:FACT (Score:5, Informative)

      by dromgodis ( 4533247 ) on Thursday March 21, 2019 @09:58AM (#58310070)

      Oblig. https://xkcd.com/1205/ [xkcd.com]

    • It's not the coding that drives me nuts with automating stuff, it's the testing/QA. You do make sure that all mission critical things you do are tested to make sure the automatic process isn't doing something wrong, right? Ideally with another party (internal or external) acting as QA.

  • "Making things go faster is fun."
    • Some seem overly obsessed with machine speed. I know one coder who was so obsessed he made a mess out of the software because it was designed for speed over maintenance, and maintenance fell behind, making for spaghetti code that was even slower than it would have been. Penny-wise, pound foolish.

      I like software stacks that can be tuned for shop conventions to remove repetitions grunt-work, but others don't seem to care much about that. Why I am I typing the field title and size in in 4 different places? Why

      • If you don't have a timer, you don't know if you've sped things up or slowed them down.
        • by Tablizer ( 95088 )

          There were poor designs in there. A poor design is a poor design.

          For example, if you spot a bubble sort algorithm for big datasets, you know its "speed" score is low compared with alternatives without using a timer.

      • but often can't be used when later changing things because customizations have been added that would be overwritten
        Then your generator sucks.

        When generating OO code you use a sandwich architecture. Assume you want to have a Customer class, it would look like this: BaseCustomer <- GenCustomer < Customer.

        Initially all 3 are generated, because they don't exist. The "generated" code goes into GenCustomer. Now you have two hooks where you can do your manual customization, BaseCustomer (you most likely neve

  • ... sometimes I like to do something unbelievably inefficient. Not for production code though.

    In college a teacher gave us an assignment to reverse a linked list. I made it recursive. My teacher said: "It's inefficient and that will only works with small lists, you will get a stack overflow". I said "Who cares, it is pretty", Still got an A.

  • Laziness is the father of invention.
    - tm Jake, ca 1980

    Larry Wall, who created the Perl programming language, and several coauthors wrote that one of the key virtues of a programmer is "laziness" -- of the variety where your unwillingness to perform rote actions inspires you to do the work to automate them.

  • This is the first of The Three Great Virtues of a Programmer. [c2.com]

    Laziness

    The quality that makes you go to great effort to reduce overall energy expenditure. It makes you write labor-saving programs that other people will find useful, and document what you wrote so you don't have to answer so many questions about it. Hence, the first great virtue of a programmer.

  • Comment removed (Score:3, Insightful)

    by account_deleted ( 4530225 ) on Thursday March 21, 2019 @10:06AM (#58310102)
    Comment removed based on user account deletion
    • Faster, more efficient, simpler. They usually do go together! It drives me nuts to see 400 lines of code that could have been written in 50! Worse, those 400 lines all have to be maintained, as long as the software has life. Simplifying code is worth a lot more than just the time it saves in clock cycles.

  • I do tend to try to optimize my code, but at the same time, I tend not to be particularly bothered by doing repetitive tasks by hand (or at least, much less than most people), so it does not seem to be caused by that in my case. Some repetitive things are pleasurable (e.g. raking leaves), & once you automate something, it either does not account for edge cases or grows into a giant nest of special cases, unless you have a very good model when writing the initial code.
  • He clearly isn't looking at the code I usually have to maintain.

  • I seem to only find this sentiment in developers after the code goes into production.

    There's no thought given to the impact of not using a connection pool or not caching retrieved data or whether or not to overarchitect a complex solution with tons of layers for a relatively simple problem...

    It's too bad devs aren't trained to consider runtime aspects of their code before they start developing it...

  • From the onset of our teen years, we strive to reduce friction where it would be leaving a chafing feeling.

  • ..find pleasure in quantifying things and then trying to OCD-like remove anything 'inefficient"?

    News at 11?

  • Coders like mental masturbation, piles of unnecessary layers of cruft using libraries they don't understand, bogging a processor that could do billions of operations a second to doing less real work than one a decade ago in twice the amount of time...

  • ...the biological father of invention.
  • I thought it was no where, and had died out with the advent of near-unlimited computing power.

    To quote someone on a Facebook group whom I told Windows 10 is incredibly inefficient and a ram hog. their reply was "Ram? Who cares about ram? What are you, poor?"

    Seems that since the advent of really high power CPUs and GPUs efficiency of code and optimization has gone by the wayside. Something that is hanging on by a thread ever-so-slightly in console game development. Once consoles start to have the power of PC

  • Huh? (Score:5, Insightful)

    by smooth wombat ( 796938 ) on Thursday March 21, 2019 @11:56AM (#58310758) Journal

    Coders hate inefficiency? Then who the hell has been programming all the shitty software we have to deal with every day? The software whose every iteration gets more and more bloated (Firefox, Office, etc)? Software which takes longer and longer to load each time a new version comes out, yet is no more useful than what was produced a decade ago? Why does it take 90 scripts to load one web page, including a simple picture?

    Where are these mythical beings who want to kill inefficiency? Are they hanging out with Big Foot?

    • by Anonymous Coward

      Coders hate inefficiency? Then who the hell has been programming all the shitty software we have to deal with every day? The software whose every iteration gets more and more bloated (Firefox, Office, etc)? Software which takes longer and longer to load each time a new version comes out, yet is no more useful than what was produced a decade ago? Why does it take 90 scripts to load one web page, including a simple picture?

      Where are these mythical beings who want to kill inefficiency? Are they hanging out with Big Foot?

      UI designers and Graphic artists, with only minimal training in code development and worse yet programming in a drag-n-drop environment.

  • by petes_PoV ( 912422 ) on Thursday March 21, 2019 @11:57AM (#58310770)

    Coders might have different backgrounds and political opinions, but nearly every one I've ever met found deep, almost soulful pleasure in taking something inefficient -- even just a little bit slow -- and tightening it up a notch.

    Garbage!
    What gives coders pleasure is a combination of going home early, finding someone else to blame a bug on and getting stuff through acceptance testing.

    As for wanting to improve efficiency? There is no evidence for this. Nearly 25 years ago we were enlightened by Wirth's Law [wikipedia.org] which addressed the question why does software get slower more rapidly than hardware becomes faster? and nothing in the intervening quarter century has improved the matter.

    • by Jeremi ( 14640 )

      What gives this programmer pleasure is happy users who like using my software, and are able to do cool things with it.

      Given that, my primary goal usually isn't optimal efficiency, but rather 100% program correctness (nobody likes a buggy program), and acceptable worst-case performance (nobody likes a slow program either).

      Users aren't going to care if my program is a few milliseconds slower than it could be. They are going to care if it crashes or bogs down in certain situations. Therefore it's better to h

  • by Drunkulus ( 920976 ) on Thursday March 21, 2019 @12:20PM (#58310904)
    Explain ruby, systemd, Docker, and lumberjack beards.
  • All the code (written on napkins and the backs of coasters) is literally held together by bits of leftover rice and potatoes with post-its, scotch tape, and staples from the office supply cabinet.

    Your primal urge may be "efficiency" to perform tasks which may be easily automated, but the rube goldberg machine making it happen isn't.

    *cough* tesla *cough* *cough*

    https://forums.somethingawful.com/showthread.php?threadid=3862643&userid=20544

They are called computers simply because computation is the only significant job that has so far been given to them.

Working...