- 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
/* end of file / Yes, they had / end of file */ at the end of every file. But no #ifndef FOO_H sentinels on the .h files. Goooooo, consistency!
Admin
Admin
Also, what is this obsession with making sure your code will compile under any barely-ANSI C compiler that it might possibly ever encounter? Especially the /* comments */ all over the place.
Protip: C89 was twenty-four years ago. And C99 was fourteen years ago. (Even if Microsoft doesn't want to admit it exists.) If you're still using a compiler that doesn't handle // comments, even for the obscurest of microcontroller architectures, please kill yourself now. And start declaring your variables at first use (especially for loop indexes) instead of up at the top of functions.
In all fairness, the code I've been subjected to was last touched in 2005 (even though they're selling us the chip now), and had 8051-isms throughout it, including ensuring that all loop index variables were declared uint_8, and hacks to third-party code to deal with bank-switched memory. But then they had a big-ass god struct declared where a third of the contents weren't even referenced.
The worst was registers that take 6+4 bits to specify. So they keep track of two separate numbers (with the requisite 15-character names) and use them together in function calls. I think part of the problem was their fear of passing around eeeevil 16-bit values on an 8051. My code merges them into 16-bit constants using a simple macro, and lets the lowest level register access code deal with which bits mean what. And I also use the shorter register names that match what the chip datasheet uses. So 30+ characters become 10.
Admin
Admin
And now before you all start blocking your javascript and tracking pixels in fear of the spies, there are ways of tracking your web usage that you can't even detect.
Admin
No quack.
Admin
Don't forget Google owns many ad companies as well, like DoubleClick and the like. They have something like 98% marketshare in the online advertising business (between Google and Google-owned ad companies).
Between Google Analytics and Google's ad networks, that's practically the entire web...
Admin
No one needs autocomplete anyways.
Admin
This is why google-analytics is never getting unblocked from my NoScript.
Admin
Admin
Admin
let 0 = 1 #define 0 1 whatever you gotta do for this shit
Admin
Sorry, the behavior will be by design.
Admin
an evil comment is an evil comment, whether it's /* surrounded */ or //preceded
Admin
Someone please write a Firefox plug-in to block this evil thing!
Admin
I particularly liked the file transfer method of issuing an HTTP GET request, then looping through the response one character at a time and writing it out to a file.
That's clearly a pattern this person enjoys using, since their preferred method of merging files is to open each one, loop through the lines in it and append each line to a new file. (Also, we use a temporary file for this which we immediately rename to the name we want. Not sure what the temp file buys us here.)
Still, not a bad effort for someone who has obviously no notion that webserver logs exist but thinks they ought to, and also doesn't know much about programming or basic OS functionality, and apparently has no technically-minded friends. It's way better than SwampyCode.
Admin
Schubert Nosock?
Admin
But Javascript has closures, so you can pass an anonymous function that inherits everything from the existing scope as the setTimeout() callback; or if you need to simulate the effect of calling sleep() in a loop, you can pass a function that tail-calls setTimeout() with itself as a callback. It's a little clumsy but not a terribly huge pain.
Admin
What's so special with companyName that you need to check it twice?
Captcha: erat - it ought to be errat.
Admin
Admin
Computations that are so complex that they are effectively freezing your browser should not take place there.
Even if you are just coding for an intranet application you have no control whatsoever over the frontend client. The browsers behaviour can change without prior notice between two releases, and what worked in Version X does not necessarily need to work in Version X+1.
If you are developing for the great wide Internet, you are in even more trouble. Can you test your application on all possible devices? From high-end pc to low-end smartphone? With all possible versions of os for those devices? And all possible browsers? Probably not.
If that's the way you make decisions about the architecture of the software products you design/implement I hope I will never come across one of your solutions.I have nothing against rants about shortcomings of programming languages, but if the rant boils down to "I'm doing it wrong and the language doesn't support me properly in doing it wrong" then go away.
Admin
Admin
thats going to burn mobile phone batteries, perhaps literally
Admin
Did Hanzo get assassinated, thus saving us all?
Admin
Don't forget Google Analytics has a pile of tricks that a webmaster can do so that all links go through them as well. NoScript actually implements workarounds so websites don't break if you block GA. Nasty nasty.
Admin
Admin
Don't tell me they've taken the advice oif the commentors and decided not to post because they haven't got anything worthy.....
oh wait, it's probably Thanksgiving or something....
Admin
Admin
Admin
I think the easiest way to gather form field IDs and stuff is secretly submitting the user's autocomplete information to the almighty enterprise right out of Chrome whenever a form is filled and sent. As data is sent anyway, users will hardly notice if what they entered is actually submitted twice. Scripts like this explain why loading certain web pages takes forever even though there isn't much content. This is not what the web was supposed to be or become. They could have used an array at least instead of chaining up thousands of Boolean operations. Hilarious.
Admin
TRWTF is it is written in disjunctive normal form, easily corrected by rewriting in conjunctive normal form.
Admin
Yeah. Testability is overrated.
Admin
Love that you pointed out that he was wrong but gave no information as to why it was wrong. Just that he should go away. The least you could have done is also provide solutions that you deem right. Then someone else can come along tell you you're wrong and the cycle of comments can continue.
Admin
This made me laugh out loud. Thanks to Remy training me to look at the source every time not to miss half of the WTF, I very well remembered this comment in TDWTF's own site:
Admin
This looks and sounds like LeadLander.
Admin
Admin
Or is that not what you meant when you said "pass a function that tail-calls setTimeout() with itself as a callback"?
You've no right to tell me what I should or shouldn't do in the privacy of my own browser. Next you'll be telling me that the browser isn't an operating system and Google shouldn't be selling Chromebooks. Great, I'll call the wahmbulance right away.Admin
Yes, it should inherit everything in the method, even if it's declared after the the method reference.
Admin
FTFM
Admin
Admin
function test() { var foo = "hello world"; setTimeout(callback, 1000, foo); }
function callback(foo) { alert(foo); }
test();
Admin
Admin
Does this code comes from Google Analytics? I don't see it connected to GA, but the article text seems to indicate that...
Admin
The really worrying thing is that the script has not changed, and I've just been asked to add it to a website! No way is that going on our website!!