- 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
I'm sorry, I don't see what's wrong with that brace style. Are you one of those people that prefer to put the opening brace on the same line as the if statement (Java-style)? I hate that... Or is it something else? Please elaborate.
Admin
Actually AS3.0 is an implementation of the (till recently scrapped - Thanks Microsoft) ECMAScript standard. If the standard had passed you would have started seeing Javascript follow.
Unfortunately, Adobe is now left with a proprietary scripting language to try and satisfy the demands of developers hungry for a "REAL" programming language.
For example: No anonymous functions No generics/templates No built-in collection structures (hurray, arrays! - sigh -) No Typed Arrays either.
Captcha: haero
Admin
The brace style follows the style used by many C developers... did you notice something I didn't?
Admin
His shenanigans are cruel and tragic.
Which wouldn't make them shenanigans, at all, really.
Admin
Steinbach's Guideline for Systems Programmers: Never check for an error condition you don't know how to handle.
Probably my most adhered-to guideline.
Admin
Seriously people stop talking about boring code stuff. I still want to know if "Lucy" is hawt. Could one of you post a description of her, her clothes etc so I cen decide.
Don't give away her identity though - there are some creepy people on the internet.
Admin
Admin
The real WTF is the break statement. If you truely want to sleep thru the night. Remove the break statement. It's only gonna create meaningless program fails and doesn't take into account that maybe the error isn't even relevent and really your user level security wan't needed.
Admin
That's amazing! I've got the same brace style on my luggage!
Admin
It's much simpler to carry over the mad skillz you learnt off C++, which is to say the syntax, and hang the rest.
95% of the residue who go down this path then fail at C# and/or Java.
Since they didn't learn anything in the process, other than that 30-year-old convoluted syntax is king, it's clearly important to preserve the little that they've picked up in five years of abject failure.
In the future, there will be one gcc to bind them all. It will only accept C++ syntax. The programmer will provide a switch to the flab between the AST and the back-end, such as --java.p94 or --cflat or --go_on__guess, and the appropriate language will be instantiated, before being knackered by C++ syntax and inadequate error messages/exceptions.
Actually, I believe Apache have been doing this for some time. As usual, they're ahead of the hyperbolic curve...
Admin
That's a witty and insightful comment. But I really only care about whether story contributor "Lucy" is a hottie. And you're just wasting bandwidth.
Admin
Admin
Admin
Now, I hope you're busy for the next few hours and leave us in peace.
Admin
Admin
However, I have it on good authority that she's not interested in a spotty little herbert like you.
Admin
Hey! I write advanced Machine Code for a living when I'm not mixing with the cool crowd in the achingly fashionable UK underground clubbing scene.
I bet you're the spotty one!
Admin
"He steals from the rich and gives to the poor, Mister Moore, Mister Moore..."
Admin
So I have a serious question about this particular set of code.
I certainly don't agree that all errors should just get thrown away. But there are a number of instances in my own code where I put a try catch block and don't actually catch anything. It's simply there so that if an exception is thrown, it doesn't go to the main error handler.
The reason I don't catch it is because I don't actually care if an error is thrown, in these circumstances it doesn't affect final outcome, and just means that parts of the data set don't appear in the final result. The data handler that receives the data doesn't expect a complete dataset everytime, it's built with the understanding that no data can be guaranteed, and it handles that appropriately.
In that case, is the empty catch block still a bad idea? What other methodology would handle this better?
It may seem odd to ask a question like this on TDWTF, but as I've been reading it over the past years, I've come to learn that the people who read the comments here are generally VERY good programmers, and people I actually look up to in many cases.
Any constructive critcism is welcomed of course.
Admin
FTFY
Admin
Honestly.
Not logging information relevant to the programming domain (as opposed to the application domain) is the single worst weakness I've seen in twenty years of server-side programming.
And don't fuck around with a database, a la NetView or IBM or whatever. Log it in unambiguous language, with a time-stamp and an optional qualifier (comms, user input, database, whatever), and spool the stuff out to a single log file. Not one for each program or task or whatever. Just one.
Log it. Log it. Log it.
(Also: catch all exceptions at the main() level and log them there. If you weren't interested, or couldn't work out how to solve it, in the first place, and it didn't entirely screw up what you were doing? Log it.)
Admin
I like how if the account type is private, this.username = this._data.username, but if the account type is shared, then this.username = this._data.username;
Quality code all around, really. (but then maybe the snippet is missing some detail that makes that ok)
Admin
...which makes them not really shenanigans at all...
(Evil shenanigans!)
Admin
Admin
Admin
Admin
This is where chicken nuggets come from, and also 95% of all ASP code.
Admin
The TRWTF is likely to be that Lucy is seen by management and other staff as being 'too slow and pedantic' while the other developer 'quickly gets the job done'. By the time it comes round to figuring out why the exception handling mechanism isn't working as it should Lucy will probably be handed the job of fixing it and told she needs to work faster this time cause there are deadlines to meet!
It reminds of a company I use to work for that practiced 'Agile' development. Basically what it meant was they did everything as quickly as possible. Design? No time for that! We have a (impossible) deadline to meet! Want to test that important piece of functionality? Testing takes to long! We have a (now even more impossible) deadline to meet!
As one of those developers that actually cares about those pesky things such as bugs and maintainability I was soon approached by the boss and told I needed to 'learn how to code better'. To add insult to injury, the boss got a 'senior' developer to 'mentor' me in the error of my ways.
Thankfully I resigned as soon as I could - the project in question was delivered 3 months late and had a huge bug count.
Admin
Apparently putting the second o in too takes too long as well.
Admin
It was either luck from your location or you get Kudos and +1 interweb for not using the .com TLD for google images. The brilliant admins at my work filtered only .com, while all the others work just fine. I prefer .sc for no particular reason.
Admin
It's the extra space in ElseIf. That's horribly wrong. Might not even compile
Admin
That's the single truest thing in this thread so far. I've only heard one plausible excuse for not logging an error, even if the system manages to recover by other means: that's when the code is running on a client machine where you don't have permissions to write to a log. That's it. For everything else, there's writing quickly logging to a file so that you can later tell what happened. It may be that you're disguising an easily resolved problem.
Admin
Wasn't there a restaurant called Shenanigans? It had lots of WTF's. Just don't return the food if it isn't right!
Admin
Admin
I use two kinds of Shenanigans: Frankincense, Myrrh... Three kinds of Shenanigans: Frankincense, Myrrh, Sandalwood... Four kinds of Shenanigans: Frankincense...
Admin
Ooo, fun with variants Try this : dim A, B A = True B = False if val( A ) = val( B ) then MsgBox("Shenanigans"); end if
Admin
Kleenex.com's choice of wording for the "Experience the release" menu smacks of all kinds of shenanigans as well.
Admin
And in my further experience, people who waste time commenting on TDWTF forums are the shittiest programmers of all.
</irony>Admin
Thank you for the Kleenex link! I laughed myself a cramp. I recommend taking the survey. It's the best part. Share how you feel!
Admin
I'm enjoying the Return of Alex while it lasts.
Admin
The braces in the code are a bit excessive and personally I wouldn't code it like that, but I do space out things in a similar fashion. Why is that bad? It makes reading it 10x easier. I've had to debug partner's code when it's all squished into like 4 lines and it's terrible, not to mention hard on the eyes.
Admin
Unless we're not talking about the same thing in terms of "brace style"?
Admin
A friend of mine once put this message in his program: "An unexpected error has occured. Hit any user to continue."
Later he was called be a user who told him: "I tried it, but it didn't work."
Admin
HVAT IS VRONG VITH BSD CODE STYLE!?
Admin
shenanigans could be a VB subroutine as such the syntax for the call would be correct. If a FORTRAN subroutine, the syntax would be 'call shenanigans' captcha : bene (gesserit?)
Admin
Even if it's for development-time only, you must not commit this code !
I use sometimes this kind of 'easy to find and replace comment' during dev but I never commit them...
Admin
The real WTF:
Lucy writes:
Admin
The real real WTF is that I didn't read the comments before posting about the real WTF.... :-)
Admin
What's more, a keyword-aware editor like SlickEdit can do some magic for you, automatically generating the braces, or showing you which braces pair up (assuming your indentation didn't already make that clear).