Coders' Primal Urge To Kill Inefficiency -- Everywhere (wired.com)
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.
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.
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).
Some drink at the fountain of knowledge. Others just gargle.
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?
Existence is an illusion therefore our time has no value, except when we are optimizing a minor subroutine.
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]
Shit better not happen!
You did something and you can measure that what you did, actually did it.
It is not like throwing a price to a customer and then he buys it. Perhaps he would have done that anyway. When you did the coding, you know that what you did was the cause of the improvement.
I know I have sat down for many hours, so a process can run 1 second faster and it runs once per week day. That is just over 5 minutes per year.
There is no way to defend spending so much time on it, except for ego.
Don't fight for your country, if your country does not fight for you.
Sometimes the primal urge to make everything more optimized can be a waste of time given the slight performance benefits. Especially when you've spent excessive amounts of time trying to squeeze out that last 1% of performance. Sometimes squeezing the last bit out of it isn't worth the time.
Sadly there are too few programmers who get that concept.
Exactly this. I've argued with a peer many times over making some odd error handling routine that is only called on a catastrophic failure more efficient. Well it takes too long or uses too much memory if you do it this way.... Over, Yea, but if it's ever called, this program is going to die a quick and complete death so why does it matter? Why are we wasting development time discussing this?
It's the same mentality that gets up in arms about how many spaces are used for indentation or if you use a line feed before your curly braces or not. Don't get me started on the "You have TABS in your file, instead of spaces! Or there are too many line feeds here" complaint. Why are we wasting time fixing this stuff after the code is working? Sure, bring it up so we can all agree to do all this the same way, but it's not worth wasting hours of the developers' time to "fix" stuff that isn't really broken.
"File to fit, pound to insert, paint to match" - Aircraft Maintenance 101
I will spend 4 hours coding something so I don't have to spend 10 minutes doing it manually more than once.
"Making things go faster is fun."
Have you read my blog lately?
... 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.
Every language should have something like gofmt (https://golang.org/cmd/gofmt/). One and only one canonically correct way to format code, automatically, using an official tool included with the language distribution. Never argue about inane formatting issues again!
- 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.
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.
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.
There's also get great pleasure in reducing the complexity of code. If I can make the code faster/more efficient and simpler at the same time then I have one of those oh yes, yes, yessss moments.
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.
Quite frankly IDEs should display code in whatever format or style the user prefers based on rendering a (possibly incomplete) abstract syntax tree instead of worrying about locations of spaces or tabs in a text file.
He clearly isn't looking at the code I usually have to maintain.
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 do I have to redefine the schema copy (table structure) if I want one screen or report to show fields in a different order than the other one? Can't I just supply a list of fields to give their order and inclusion that reference the original for the other details?
Few other devs seem to care about this and similar factoring issues with general CRUD idioms, as if it's part of the job. Scaffolding helps when you start out (auto-generating based on the database), but often can't be used when later changing things because customizations have been added that would be overwritten. It's better to have reference-based abstraction than copy engines: A.K.A. auto-bloaters.
I'd rather have regular CRUD be easy so I can focus on domain logic instead of the grunt-work of marshaling rows and fields back and forth. Our stacks turned bicycle science into rocket science and as long as these guys get a paycheck, they don't care. I do care. Dammit Jim, I wanna be an analyst, not a pasta manager!
Table-ized A.I.
So if you only ever have to do it twice, then you just spent 4 hours, plus the time to run the code twice on completing a task that would have taken you twenty minutes.
It's faster in the abstract.
*I* understand.
P.S. Also over time you realize that even if that time it wasn't falser overall you probably learned something to make something similar faster later.
"There is more worth loving than we have strength to love." - Brian Jay Stanley
Depends - are you optimizing the code, or are you optimizing the algorithm?
Code is usually small gains, and modern compilers can claim most of the low-hanging fruit themselves.
Data structures can be much bigger gains in some contexts, as using hardware cache inefficiently for frequent operations can cost you an order of magnitude of performance.
The algorithm though - that can easily often make several orders of magnitude difference. That's where optimization and elegance can often really come together. Sometimes simplicity has to be sacrificed - but if you start thinking that way it's usually a warning sign that you need to revisit your assumptions.
Same thing with architecture in many ways - though with a bad architecture it's the programmers' time you're wasting rather than CPU time. And that's generally even worse.
--- Most topics have many sides worth arguing, allow me to take one opposite you.
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.
We used to have a Bill of Rights. Now, with the rights gone, all we have left is the bill.
n/t
My God, it's Full of Source!
OUTSIDE_IP=$(dig +short my.ip @outsideip.net)
Code should be written for the next developer to read and understand it.
Your cutting edge coding style, set of libraries and tools is a time bomb of maintenance work in 2 years.
Code written for the next reader, not for cuteness, not for creative writing assignment, not for an interlarded overstratification of layered gunk, not a large number of misappropriated patterns.
I'd expect to see these three etched in gold plate on the next moon probe:
- Use the guard clause, once you get past the guard clauses, business work can happen
- Use dictionary order when naming methods and variables and classes. Use "CustomerCreateAccount" and "CustomerDisableAccount" instead of "CreateCustomerAccount" and "DisableCustomerAccount" as the later 2 will get jumbled with all of the thousands of "Create..." methods in your large code base.
- Patterns used rarely and most everything is not a pattern
General problem is academics do not have significant non-academic experience living with an ultra large system for 5 years. Teaching cute naming schemes and architecture patterns === more productivity is a disservice.
..find pleasure in quantifying things and then trying to OCD-like remove anything 'inefficient"?
News at 11?
-Styopa
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...
A quick Web search did not turn up "sloppy vector" as a coding style.
I understand how locality of reference can make a big difference in processing speed. But is "sloppy vector" simply a description of attempting to optimize loops scanning through arrays for the vector-architecture supercomputers but doing it in a haphazard way? Or is it a term-of-art that I can read about someplace?
Thanks!
You might consider sending your resume to Boeing?
...the biological father of invention.
In debates about Christianity, there are two groups: those looking for answers, and those looking to just ask questions.
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 PCs then we will see the extinction of extremely efficient optimized code.
But yes, to a lot of us "true" coders who actually give a darn about what the post says, the post is true :)
- Alex
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?
We will bankrupt ourselves in the vain search for absolute security. -- Dwight D. Eisenhower
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 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.
politicians are like babies' nappies: they should both be changed regularly and for the same reasons
You are a lame joke. Fuck off.
Explain ruby, systemd, Docker, and lumberjack beards.
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.
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
In LISP everything has a value. And everything also has a cost, but lisp programmers, and Java programmers, ignore the cost.
I'll see your senator, and I'll raise you two judges.
The most efficient code in the world is useless if it is broke because it can't be maintained.
When Fascism comes to America, it will call itself Anti-Fascism, and tell you to give up your guns.
Because in Java (note the comment about garbage collection), all object allocations go on the heap.
OK, OK, there is Escape Analysis where the runtime, if it so optimizes your code, will allocate on the stack an object from which no references "escape" the current context.
Good luck with that being a guarantee.
In my experience there is no difference between a C++ or Java programmer.
Can you give an example where one is more aware about costs and writes better code regarding that?
Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
Jesus! Another creimer-obsessed sicko!
I think awareness of costs is the wrong thing to ask for. Instead ask how how much control of costs a C++ vs Java programmer has.
I've done both. So I think I have at least some idea.
Both C++ and Java programmers have control of what algorithms they choose. And these higher level choices have the most profound impact on overall performance.
Assuming both C++ and Java programmers pay attention to overall design and algorithm efficiency, it is my opinion that C++ programmers have more control over costs in some choices about how things are represented. Java, while I like it, tends to force all representation into particular forms with a certain cost. Thus less control over cost of representation of data.
Now that said, I can't think of any other real differences. So you may have a point.
I'll see your senator, and I'll raise you two judges.