- 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
The comment page was full of white space when I got to it!
Admin
Fristonremovingwhitespaces...
Admin
Admin
This
Comment
Has
Yet
To
Be
Optimized
Admin
Calling .ToString() on a string is a WTF by itself...
Admin
Windows makes a sparse paging file to increase performance, removing the spaces naturally would slow down their code, silly ass hats.
Admin
Is this really what they have been doing for months or was that just the very last commit? There is nothing wrong with changing the formatting (if the whole team or even company decides on the same formatting)
Admin
Maybe they were trying (and failing) to do the old "Let's throw some long loops that do nothing in there so we can optimize it later" routine.
Admin
And this was the only change?
Admin
If the application would have been written in Whitespace (https://en.wikipedia.org/wiki/Whitespace_%28programming_language%29), then the application would run much faster after removing whitespaces.
Admin
Everyone's missing the obvious answer to what happened here - the coders are paid by LOC and the project manager found a quick and easy way to bring the project in under budget.... ;)
My money's on the real problem being that he "optimized" the code somewhere else in a breaking way...
Admin
Obviously that won't fix performamce issues. You need to to remove all the white space, not just the new lines.
If you really need to be Web scale you should run it through an obfuscator to shorten all the variable names as well
Admin
There could be a significant code change! Just because you don't see it doesn't mean it's not there! Don't you know the Whitespace programming language?
Admin
voluntold is the best word ever.
Admin
But it works for Javascript!
Admin
This is somewhat similar to the reasoning: "Employees cost money. If I fire all employes, costs are greatly reduced. So profit must go up!"
Admin
TRWTF is the variable declaration on the bottom of the screen, everything that has "percentage" in it but is of type "String" can´t do much good...
CAPTCHA : sagaciter, a guy who cites sagas I guess
Admin
So what was Carl looking for really? Speed-up loops?
Admin
Hey, what's that whooshing sound?
Admin
TCP probably stands for Transaction Card Processor...
Admin
especially on the server side
Admin
This is a bad poke fun at someone who was just doing their job. As a consultant I normally reformat code the first time I am through it just to make myself comfortable with the codebase before I go making large changes. This post seem immature and childish.
Admin
Now I finally know why it's called PowerPoint.
Admin
"Charging your clients for making completely meaningless changes to their codebase" - Priceless.
Admin
as a professional coder I never make changes to the codebase just because I prefer a reformatted style, such selfishness causes untold grief when y6ou come to check the changelogs!
but then, this is what I expect from a consultant who doesn't have to worry about long term maintenance of his changes.
Admin
You can't make the changes without completely changing the original formatting? Boy, you're just a straight shooter with upper management written all over you.
Admin
Not priceless at all. Actually about $200 an hour.
Admin
Military colloquialism.
Admin
Admin
I love how those without any marketable talent can still find a decent living in this diverse world, by telling those who have lots of talent what to do. This is the kind of fair society we live in, and we should be proud.
Admin
This is why an experienced developer will always insert a speed up loop.
Admin
Everyone knows that more compact code has better performance.
Admin
...quite valid if profit is < 0 ...
Admin
I was once assigned to a project to start printing checks with magnetic ink. That way we could print our own check numbers instead of relying on preprinted stock. That gets rid of the headache of syncing numbers when line up pages are printed or printer jams occur.
And, like Dave Barry likes to say, I am not making this up; it was called the Treasury Check Printing Improvement Project. Yup, "TCPIP".
Admin
Admin
Funny, removing whitespace works wonders for the speed of many Javascript projects/libraries. If that's all you knew, why not start with what you know works in your favorite language.
I wish I was kidding.
Admin
I wonder if someone has made a minifier for compiled language sourcecode? That would be a real WTF.
Admin
It does improve the performance of people actually reading the thing, though: Less pointless scrolling, more useful text visible at a time...
Admin
No, Akismet, this is not spam. The link does not contain pork.
Admin
If you researched the problem, you would find that the JavaScript doesn't run faster just because it's been minimized; Minimized code takes up less bandwidth reducing slowdown for the client to receive it. Once the client has the code, both the minimized and normal code run the same.
Admin
Addendum (2013-11-05 10:31):
I imagine that's because Javascript is interpreted. You could also speed up just about every program run through BASIC interpreters back in the day just by removing comments (REM). Commodore's BASIC also had tokenizing of commands. Besides the well-known "?" for PRINT, you could type the first letter of a command and press shift plus the second letter. Commodores displayed graphics characters when SHIFTed in uppercase mode, so you'd see something like a heart or line when you typed that second character. Besides saving a little RAM, it ran faster. Another trick was to use "." instead of "0". I never got around to benchmarking this to see if it worked.I forgot to mention that you didn't have to have spaces in your statements, and you could string multiple statements in one line separated by colons (this also saved RAM and CPU). It's no wonder my parents were befuddled when you saw things like this on the TV:
10 FORI=1TO30:?SPC(I);">":NEXT
Admin
Admin
Admin
They say that a developer's code mirrors perfectly the ideas inside his head....
Admin
They say that a developer's code mirrors perfectly the ideas inside his head....
Admin
Actually BASIC keywords were stored as one or two bytes in memory no matter how you entered them. "?" and "PRINT" or "D(spade)" and "DATA" are the same thing. The trick was that every line in Commodore BASIC was limited to 80 characters (two lines on screen), so you could squeeze a few more on to each line by shortening the commands. Of course once you tried to LIST the code and edit it, every command was expanded again and it could wrap around to a third line causing all kinds of problems.
Admin
Sarcasm aside, I'd really like the OP to confirm: was the formatting the only change in the "optimized" version?
Admin
I remember reading about this, written by someone who claimed to have tested it, and apparently it was true.[citation needed][citation lost in the mists of Time]
The no-spaces thing wasn't universal across machines. IBM's PC BASIC (also Microsoft's GW-BASIC) had an assortment of reasons why you occasionally needed whitespace, such as this: The interpreter allowed (and would recognise as distinct) longer variable names than just two letters/one-letter-one-digit, and the tokeniser had to be smarter about chopping identifiers at the boundaries of tokens. So the line above would be tokenised as if it were: And it would fail at runtime with a syntax error. That, however, would work, because TOY *begins* with a token, so the token (TO) is correctly separated from the variable name (Y) that follows it.Admin
Admin
Okay let me check the commit history to see where that bug Tim introduced is coming from... AHHHH! FUCK YOU TIM!