- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
Admin
After saving, this is the tokenized line of code (disregarding the few bytes that signal the start and end of the file):
or, leaving in only the spaces that are actually in the tokenized version: The spaces can actually be removed from the file and it'll load and run successfully in that form (they won't be added back in during the load). In tokenized form, the keywords are all distinct with no need for spaces around them, even though the editor requires spaces to distinguish them in ASCII form (and doesn't remove those spaces when it tokenizes).Admin
Calling .ToString() on a string is a NOP by itself ...
Admin
In some languages, like MATLAB, removing whitespace can actually hurt performance.
Admin
Admin
Not these days... it'll speed up parsing but that's it, the main gain from minified javascript is that it downloads faster. Mainstream javascript engines these days parse the code and generate bytecode that they then either JIT compile as needed or just interpret if it doesn't seem like the JITing will be a win.
Admin
Minifying a header that is frequently included isn't really going to speed anything up since it'll be in the OS file cache the next time it's read and I doubt the minification would make a significant difference to the parse time.
Admin
I agree. That's why every company should have a style guide that all developers have to follow, regardless of whether they like it or agree with it.
Admin
I've just read some of the comments here and a lot of you do not seem to get it. So I'll reiterate in capitals, so you can see - THE CHANGES YOU SEE IN THAT PARTIAL DIFF VIEW ARE THE ONLY CHANGES SUBMITTED FOR THE PERFORMANCE FIX! ITS NOT A FORMATTING CHANGE AND THEN A PERFORMANCE CHANGE MADE EARLIER - IT'S THE ONLY CHANGE - THAT IS THE TRWTF!
Admin
No, the TRWTF isn't a blurry screenshot of a diff tool, that was just to highlight the only changes made throughout the file - did you really need to see an entire files worth of the same changes to see my point? Really? Truely? Maybe IT is a little too hard for you then..
Admin
If that's the case, then it needs to be disclosed right up front before or during the interview. That way, those of us who know how to program and can read multiple styles of formatting can decide whether or not steer clear of a potential clusterfuck.
The problem with opinions like yours are that they assume a competent decision maker. An incompetent decision maker destroys any value that a code standard may have. I've had to turn several projects upside down lately because the new "standard" imposed is schizophrenic, willfully ignorant of the pitfalls it invites, and completely unconcerned about quality control. It's worse than so-called "cowboy coding" because it stifles everyone to the level of the lowest common denominator. And if you have some H1Bs on the payroll, that bar can be so low you'd have to dig a tunnel to trip over it.
Admin