3 ms·
Yes, many programmers would say exactly that in those languages. Code readability is very important. This is a debate that flares up every year or so, but a lo
by mattmanser 14y ago
Yes, many programmers would say exactly that in those languages. Code readability is very important.
This is a debate that flares up every year or so, but a lot of programmers generally consider premature optimization to be a complete waste of time and bad for your code. They would tell you to write clear code and use a profiler to find actual bottlenecks, not spend time fixing imagined ones.
- kamjam 14y agoFair point, and I'd agree with you - I'd defo go over clearer code than something purely for premature optimization... except I think the examples given were MORE readable afterwards, at worst you've ended up with optimised code! Problem with JS is that there is not as many optimization tools, aside from Firebug that I can think of. On top of that, personally, I'm a C# guy that does some JS and most people I know are like me. The other guys that do JS work for design agencies that are more front-end/HTML guys. Most of us aren't tooled up like in the C# world for optimization and rely on optimization tips - it's a lot easier to do these as you go along rather than retrospectively like you can with server languages. (I may well be missing a whole toolset here somewhere - be good to find more resources)