- 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
"Objective-C. That’s not the WTF."
It might not be THE WTF, but it is A WTF.
frist
Admin
Given the off by one bug, I am actually frist.
Admin
Who knows, maybe it used to update some progress or status info in the past...
Admin
I can see why he may have thought it was a good idea -- because then it's easy to make the number of seconds variable when calling it. The two most difficult things in programming, of course, are cache management, naming things, and off-by-one errors.
Admin
Yes it is...
Admin
Best part is he shouldn't have typed the code in the first place. You can just specify the splashscreen storyboard in the project settings and the os would have done the heavy lifting.
Admin
He forgot to call
Application.DoEvents
!Admin
I always though somebody should define a non deterministic programming language that allows to write algorithms that tolerate by one error in both directions :->
Maurizio
Admin
TRWTF is the constant magic number 3: The time to wait should be loaded from a configuration file (XML of course for better enterpriseness) or perhaps selected from a database that is pointed to by a configuration file.
Admin
This could have been recast into any given language and the first few comments would still be people saying that the language choice is "the real WTF".
Admin
Not entirely true. There's actually a list of "WTF"-languages here. Every programming language not on the list is NOT a WTF.
The REAL WTF is that I needed FOUR tries to prove that I am not a robot. :(
Admin
It was supposed to be three times, but the counter was increased late.
Admin
so bassed on that list Malbolge would not be considerd a WTF
Admin
How could a language be considered a WTF if this beauty prints out "Hello World"?
(=<`:9876Z4321UT.-Q+)M'&%$H"!~}|Bzy?=|{z]KwZY44Eq0/{mlk* hKs_dG5[m_BA{?-Y;;Vb'rR5431M}/.zHGwEDCBA@98\6543W10/.R,+O<
Admin
I wanted to add it to the list, but found this: <!-- Malbolge belongs on the esoteric page --> So, I guess that means it has to be considered WTF as well.
Admin
That might have been done already -- google "failure oblivious computing"
Admin
So, by your statement, https://esolangs.org/wiki/Unary is not a WTF?
Admin
Instead if you want to achieve anything with that or like that you would store the start time, making sure the timer didn't return early and catching up with a new timer if it did.
What this code does instead is if you have some mega lag is to make your splash take a ridiculous amount of time. Lets say it's taking 10 seconds because of something bagging CPU somewhere for each timer to finish for example.
You can catch up from premature, not catch down from delayed. What this does is catches up on a delay. It's bad joo joo.
Admin
I also forgot, when you do it the right way, in which it only catches up on premature and as for overshoot just immediately goes to the next thing, you're now only one or two steps away from using the [animation frame/paint event/render loop/whatever] properly.
Admin
I forgot the other thing, my friend reminded me when pointing out == isn't good practice for safety. With set interval like timers (repeating) if there's a big delay they can all build up on the stack. It's implementation dependent but there's actually a possibility of the callback being called any number of times. In this case it wont be disastrous regarding the internal variable state unless count is used elsewhere but it can stack up count++ or exxentially loads of work for the CPU bagging it even more in a bad case.
Admin
Esoteric languages are not WTFs because no one actually tries to use them for anything useful. As such, one must simply marvel at the beauty of Hello World written in Shakespeare, Malbolge, befunge, grass, or even whitespace or Ook!.
If someone were to actually try to write real server code or use these languages in a real way in a corporate setting, then yes, it would be a WTF, and it would definitely end up here. But they don't, because it turns out that anyone smart enough to actually write a meaningful program in one of these languages is smart enough to not use them.
TRWTF is that our desire to make programming more usable for ourselves carries the downside that they are more usable for others, and the threshold for programming falls to people who are not smart enough to know why they shouldn't do certain things. No one has figured out how to make a language with a high intelligence threshold in order to work with it, but also great efficiency and accessibility.
Coming soon: a git extension that gives the user a computer science test before allowing them to commit.
Admin
How do you know they didn't want it to appear for four seconds?
Admin
How is it any easier to update the number of times you ask for a 1-second timer than it is to update the number of seconds you ask for in a single timer?
Admin
@isthisunique: This is a Cocoa timer, that is set to be repeating at one second intervals. The system will schedule the timer to run in one second intervals calculated from the creation of the timer (so it doesn't drift if it is scheduled after 1.01 seconds thousand times). If the system is so busy that the next scheduled point in time is reached before the previous one is executed, a call will be skipped. Exact timing can vary slightly to avoid waking up the CPU needlessly (the system will try to schedule multiple timers in close proximity).
There is no chance in hell that timer events build up on the stack. And there will be absolutely no callbacks after one callback invalidates the timer.
Admin
First shalt thou show the splash screen, then shalt thou count to three, no more, no less. Three shall be the number thou shalt count, and the number of the counting shall be three. Four shalt thou not count, neither count thou two, excepting that thou then proceed to three. Five is right out. Once the number three, being the third number, be reached, then lobbest thou thy Holy Hand Grenade of Antioch towards thy splash screen, who being naughty in My sight, shall snuff it."
Admin
+1
Admin
Bolches yarboclos