What Today's Coders Don't Know and Why It Matters
jfruhlinger writes "Today's programmers have much more advanced languages and more forgiving hardware to play with — but it seems many have forgotten some of the lessons their predecessors picked up in a more resource-constrained era. Newer programmers are less adept at identifying hardware constraints and errors, developing thorough specifications before coding, and low-level skills like programming in assembly language. You never know when a seemingly obsolete skill will come in handy. For instance, Web developers who cut their teeth in the days of 14.4 Kbps modems have a leg up in writing apps for laggy wireless networks."
Experienced people have experience in things they have experienced
tl:dr - "Get off my lawn"
If what I just said sounded like a troll, it was probably just a failed attempt at humor.
Paste
Minor Edit
Commit
So your particular skillset has fallen out of vogue for a while; it happens. If this stuff is useful, it'll come back. For instance, a lot of the hardware related skills mentioned are still around, they're just considered to be a specialisation these days, in most situations it's safe to assume that the hardware either performs within spec or that the lower layer (OS etc) is dealing with any irregularities.
"Welcome to our world. We are the wasted youth. And we are the future too." Yes, I know these are stupid lyrics.
POKE
PUSH
PULL
"Kill 'em all and let Root sort 'em out"
They don't know that old trick from liblawn
Lawn::GetOffLawn(kid);
they aren't trained to engineer software, and the industry hasn't incorporated good engineering practices.
The Kruger Dunning explains most post on
would explain why Runescape runs perfectly well over dialup or EDGE(4KB/sec) speeds, while most other games do not: The original creators probably had some experience that way.
...and we LIKED it!
"We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil" - Donald Knuth
Most developers will never need for their apps to run in constrained environments, and most employers don't want to spend money to eek out performance when average performance is perfectly fine.
Too many programmers get caught up in trying to make something the fastest, or most memory efficient, or makes the best use of bandwidth. When most of the time, it just doesn't matter. Such things are expensive, and in the long run it's cheaper to be fast and sloppy than slow and lean.
If you need web hosting, you could do worse than here
It's just like pilots should learn how to fly before being put at the helm of an airliner.
For justice, we must go to Don Corleone
Today's humans have much more advanced technologies and more forgiving world to play in — but it seems many have forgotten some of the lessons their predecessors picked up in a more resource-constrained era. Newer humans are less adept at identifying water sources in a forest, finding directions without a GPS, and low-level skills like starting a fire with two stones. You never know when a seemingly obsolete skill will come in handy. For instance, stone age humans who cut their teeth in the days of, well, stone age have a leg up in hunting wild beasts with just bare hands and stones.
I am an electrical engineer. Here's some news for ya: us electrical engineers do learn these skills, so don't bother complaining about the state of the world because new students are taught these vital insights in computing every day.
but other than that I fail to see the outrage. I also don't see a lot of value in learning things you won't likely need to use. Whats the cost/benefit to learning and mastering assembly if you aren't going to need it? Building software as if you have low resources is fine, so long as you aren't compromising quality to make sure it will run on an archaic hardware. Making things as lean and fast as you can is always plus... if you have the time. Which is another thing today's programmers deal with more: insane deadlines. Expectations are growing and deadlines are getting shorter, and today's programmers (unfortunately) cut a lot of corners and don't get the chance to truly optimize something, just so they can get it out the door.
well that was a waste of time, a terrible incoherent, lazily written article with very little anybody could actually use if they wanted to learn something if they cared to find out what it was they 'lost'. There are so many things that people have to deal with in projects today, that having to deal with limitations that are artificially imposed by ideology, which insists doing things the old way... it's just nonsense.
Why not then say everything should be done with a hard limit of 5MB hard drives or better yet, with throughput of punch cards?
If the author wanted to say something useful, he failed.
You can't handle the truth.
What is the sound of a pointer dereferencing to NULL?
Link in the summary is to the print page. Thanks jfruhlinger!
I remember when bits were made of actual stone, hand crafted, and strung by hand into computational frames. Today's kids don't even understand that this is what we are referring to when we talk about "Frame Works" today. Those Frames were tons of work, let me tell you.
Computational systems used these frames so that sometimes you had to go through several of them to get to your goal (These were the early AND gates), and other times you allowed users to pick which one to pass through (OR gates). When you forced people into exclusive choices (such as gates to bathrooms) these frames were referred to as exclusive gates (use this one if male OR use this wone if female, or XOR gates).
We used simple trip wires in our frame works to implement inverters, Very effective at reducing time wasted with managers. (Generally once a manager has been inverted a few times, they leave you mostly alone.)
Knot gates were generally frameworks made from pine.
I could go on about heat sinks (Hot rocks used to warm water) and other early computational technologies. But all of this is lost on this young crowd who don't even remember Java used to be drunk black for a nickle.
I learned to program on TI calculators (in C, so a bit more advanced than what most high school kids did with BASIC). The people I know who did similar things are good with making things quick, fast, and memory efficient.
It doesn't particularly make sense to me, but I think this is why I build websites the way I do--minimal number of images, and if CSS and JS aren't more than a few hundred bytes, I include them in every page instead of linking to them. Cutting down the number of requests does far more to optimize web pages than making smaller files (to an extent, of course). I'll never understand why people insist on having dozens of images, and a bunch of very small .js and .css files.
I do agree with you. I'm new to programming myself, but I've always felt the need to learn more about the computer than just the high-level language. That's why I want to take up PERL. Apparently, there's still a strong Ruby community out there, so I might take that up as well. On top of that, I like to plan out my programs. I like to know exactly what it will do before I do it, which may require writing out the code first. I'm only two years into programming, so I still have a long way to go. I just want to make sure that what I do is very efficient so that all my future supervisor has to do is sit back and trust me.
One of those interviewed in the article complained about the fact that modern day programmers try to solve the problem through an IDE or debugger, instead of putting in statements which change the output of the program. They wanted printf debugging. While I do value a good tracing subsystem, I for one, am grateful for modern debuggers which let me view the state of the system without having to modify/redeploy the code.
we had to code uphill in 10 feet of snow on an abacus using roman numerals.
PocketPermissions Android Permission Guide
30 years of experience can be 1 year times 30.
I've found the important thing is an actual passion for computer science, which gives you a real desire to know what's going on inside at the chip level.
The dot.com bubble brought in most of these "older" guys, who showed up for a paycheck, don't have that passion, and suck.
Age has little to do with it, in my opinion.
This pops up every few months really, somebody goes on and on about how much harder it was to program "back then", and that programmers who have been programming longer are better programmers. Duh! It's called experience, it has nothing to do with how "easy the kids have it these days". How does this stuff get to the front page when my story about the Columbia being destroyed by the Starfire Optical Range was completely swept under the rug. Ditto to my story about Giffords' partial brain transplant into the nine-year-old clone of her, the young Christina Green. Slashdot sucks.
Comments/phrases like these completely fail to grasp that things like this are RELATIVE. What is 'resource constrained' today isn't what was seen as 'resource constrained' 20 years ago. Likewise, many young programmers _today_ (including myself) DID in fact learn to code in what would be seen as resource constrained environments compared to today's machines. I cut my teeth on an 8MB Win95 machine and later a 32MB machine. Sure, that amount of RAM to play with is an insane luxury if we're thinking back to early/earlier 90s or 80s. But compared to what we have now it IS resource constrained. And heck, even mobile devices have more than 32MB to play with these days.
20 years from now 2 or 4GB of RAM will look like 'resource constrained' environments, and all of us who are 20-year olds now will be thinking "Herp derp, this new generation won't understand the resource constrained 32MB days!". And then 20 years from that, their experience will help them operate in 'resource constrained environments' when several TB of RAM is the norm or something
TL;DR: This is all a stupid circular pattern where each generation seems inferior to the last but still has some useful knowledge relative to specs of modern machines
How the fuck do you forget something you were never taught in the first place?
This article should really read: "Crotchety old programmers fail to pass on tricks of the trade, then complain anyways"
Eh, didn't someone remind us of this a couple of months ago? Seems like someone really has teeth to grind with modern coders. Get a life, you suspicious person!
My first computer had optional 1200 Baud for tape save, and we hated it!
(It was really unreliable. At least 300 Baud worked most of the time.)
I inherited an 8051 (spit - fucked if I know why anyone likes this CPU) project at my old work. I asked why they didn't turn the C optimiser on, the answer was the optimiser is broken as the code wouldn't run which sounded like BS to me. The owner with 30 years of embedded eperience was satisfied with this explanation. I got it working by putting the volatile keyword on some globals that were shared between main() loop functions and interrupts and bugger me if the application didn't start working with the optimiser on! My respect for the owner and his company began it's downhill slide that day. So even grumpy old codgers with years in the field like my old boss can be total n00bs too.
Most of my programming experience is in either C or assembly language, and a good portion on embedded devices. Recently at my job I have been learning perl, which is obviously an entirely different animal. I find it particularly interesting coming from this background to look at the different data types- In assembly, there really are no data types but only the hardware, in C, the data types are basically just abstractions of the hardware (pointers, arrays, etc). But perl has all kinds of things like typeglobs, and hashes and references (which still strike me as the english major's version of a pointer), which are far more abstracted. The hardware is doing the same things as always, but the model of the computer portrayed by the language is much different.
This lack of skills is particularly frustrating when troubleshooting a product developed and supported by a 3rd party.
Examples that spring to mind recently for me:
Vendor DBMS software is randomly corrupting database files. The vendor looks on the server and finds that it has used a couple hundred megabytes of swap. Holy crap, the machine is swapping, you didn't put the specified 4GB of RAM in this machine, you need to do that before we'll even touch the problem! Never mind that there was virtually no paging activity on the server at all when the problem occurred. And even if there was... please explain how that corrupts your database?
Vendor ETL software is running slowly. Finger pointed at the horsepower of the target SQL server. An hour later we discover that the vendor has failed to identify or use the relevant table indexes, and is in fact using a terribly slow computed WHERE clause.
Vendor tells us our database is full. The only solution is to add more disk space. When we look inside we find that the two largest tables hold exactly the same data, the third largest has no index and is regularly deleted from/inserted to, and most of the columns have storage types far in excess of requirements (do you really need an 8 byte floating point number just to store an integer value between 0 and 43200, or 40 characters to store which month we are in)?
One of the first things I learnt when troubleshooting problems is that it is probably a problem with your code, and not the hardware or external software libraries (apart from rare cases).
I'm new to programming myself, but I've always felt the need to learn more about the computer than just the high-level language. That's why I want to take up PERL.
(emphasis mine)
This possibly the most hysterically unintentionally funny thing I've read in a long time.
General Relativity: Space-time tells matter where to go; Matter tells space-time what shape to be.
We still use straight C, sometimes even intermixed with assembly. We know all about resource constraints, given that our microcontrollers sometimes only support a few kB for instructions and data RAM. As far as debugging goes, I'll see your debug-with-printf and I'll raise you a debug-with-oscilloscope-and-GPIO-toggling.
:(){
Not everyone needs to learn assembly and low level programming, but young people who deal with the latest and greatest need to get of their high horses too. Bad code is bad code. If you don't learn the fundamentals then you tend to write very bad code. If programmers are getting better, why are there so many more software flaws leading to security vulnerability? There is something to be said for learning what makes you the most productive but ignoring the fundamentals leads to problems that you can't even begin to solve.
it will last longer and be less hassle
OH really? No one needs it? I use it all the time. Not everyone writes Java or web apps. It has nothing to do with "low-level" tricks. I write real-time, embedded systems. Compiler or library code bugs, flaky or temperamental hardware, drivers or bootstrap code that absolutely have to use assembly code, time-sensitive buses, you name it. This isn't "Days of Computers Past." Not all of us suck our thumbs and pound on a PC keyboard. Get a clue.
what was posted in the past and many times.
"I see poor understanding of the performance ranges of various components," says Bernard Hayes, PMP (PMI Project Mgmt Professional), CSM (certified Scrum Master), and CSPO (certified Scrum Product Owner).
There's such a thing as a certified Scrum Product Owner? Am I now being encouraged to go get management trained on how to be certified at owning Scrum Products?
I'm not sure if I can take what someone with a set of certifications this ridiculous says seriously.
-- "So they told me that using the download page to download something was not something they anticipated." - Bill Gates
Looks like someone's whining they haven't been interviewed by Jason Scott for one of his oral histories of ye olden days of computing.
Even modern operating systems are largely written in HLLs
I guess you consider C a High Level Language. I think a LOT of people would seriously disagree with you.
I don't care what OS you are using. Those are written in C and Assembler. Look HERE for yourself.
You are not going to find any php, python, java, perl, ruby etc. etc. there, not a line of it.
Mostly your comments are pointless. Most really "good" HTML is still written by hand. It may get spewed from some content management system, but who do you think wrote all the HTML and CSS for those? Do you think JOOMLA magically coughed it up?
You are seriously clue impaired.
Hey KID! Yeah you, get the fuck off my lawn!
There's a big difference between "optimization", and "designed with standard performance considerations in mind" though. The latter should always be done. The former, only when there's a genuine need to run As Fast As Possible (tm).
Too many new coders today have no grasp of EITHER. They don't understand even the basics of algorithmic efficiency ("big O" notation, the difference between a linear and constant time lookup, etc), the cost of memory allocation (doing things like unnecessarily creating a new instance of a var or object inside of a loop, for example), or how to properly normalize and index a database.
So we wind up with situations where a web service is performing slowly... because it's looking up a DB record based on a non-indexed string match. :P (A real-world example encountered this week). And things like this aren't caused by laziness, or because "the project got done faster", they're caused by simple ignorance of what's actually going on. And why is this? Because when the developer originally built it, the brute force approach "was fast enough" with his small local dataset.
"Mind, as manifested by the capacity to make choices, is to some extent present in every electron." -Freeman Dyson
Every once in a while I read an article on Slashdot about how the current generation of programmers churn out only the shittiest of code; how they have no idea how a computer works; how they could never program without a fully-featured IDE with Intellisense that renders instantly. As an undergrad in a CS/ECE discipline, this has always surprised me-- I can only speak for the curriculum at my school, but I can assure you, these mythical 'lost programming skills' are alive and well. Most of the supposed missing skills are addressed in the following mandatory courses, required for graduation from CS/ECE at my school:
Yeah, sure, the some folks at the bottom of the class may be shitty programmers who scraped by with a "barely passed" in the mandatory courses. But surely they existed 10, 20, 30, 40 years ago as well. I'm not sure where people are getting this idea that new coders have no skills. What do they think we do for four years, set up MySQL and write PHP for it?
You need to wait until the shit is done, then profile it. You suck at knowing what needs to be optimized, no I don't care how good you think you are. Ask the experts, like Knuth or Abrash.
So if the speed matters, or the RAM usage, or whatever you write the program, then you profile it, in real usage, and see what happens. You then find where spending your time is worth it.
For example support you find a single function uses 95% of all the execution time. Well, until you've optimized that, it is stupid to spend time optimizing anything else because even a small gain in that function will outweigh a massive gain elsewhere. You need to find those problems spots, those areas of high usage, and optimize them first, and you can't do that until the program is written and profiled.
That is also pretty common too, the "Couple areas that use all the resources," thing. It is not usual for it to be spread across all the code. So you need a profiler to identify those and you then need to focus your effort. You can then break out the ASM hackery for those few lines that have to be super fast, if needed, and you'll achieve most if not all of the result you would from doing the whole thing low level.
Some old-school developers prematurely optimize for things we no longer need to optimize for (and shouldn't). From an older post of mine:
He was optimizing for resources that were no longer constrained, and consequently pessimizing for the resources we actually cared about. RAM? Dirt cheap, at least for the dataset sizes involved in that project. Much more expensive was all the extra disk and CPU load he was creating on the company-wide database server (which is sufficiently powerful to serve the entire company when it's not being deliberately assaulted).
I'm not "anything goes" by any means, and I'm the guy responsible for making sure that lots of processes can peacefully coexist on an efficiently small number of servers. But for all intents and purposes, most of our apps have unlimited resources available to them. If they want to use 100% of a CPU core for 5 minutes or 2GB of RAM for half an hour a day, so be it. I'd much rather run simple, testable, maintainable code that happens to use a lot of server power than lovingly hand-mangled code that no one but the original programmer can understand and which interacts with the rest of the network in entertainingly unpredictable ways.
Dewey, what part of this looks like authorities should be involved?
My jquery/ajax powered website retrieving gzip-compressed json feeds from my php/mysql backend uses about 2-3kilobytes per page.
Over the last few years the most disturbing trend I have seen is programmers that do not have the ability to ship a product. You can talk all the shit you want about architecture, cute technology, methodology but if you don't ship product you don't count.
Got Code?
developing thorough specifications before coding
Believe me, if I could get anyone to approve, sign-off or even read a spec before it had to be developed, I'd write them a lot more often.
Just because you're paranoid doesn't mean there isn't an invisible demon about to eat your face
By accident you got almost the right idea. The problem is: Today's developers waste the times of millions of their users (did you ever watch, say, the SAP client start up?) to save a little of their time. Yes, programming is faster. The expenses are moved, and multiplied.
Ever faster CPUs and HDDs, ever more RAM and cores and storage and bandwidth make me wait... just as much as before, sometimes even longer. Not too long ago I'd type faster in Eclipse than it would show me the characters. I get my car started and rolling before the parking sensors are active.
My own experience has born out much of what the author states -- yet he really doesn't go far enough. The problem is less with the new coders and more with the system and what University's and Computer Science departments are teaching (or NOT teaching, as the case may be).
Even since as far back as 25 years ago far too many programs have been aimed at theoretical computing models and don't teach practical design methods -- especially for embedded applications. At the company I used to work for, we specifically would not hire anyone with a Computer Science degree unless they came on board as a contractor for 6 months first (until we could see if they actually had a clue) -- EE's and ECE's we would usually hire outright (though we sometimes regretted it).
The emphasis on people not understanding hardware interfacing in the article is spot on -- I deal with programmers quite often who have absolutely no clue what happens when the code they have written actually runs and tries to talk to hardware (and they have equally poor understanding of assembly code and how compiler theory applies to the translation between a high level language and what actually gets executed).
If you are dealing with Windows or OS X apps that have what amounts to unlimited memory space and an insanely fast processor, this is borderline acceptable (though it still yields horrendous code that is often far more bloated and slower than it needs to be.
To those who say that it is a bad idea for a company to allow their programmers to "waste time" writing good or optimized code, I say, "it all depends on your target market" -- and whether or not you have to support the product into the future.
I personally have worked on a project where we had 3 high level engineers spend 4 months to re-architect code in such a way as to allow us to eliminate a single IC that cost about $0.25. In essence, we spent a man year of effort to eliminate a part that cost less than a quarter -- and it was an EXCELLENT investment and made perfect financial sense. This IC was on our display processing board and went into basically every item we produced (TV sets), on multiple production lines and across basically every screen size. This same design was used (with slight modification) over almost 6 years. In each average year, over 1.5 *MILLION* of these boards were produced and sold -- which means that eliminating that part saved us around $375,000 *per year* (and probably close to $2.5M over the life of the design).
Similarly, I actually spent almost 3 months hand optimizing Keil C code (and hand-coding some routines into assembly, as I can generally do a far better job than the compiler) to allow the code to ship in a micro with one size smaller embedded ROM (at a savings of several DOLLARS per part). We shipped our initial production run with the larger part to meet schedule and then shifted over to the smaller one as production continued.
Other things that current software engineers I run across are completely ignorant of is that there ARE errors in hardware and that there ARE differences between different manufacturers devices -- and they often have to be treated quite differently. I primarily write low level embedded device drivers for a living -- and let me tell you, the number of glitches I see in hardware are legion. So are the differences in parts that are "theoretically" identical from different manufacturers. A good case in point would be when our purchasing department decided to sub a Xicor 24C series I2C EE for an ST 24C I2C EE. They are supposed identical parts, with identical specs, with identical memory capability, etc -- but the Xicor part handled the internal voltage pump differently for consecutive rewrites across blocks of memory cells than the ST part did. The end result was that while the part initially worked, they began failing in the field within a few months -- where some of the original ST parts are still working to this day. There was nothing wrong with the Xicor part, per se, and once we ch
Oddly enough, John Carmack says something similar in his 2011 Quakecon Keynote. Ninety minutes of rambling on about Rage, the importance of static code analysis and programming the Xbox360 and PS3 to the metal. Well worth watching.
I feel it in the water. I feel it in the earth. I smell it in the air. Much that once was, is lost, for none now live who remember it.
Problem is that coding is a creative act and the better one understands the tools of the trade and why they work the way they do, the better a result can be produced -- particularly when there are cost/time to market tradeoffs. As I see it, in an overconfigured end user workstation, one can afford to be sloppy. But if one is coding a realtime database that is expected to do certain decisions on a 10,000 record per second datastream, efficiency might matter a lot. It depends. I do recall, back when I was a working programmer (database and OS internals) we saw a demo of an arbitrage application some loon had coded up for one of the big New York trading firms. This thing took realtime info and developed on the fly trading strategies for buying and selling currencies on different markets. The resources consumed were enormous but then so were the profits. Getting it out and working was more profitable even with the extravagant hardware than writing tight code and running it on a big PC. Or in another skill domain, if the only tool you understand is a hammer then every problem starts to look like a bunch of nails. You may bash a lot in but fine cabinetry will not be one of your accomplishments. Sure, computers have been getting faster every year for a long time. And the classic tradeoff pyramid still applies -- it can be fast, good or delivered quickly, pick any two. As it is, each new crop of programmers recreates the errors of the past -- since there is nothing to learn from the (obsolete) past. Ask any HR person who would rather hire a fresh new (cheap) grad than an old hand (probably just laid off to allow hiring of...) and ask again why the hard-won lessons of the past are not being passed on. Get off my grass...
I've now read the original article a couple of times and gone through the main comments a couple of times. ...and I am confused. It seems that many people commenting have not actually bothered reading the original article to see what was being discussed there - and have jumped straight in with comments about what they (mostly wrongly) think or assume the article was about instead.
Many of the skills discussed in the original articles are about avoiding and/or managing a diverse range of real-world problems of the kind still regularly seen today.
AJB
We have more code verification, static typing, contracts, tests and assertions than ever. Somehow I doubt the above.
And if by 'specification', you mean a spec on paper separate from the code, that's because the lessons of the past have taught us that specs are never current, so what's the point? With more expressive, higher-level languages, the programming language becomes the specification language, and a specification in such a language is then naturally executable, ie. code is the specification with sophisticated types, or an executable program can be extracted from the specification ala Coq.
Higher Logics: where programming meets science.
unlink("/lawn/kids");
I have a website that is in the top 35,000 in the world and I don't even get that much traffic. The vast majority of website could be written in anything and any fuckin' way you want because they get about 50 hits a day. The shitty coding is just fine for the vast majority of websites. For the top 1000 sites, the article is correct.
It applies to computer science too. Premature optimization may be the root of all evil, but it doesn't mean you shouldn't write code without a high regard for how well it performs in whatever environment you have. A decent understanding of the resource limitations (whether they be ram, io, time, or something else entirely) and a -very- little bit of effort can go a long way.
It's all about balancing coding effort vs the reward in doing so. It's also worth considering your users time. Shaving 10 seconds off the load time on an application may seem silly to a coder if it takes 4 hours to do it... with say a minimal example of 10 people in your office starting your app several times a day, it would take months to break even on productivity. However if you are developing a widespread application, saving 1000 people 10 seconds twice a day is a whole different story. 100,000 and you've just wasted 23 user-days per day to save yourself a one-time half days work. Great job dude!
Use common sense. Balance cost vs benefit. It's not that hard.
...today's coders don't know is that their innate talent doesn't trump our experience. At best it only makes them equal to our innate talent that we still have in addition to all our experience.
When a fresh-out-of-college coder thinks he can enter the maintenance cycle of a well-established product and change how everything is done, with no knowledge of any of the client needs or painful events that drove the existing processes, all he does is create a tremendous amount of pain for the clients and embarrassment for himself.
You hear me, new guy? Stop being a bull in the china shop! Learn the damn system before you go changing it.
And also just meeting the functional requirements is NOT ENOUGH. Your code must also be maintainable by people who didn't write it, scalable to demand far greater than a handful of users on a QA server, AND it must be secure, which you won't get right if you haven't studied up on the exploits.
Sheesh.
fta: ...says Bernard Hayes, PMP (PMI Project Mgmt Professional), CSM (certified Scrum Master), and CSPO (certified Scrum Product Owner)...
As someone who's just picked up a CSM I really like the way they toss these certifications around as though there's some real prestige associated with them. CSM is a two day class and so is CSPO - worthless certifications intended for management types.
Utter nonsense.
I keep hearing a version of this over and over, (there is a famous why I hate Java blog post) but it's nonsense. Yes we have a lot broader programmers that aren't the pioneers like we have a lot more internet users than when it was all in colleges (mostly). So some programmers aren't part of the hard-core early programmer set... who cares? I started learning C programming where cycles were so important that doing a Fibonacci sequence program recursively would take forever, yet when I coded it the way I was taught when learning Ruby, my code was called obtuse. The reality is that programmers now work in a different ecosystem. Code readability, speed, and effectiveness are way more important than efficiency. Old hats stop your whining. Programming isn't just for the hard-core alone.
Well, the new generation can cut their teeth fixing the deluge of memory corruption bugs left behind by these old "supposedly better" coders. Or better yet, write their code in a programming language where you can more safely move around bits without leaving an unintentional backdoor.
Knowing where the bottleneck is, and knowing whether it is important to fix it, are the most important things for performance.
Sometimes it's CPU and sometimes it's I/O and if you don't know how to use a profiler then you might have to guess, so using a good profiler that can cover both systems is probably the most important skill.
But knowing when something is actually worth optimizing is also important. Sometimes it's cheaper to buy new hardware, or to wait. Sometimes it's important to improve things.
The author seemed to have a particular list of things he thought were important, but the reality is you can't generalize about what matters. Just yesterday (honestly) I made some Windows servers start up more than 1,000 times faster, just by suggesting that the programmer remove one flag from a function call. That's not something they teach you. I blogged the details at http://randomascii.wordpress.com/
Don't underestimate the value of a spec.
It's a very good idea to write a thorough business plan before going in for a business proposal (and loan), as it forces a person to think through the different scenarios and problems.
Likewise, when somebody shows up with a well-considered spec--usually after some informal Q&A with developers--I find the outcome tends to be very good. Even when the spec evolves (usually via email or voice) and becomes drastically different, the original spec is still valuable because:
1. It thoroughly highlights the business problem(s) that needs to be solved.
2. It forces the writer to consider whether the proposal is actually a good one.
3. It gives a starting point on a candidate-solution (and gives coders a chance to think about a counter-proposals and tweaks).
4. It gets coders thinking early-on about some of the outlier business conditions--not necessarily completely fleshed out in the spec.
5. Down the road, it gives people a window into #1. This is important if you're dealing with esoteric or arcane business rules.
It's all too easy to blame developers for a shoddy job; but often, analysts will ask for features that with a bit of thought were probably a bad idea in the first place.
When the article is not vague, it is plain wrong.
Recently I made teo rather trollishly titled posts on the same subject, on my Livejournal:
http://abelits.livejournal.com/41968.html
http://abelits.livejournal.com/42052.html
Seeing how even supposedly knowledgeable developers post unreadable, vague opinion pieces, I think, I will have to add more to those.
Contrary to the popular belief, there indeed is no God.
I agree that saving time for people is something, but I also think that a well written and optimised code is the best way. If you write something in a sloppy manor then later down the road that could cost more for the company in further upgrades due to elevating the scale of a program. I am of course new to programming and writing code (3 years). Well for example you have a web page that runs fine and dandy say using "wordpress" it helps a user to get a blog up fast. but then you have to "tweek" the hell out of it to handle a larger number of page views, this leads to more work. The same program can be written in a far more officiant manor. As a junior web developer I find that "bloated code" slows down things a fare bit. When you can do the same thing in 1 line of code as you can in 10 then why are you doing it in 10 ! In short I think that coders should do the best and most economical jobs they can, saving money and time, I mean rather than just saying "oh we will chuck another server at that and it will be ok". I might be wrong about this so please correct me if I am wrong.
One of the problems I find I encounter more these days than in the past is that there the coder is increasingly at the mercy of more and more layers of underlying code which is more or less impervious to reasonable debugging.
The performance of your application code was in the past pretty deterministic - not usually very much between the OS and your code and the OS usually had a closely-defined role and if it failed the consequences were usually obvious. It was also exhaustively documented so there was little to take you by surprise.
These days your code may be on top of a bunch of middleware running on top of an intermediate language environment on top of a virtualised machine and OS with networked storage. When these things don't behave as you expect, good luck with finding anyone who knows about all of the various internals enough to help you solve the problem.
And, indeed, good luck with writing your application. Half the stuff the middleware provides to you will only be documented in someone's blog somewhere. If you're really lucky, the Release Notes will be accurate in its report of the stuff that doesn't actually work as documented. Some part of it will assume a model of resource allocation that is unhelpful to your specific use case but you won't find that out until halfway through your project.
This is just part of the IT hiccup that occurred with the advent of the microprocessor - Computer Science was forgotten and painfully relearned over a period of about 30 years. Unfortunately, it's rather stagnated in the interim and the problem is not so much that people have forgotten the lessons of the past, they haven't actually developed the new tools to deal with the staggeringly more complex environment in which software now lives and is developed.
First to declare interest, I'm 60 pre-internet and generation COBOL/Assembler, get off my lawn generation too!
That said, there's a great many good reasons for doing things economically, concisely and elegantly, Occam's razor, optimal use of resources [a financial matter too], no constant upgrades and server/desktop refreshes. No endless addition of extra storage because stuff is duplicated everywhere. By the way, if someone starts a project to de-duplicate the web down to a 'safe' evel [only ten copies of each thing not 2K] , I'll sign up.
I also resent, mainly government who send me half a dozen self-congratulatory jpegs with each email. You're wasting bandwidth and blocking up the pipes, you folks.
So, if we pay a little attention, we won't need the sprawling power-hungry data centres that all the big players seem to be building. WE won;t need the constant hardware refreshes [admittedly a lot of those are Windows 'upgrades'].
Anyways, don't listen to me, I'm old and grumpy, but take a look at this: http://en.wikipedia.org/wiki/Green_computing especially Product Longevity.
On y va, qui mal y pense!
5k would have been heaven when I first started typing Z80 hexadecimal into a computer.
No sig today...
See subject-line above & explain that, because by your reasoning, today's software should be worse than that of "yesteryears past".
Now, I don't know about you or others here (or the author who wrote said article), but... I am one of the "relative oldsters" here in terms of coding & age.
I also know that things get progressively better in terms of software, it's the very nature of the beast in fact to do so, and there's no question it does, per the example I put out in my subject-line above, being a PRIME EXAMPLE THEREOF.
Do, or rather, you *NEED* to know how to program assembly to code Windows? No.
Can it help @ times for small routines that need a boost in speed?? Yes.
A better algorithm can do the same though, & perhaps moreso, IF time is taken to research into it & find it, OR build it from scratch (this can be done in business type programming especially). Sometimes, throwing hardware @ a problem helps too... case in point being SSD's with say, databases or websites (no head movements lag, & far better seek/access in the File Open/Read-Write/Flush/Close I-O cycle).
Thing is, in commercially produced software or software for business, TIME = MONEY!
Yes - you have deadlines to make (this is the killer)!
I.E.-> You have a delivery date promised and if you don't meet it, penalties ensue (for payment etc.)... Today's HLL (higher level languages) help you MAKE THAT DEADLINE by "macroing away" the intricacies of writing code instructions in assembly for instance, yourself.
Heck, even doing string processing routines (always there) is better in newer languages than it was in the older stuff... & they're very highly optimized by now & continually being done so by those that manufacture programming compilers too. So much so from what I have seen & understand, that C/C++ for example is VERY CLOSE to Assembly code speeds of operations, when optimized. Enough so that it's worth using HLL's vs. ASM, & the buildspeeds are faster, hence, time to market as well (and deadlines get met).
APK
P.S.=> I only briefly scanned the replies here, & landed on yours is all - don't take offense to it, but... It's almost like folks here are saying "Old stuff/Old ways are better"!
(For speed of code operation, perhaps, but not so much so that it's worth the time taken & testing also for doing it. Management won't have it, & I won't solely put the blame on they, they are only responding to pressures put on they in fact is all!)
Would I like to be able to "hotrod" every project I ever was involved in by inserting perhaps, better algorithms I found out about later or using inline assembly code routines I found later that gain me a TINY BIT of speed/efficiency?
Sure... sure I would!
However - my bosses wouldn't have it for the reasons I noted above, & yes, I *do* understand their point: It's ALL ABOUT MONEY people & businesses are in business to generate profits, not necessarily absolutely excellent product...
Don't ever forget that guys, especially that LAST POINT: Again, it's not about "better/faster/more efficient superior product", it's about money...
This IS "the problem" - and yes, all of us are part of that problem - we're in it largely for the monies, to survive...
... apk
You state you write compilers. Ok then. Then you KNOW that pulling stack checks or bounds checks does improve speed, but, @ what cost? Potential errors. You KNOW this man. Data itself can have "garbage" in it, & even DBA's miss this @ times, & users touching keyboards is another potential danger here (yes, even IF you put in errtraps/filters for data in keypress events on data type entered, lengths, etc./et al). So, "no thanks" - I leave those ON (stack & bounds checks), to avoid future problems (I have & do a lot of data oriented coding is why, strings & DB data), even IF they "slow me down".
Why? You KNOW WHY - Some stuff "slips past"... users data entry, & data sanity from data sources even, can be a TOUGH thing to prevent, 1st time out. Hence, I am sure you have SEEN this yourself too, and know what I speak of here.
I put in errtraps into my code, & yes, even LOG DUMPS for it (for structured errors USUALLY, as well as the data entered by the users keypresses stored in BOUND/BIND variables too, just so I can see hopefully, WHY a crash occurred & in what specific routine in MY code it happened in (helps, but not if the problem's in the libs that might be used, structured dumps help here, but sometimes, they cryptic stuff I have to call the compiler OEM on)).
Still, I know it slows you up as well but I use it & other things (more below)... why?
Safety.
Just in case I overlooked some STUPID THING (yes, it happens, you KNOW it does) or condition I was not prepared to encounter from users' use-patterns idiosyncracies or the data itself not being sanitized ( & not by myself so much, but by DBA's during say, data conversions from one DB engine to a bigger faster one (been here a few times with FoxPro data to Oracle for example)).
I'll gladly take "hits in speed" over screwups & crashes in code, anytime. I am sure you feel the same. This goes for errtrapping (Try-Catch-Except etc. (depends on method for each language but point is there)), AND, compiler switchwork for optimizations also.
APK
P.S.=> This "analogy" of mine reminds me of that, & it was when I was a kid learning to do brakes from watching a pal of mine do them (who was drinking while doing another pal's brakes): He forgot to put the cotter pins (old stuff) back into the retainers on the caliper, & I found them on the ground behind his toolbox... my other pals ribbed on him saying:
"Hey, he MUST work for the 'Marlboro race team' & knows that without brakes, the car WILL MOVE FASTER!"
(You'll probably crash, but you KNOW you'll go faster because you can't stop when you have to!)...
... apk
Heal a broken leg, milk a cow, give birth to a child. Sorry, I'm such a noob...
I do lowlevel stuff like that on a daily basis on microcontrollers. I do it in C.
That is as low of a language as you need to go. I don't see any point in writing assembler ever.
Yes, it's useful if you can read it for debugging and you will sometimes use a handful of assembler instructions embedded into your usual programming language, to use special functions of your controller. But writing programs in assembler... just no. Just because it can be done, does not mean it's a good idea to do it.
Driven by the web (and possibly games) industry, programming has become a race: whoever ships the product or new feature first, gains an advantage. So development speed is much more important than in the old days, when you could still win something by cramming more features into 64KB RAM or when you paid for your rented computing time and could spend months optimizing your code. Consequently, architectural decisions are still important, but optimizing your code - unless it becomes a specific requirement, for example, when you simply cannot afford to buy a box with 512GB RAM that can run your current stuff unmodified - is not.
"I love my job, but I hate talking to people like you" (Freddie Mercury)
Their performance varies a lot, depending on factors you don't or can't know. The back-of-the-envelope computation example in the article goes through a much longer chain of deduction these days:
Fortran statement
x86 instructions
RISC-ish micro-ops
full-speed until:
* cache empties
* branch prediction fails
* speculative execution runs out
To a Lisp hacker, XML is S-expressions in drag.
From my experience @ least, & because of deadlines (My 1st yr. into the profession, professionally, back in 1994 in fact):
"Whereas with "Software Engineering", the bosses are more likely to go "Ship and sell it, we'll fix it in the next release!"." - by TheLink (130905) on Saturday August 06, @02:04AM (#37004512)
I asked a former employer of mine (& I'd guarantee everyone here has had SOMETHING to do with their stuff, since it controls POS commerce in many a scenario) WHY we were not fixing a bug, an "intermittent one" (not always occurring) - he said:
"Because it's not a 'constant' crash etc.? We'll ship it, & fix it in a patch later... first, we HAVE to make deadline!"
Which I said "It would only take, @ most, a week to zero-in on this & fix it, tops!"
He said (rightfully so) this to me in response, from a BUSINESS STANDPOINT (valid one too)
"Look, you have to understand that we as coders are a "business inside the business" often considered a COST CENTER, not a profit engine/center - the bean counters look @ us like a liability quite often instead of an asset. We don't make that deadline, the venture capitalists behind this project, external to the company, who are speculating on its profitability & investing in us have it written in because of they using LOANS FROM BANKS, not their own monies mind you, with repayment terms & schedules behind them? They get hit with a penalty, & in turn, their contracts with us have the same thing written in to cover them... we're late? SO are they! They have to pay penalties & they just pass them on to us. No, make delivery, especially on small intermittent issues, first..."
APK
P.S.=> It's HOW THE WORLD WORKS, money is #1 (rightfully so too, if you think about it - perfect can come later (if there IS such a thing, this field & the underlying API & OS platforms change so fast))...
... apk
That's often what it means, and not by accident. "Don't optimize prematurely" means don't optimize until there is evidence that you need to optimize, and then only optimize what there is evidence that you need to optimize. In practice, that means (for many components) never optimizing many aspects that could, in theory, be optimized, because optimization never turns out to be the change that offers the most value for the effort.
Don't optimize prematurely ultimately is just a special case of "do the one thing that delivers the most value for the effort, and repeat as needed". Until optimization od the code for any particular characteristic (whether its speed, memory consumption, or something else) is that one thing, doing it is a waste of resources.
Ugh, I cut my teeth when 1200 bds was bleeding edge... Not sure that I agree completely with the author though. Whether a programmer write efficient code depends on his natural skills, not when they were born. Regardless of whether one programmed in assembly in some distant past in order to squeeze every single CPU cycle they could, I think natural skills is what matters most. Bad programmers back then when resources were very limited, would still suck big time nowadays producing efficient HTML/PHP/Javascript.
I agree that it is very useful to know how things really work under the hood, and good programmers, past or present, tend to naturally inquire about "what is behind," so even today's naturally skilled programmers will do as well as naturally skilled programmers of the past IMO.
My problem in this distant past is that I was on a never ending quest to save yet another CPU cycle, even if it meant zilch to the end-user. I eventually understood that shipping a product is quite important, and changed my focus to convince management that "shipping a product that doesn't suck is quite important," and all went well from then on.
They'd operate faster, but sometimes, especially even with code from THOSE days? It could be a "detriment" - even older code, say, developed for 8088's (especially gaming-wise), in fact, I am sure you've possibly even seen it yourself...
I did, & had, + know: In fact, @ times, I had to use programs that "lagged the system" once faster systems came out, to play older games for instance! The programs would be faster, you even note this, but with some code?? That "gain" can be a "loss"... read on!
(Used to be a "big gamer" in the mid to late 90's & I wrote stuff to improve gaming in 3d in fact folks liked & I was astounded to see there's still links to it active online in fact even to this very day -> http://www.google.com/search?hl=en&source=hp&q=%22APK+3dFx+Tuning+Engine%22&btnG=Google+Search )
I suppose on your statement of "when they're broken I just fix them" then, we have something in common & both code then (see the above for a tiny evidence thereof from my end)...
I.E.-> WE can build our own solutions, most folks cannot.
* So, in the end here? Well, I suppose you should be glad then if I understood you correctly, that you have put in the time for such abilities on your part, I guess is what I am trying to say (you can be your own "mechanic/tech").
APK
Unfortunately, despite having a bachelors in CS, and several years of web programming experience, I have only recently discovered OOP design patterns. They are very useful methodologies, and I think today's programmers, especially in the web development arena are far too ignorant of these useful additions to one's toolbelt.
Patent: from Latin patere, to be open
You fail it.
Btw, most of the time it doesn't actually take an "expert" to identify where optimisations are needed. A profiler will do that in an automated, objective and easy way.
HAND.
I don't think programmers are less capable now than earlier. There's just been a loss of connection between the software and the hardware. I happened to look at a piece of code a young programmer wrote in C++ to insert a 4-byte length field at the beginning of a file. A simple task, keeping in mind that the field had to be big-endian. This programmer, however, formatted the length value as an ASCII hex string, decoded the hex string 2 digits at a time to place the bytes into an array, and then wrote the 4-byte array out to the file. This solution boggled my mind!
As other posters have noted, I think it is because colleges teach using ever higher-level languages and are skimping on the lower-level architecture and operating systems courses. (On the other hand, we learned LISP and SNOBOL when I was in college, so high-level languages are not a bad thing; my own preferred languages are C and Scheme.)
Just a simple observation. Look at how poor MS operating system coding is. Patch's for bad coding is a continious stream from MS. .001 percent. IBM tests the code on their own internal systems and then lets the code be tested by a few external users before it is GA(generally available). IBM is not perfect and problems do get through but not anywhere near the like MS. Security issues are (again) almost non existant. I can think of only 3 or 4 in 40 years that I have been working with IBM (as a user). Usually the security issue is small to begin with as a design point security is one of the hallmarks of IBM.
IBM on the other hand has a much more complex OS (z/OS) and the number of errors that make MS famous for are extremely small (probably) less that
As an architect, designer and coder, I see this all the time, and fight it all the time, but usually lose. There is a place for ORM layers, dependency injection, TDD, poorly documented libraries, closed-source libraries, etc.; however, my experience leads me to believe that most of the time, in expert hands they are unneeded, while in less than expert hands they just get in the way, create more work, slow things down, and make both getting to market, *and* subsequent maintenance, orders of magnitude slower.
I often work with people who would rather write 1000 lines of XML than 25 lines of SQL, or write 25 irrelevant unit tests rather than gather and correctly implement one testable requirement. Give me a managed environment (Java/.NET/Python), a decent RDBMS, and a decent, preferably managed API around any hardware I need to access or I/O I need to perform, and I can generally get the job done with few if any other tools, and it will get done quickly and be at least as maintainable and flexible as the more "enterprisey" solution that needs 50 incompatible libraries just to build. But then the so-called "architects" whose experience comes from reading Pointy Head Weekly^H^H^H^H^H^H Gartner, rather than building or maintaining real systems, will tell me I'm doing it wrong, and make me redo it with the 50 libraries.
"If you're right, and we're just making more work for you, well, think of it as job security." Another canard. Job security comes from adding value and contributing to the success of the organization. Which I try very hard to do, and others try very hard to undo. Not so much at my current job, but my previous employer - a good, but very bloated and bureaucratic organization - was famous for it, and ended up having to outsource almost all their development because it became so inefficient. Now, a bunch of people in Chennai have job security, instead of my former colleagues, because they will be adding value whereas our "architects" did their very best to ensure that we could not.
Nonaggression works!
Yes, there really are micros much smaller and cheaper than that. $2 in production quantities can get you 128k of Flash and 16k of SRAM on something with a CPU decent enough to run sloppy C code. You're thinking much too large; think $0.30-$0.40 for the cheapies. Google around for the Atmel Tiny4, Tiny12, or the Microchip 10F family for starters...
You are correct about the quantities of scale, but remember that if that electric toothbrush is $40 at retail, the company probably didn't spend more than $8-$10 in materials to build it. At those prices, $0.50 makes a big difference when you are shipping 100K or 1M each month.