- 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
The ones I found actually use "JavaScript" as a safeword. Go figure.
Admin
TRWTF.
Admin
CAPTCHA: damnum (I don't normally do this, but this is one is so appropriate ...)
Admin
+10pts!
Plus those out parameters need to be assigned to within the method call. So whatever you assign to those initialized parameters are going to be overwritten anyway.
Admin
Admin
Admin
I feel I should point out that 22,000 is not actually a range.
Admin
It would also be cool if it compiled all your projects to native assembly with NGEN, then deleted all the source.
You want procedural? Here, have some MSASM.
Admin
Obviously, the correct solution is...
Tuples + unpack ftw!
Admin
Then you find out the coder's bonus was tied to the amount of SLOC he created.
Admin
BTW, nice obscure reference.
Admin
I read that last line as:
and thought, "yeah, sounds about right."Admin
This one hits really close to home. Recent paraphrased error I had while tweaking some code:
Error: No overloaded version of method SomeMethod has 43 parameters.
I was missing one. :(
Admin
Admin
It was funny to read when it came out. It's even funny when clicking on the Random button on the site and seeing it. It's NOT funny when someone links to it from a one-sentence post and thinks they're so fucking clever to have discovered bbc.
You probably still use lmgtfy and think you're so damn clever.
It means in real life, you're an unoriginal hipster doofus.
Got anything to do with sanitizing inputs to a SQL database, etc.? Link to Computer Security. Got a nerd-project slow-ass turing machine? Like a minecraft logic circuit from redstone? Link to the one where it's some guy alone in the Alaska making a firepit out of rocks. Got a story about Guantanamo? Link to the one where they beat the password out of the guy with a wrench.
Fuck off. You're not clever.
Admin
Admin
Admin
Admin
Admin
Admin
Admin
Ah fuck it, I give up!
Admin
Admin
Admin
Admin
Admin
MATTERHORN!!! I'm telling you for last time stoping to be haking my acount!
Admin
That's why FORTRAN is such a wonderful language. Thank you for your continued support for an unfairly maligned language.
Admin
You don't know fucking shit, you prick.
Admin
SET ANSI_NULLS ON, eh? If we're to be droll about null, are in the camp of EF Codd or Chris Date?
Admin
I agree. We need to create a new class named "World" that everyone can put all their variables into. That way, we can have things like initrodeCounter and acmeCounter for "privacy".
That way, if Initrode and Acme are having a competitive war they can tweak each other's variables.
It would be the ultimate in globalization.
Admin
Admin
Admin
Glad I could help you realize just how bad globalization could be.
Admin
Yes, because
Is so mucht better than
Static classes are perfect for methods that can be easily grouped, but aren't (logically) part of a class/object.
Ofcourse in this example one could also argue that f() should be part of a class, but the function might be much broader than a specific class (e.g. fourier transformation just to give an example, but it might even be calculateTaxRate()).
Admin
Who doesn't have a static "Util" class in their code base filled with various static "helper" methods like your example.
Admin
Admin
As with scripture, no rule I propose applies to good programmers: they don't need them any more; they graduated. But the juniors we have to hire need to be banned from using static classes and instead forced, kicking and screaming, into OO. Otherwise they will never learn it.
I have seen developers with tremendous potential do .NET with static classes. It's like they're standing at the threshhold of becoming advanced devs, but they never take that last step. They just stagnate for years. It's tragic.
Take away the crutches and teach them to run.
Admin
Addendum (2011-09-28 16:02): In fact, the presence of a Util class is a huuuuuge warning sign that I'm gonna be teaching OOP in the near future.
Admin
If you have several methods that are related, lets say they interact with active directory, but don't require any kind of state, where would you put them?
EDIT: and don't say extension methods because that's just cheating.
Admin
Even if the original coder came from a purely procedural background (and I admit, I did, too), surely it should have occurred to them to wrap all of those into a structure, one would think.
If you have 45 'out' parameters in one method, if you don't at least wonder whether there is a better way pass around and manipulate stuff, you should give up and go back to being an enduser.
Admin
There is a static method called GetTrustedDomain(string) which returns a similar ActiveDirectory object for a domain other than the one the host is on, which will have its own ActiveDirectoryUserCollection and on and on.
Can your static methods compete with that?
If I want to look up a user in AD, I do this:
var user = ActiveDirectory.Users[username];
Now I have a user object and can do this:
foreach (var message in user.GetInbox().GetMessages()) {}
or
user.GetIsAuthentic(password);
Admin
Admin
Also comparing a rarely called AD search method to an AD service (what you've got) is like comparing apples and grapes, IMO.
Admin
Weird. I just learned about the 'out' keyword today while perusing a sample CS program for a library I'm using... and less than an hour later I take a look at TDWTF and there it is being abused.
I am not a programmer by trade - I'm an electrical engineer - and the programs I build are typically just user interfaces for machinery. I code in VB .NET using the OO techniques I learned in university for C++. VB 2010 plus WPF is great for my HMIs because it's straightforward and isn't a gimped up piece of crap like VB6 and WinForms.
In spite of my limited experience, this example makes me cringe something fierce. Seriously, just create a class!!
Admin
Cool story, bro!
Admin
If you are code in VB .NET why are you using CS program? Am I miss sumthing?
Admin
Hi Mort, is that you? How's your C#-written-like-VB6 coming along?
Admin