3 ms·
As computing resources continue to grow, efficiency falls further behind another concern when writing code, though. I've spent enough time diagonalizing 10,000
by hugh3 15y ago
As computing resources continue to grow, efficiency falls further behind another concern when writing code, though.
I've spent enough time diagonalizing 10,000 by 10,000 matrices to get frustrated with anyone who claims that efficiency in time and memory ain't important any more. Maybe not for your code...
- ChuckMcM 15y agoThat sentence summed it up for me why this is 'bad'. If you consume the new reources you get with inefficient but 'clean' code you have no new resources to add either features or improvements. So often times coding efficiently is living giving yourself a bigger server for 'free'.
- Stormbringer 15y agoI've spent enough time reading code written by people who thought that efficiency was more important than readablility to know that not only are they spectacularly wrong, but 9 times out of 10 they suck at efficiency but didn't realise it because their code was so firckin' obtuse. As soon as their code is made more readable, not only does this make life easier for the next guy, but it also makes it a lot easier to optimise once it is clear what it is actually doing. People who don't want to write readable code seem to subscribe to the belief that there is only one way to write a particular line of code, yet they could not be more wrong. For any non-trivial section of code in any non-trivial language there are dozens, if not millions of different ways of writing it. Given that, making it unreadable is either maliciousness or incompetence, and Hanlon's Razor tells me it's probably not malice. Moreover, most of the time the poor sod who is the "next guy" to read/maintain the code is you. You are the next guy. You are the audience of most of your coding efforts. If you cannot read your code 6months down the track, then the only person you're shafting with your bad workmanship is future you. You can have your cake and eat it to. Code can be both efficient and readable.
- cdavid 15y agoThis is a straw man - nobody would argue that for numerical code, efficiency is not important. Somehow, I expect that you did no code the diagonalization code by yourself. Numerical code is actually one of the worst example you can find, because first the API is very clear, and there is little chance to have a change of spec later, making it efficient is generally purely a matter of algorithms + implementation. It is obvious the OP is talking in a context of web apps and co, where this is not true at all.