- 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
WHOOOSSSH
Admin
ALL YOU N00BS CRITICIZE TEH CODEZ BUT LACK THE MOTIVATION TO DO IT RIGHT.
THIS GUY COULD BE THE COMPANY ACE BY FIXING EVERYTHING AND IMPROVING RUNTIMES
Admin
care to elaborate on that? i thought OP was right "Object.Equals", as implemented in the Object class, checks if two references point to the same thing. obviously if it's overridden it's different. is that not right?
Admin
Admin
That is right. But if you're actually using Equals() you should already have it overridden, unless all you care about is a referrence check. But in that case you should use ReferrenceEquals().
Admin
(a WTF-worthy lcase() if I ever did see one)
Admin
So, only interns were working on the Java projects?
Admin
Agreed. 2 instances with the same memory address and different values. Somebody's smokin..
Admin
TRWTF is languages that force the BaseBean antipattern on you
(C#, Java, etc)
Admin
Admin
I'm increasingly thinking most of these comments should be ignored by everyone
Admin
It could.
Admin
2 instances with the same value and different identities are equal, but not identity-equal.
Admin
Other than the staffing ratio (which is all too common) this code example isn't all that WTFy really - at least not by the standards of stuff I've frequently been exposed to (which has been orders of magnitude worse).
Surely all developers have inadvertently re-written the odd built-in or common function in one language or another, especially at the beginning of their career as these interns seemingly were.
It's easy to misuse foo.Equals() in C# as can be seen in confusion on this thread, even Microsoft's own documentation doesn't do a great job of clarifying the functionality - although there are better explanations elsewhere. Sure the code wasn't brilliant, but it's easy to follow. Also worth nothing that Microsoft explicitly encourage people to override the Equals method to suit their needs in the MSDN documentation.
Admin
Aeron chairs, so THAT's what theyre called...
Ive sat in those for the last 3 years and absolutely hate them!
Admin
[quote user="Georgem]I'm sure it does work. Whether it indicates that the development team are using the best tool for the job or not is another matter, though. [/quote] Development team? You mean the new guy and a couple of interns?
Clearly the Macs were a vital tool used to minimise the chances that the "managers" would be able to touch the code. You think it was bad? Imagine if those guys had had Visual Studio installed. :)
Even ignoring exaggeration, it seems likely that this was one of many companies that were marketing-heavy and product-light. And that can work, as long as your target market is the same sort of company because those guys don't care about whether or not your product works, they just care about whether or not it makes them look good to their equally smart boss. But you don't need a lot of developers with appropriate machines in order to build a product if you don't care about the product working.
Admin
They seem to have a catastrophic failure rate, I count myself lucky to have one in the office that can even stay upright (as long as I don't actively lean back on it). The design of the element which is supposed to support the small of your back is pathetic - difficult to adjust and detaches easily.
I've sat in many better chairs that cost around 10% of the price.
So now we know - it's the CHAIRS that are the real WTF here!
Admin
And ... on a separate point (at the risk of turning into a comments whore) ... MacBook Pro's make excellent development systems, I've seen plenty of .NET only developers use them, never mind cross platform developers.
They are some of the best portable hardware around, and handle running multiple VMWare instances well.
I use one for development as I develop on Win, Mac and Linux with in a range of languages - including C# on Windows, Mac and Linux. It's also the only practical way to develop cross platform software in C# if you are intending to deploy on Mac OS X, as you can't get Interface Builder for any platform but Mac OS X now.
Of course just because you are using C# doesn't mean you are using Windows. It's a good language, and ISO standard and enjoys solid cross platform support thanks to the efforts of the Mono team.
Admin
Agreed. He can fix that mess, improve software quality, get a raise, write no documentation and hold all the managers hostage to his will. And pretty much run the company himself. Muahahahahahahaha~!
Captcha: similis. Too damn close to a well known STD.
Admin
Admin
Admin
Admin
Admin
Admin
This is the kind of WTF where the perp needs his face pressed against a wall with the words "COMPUTERS WEREN'T INVENTED YESTERDAY" printed on it.
Admin
Admin
Oh, I don't know...
http://www.dell.com/content/products/productdetails.aspx/xpsnb_m1730?c=us&cs=19&l=en&s=dhs&~ck=mn
Not shiny, but manly looking in a gamer kind of way I guess...
Admin
So, in other words, what he said was technically correct, but you felt the need to say he was wrong, anyway?
Admin
Heh, sounds a little like the last place I worked at... Practically everyone BUT the developers was a manager.
They have probably outsourced all the devs by now...
Admin
TRWTF, as far as I am concerned, are the macbooks.
I have a friend who does development on a macbook, the thing SUCKS as far as i am concerned. Where the F are the page up / down keys? WTF is up with that HUGE over-sized touchpad? Then I tried to do a right click...oh...right...no right button. I could go on...
You could not pay me enough money to work with a mac-anything.
Admin
In C#, all that behaviour is overridable. My understanding is that the behaviour for reference types should be:
== : reference equality .Equals() : value equality (excepting object, which has no value except for its reference)
And for value types (int, string, double, etc):
== : value equality .Equals() : value equality
Any overrides you implement on your classes should follow this pattern, or you risk confusion for other programmers using your code. But the point is that you don't have to. You can overide the =='s operator to always return false (try debugging that).
Admin
Implementing your own 'Object.Equals' is not as stupid as it may first appear. I once built a class that compares objects by serializing them then doing a byte comparison to determine if two distinct objects contain the same data (which Object.Equals won't do). It proved very useful for unit testing.
Which reminds me...I once worked for a company and during the first week I was introduced to the senior dev. and he showed me his project estimation for the first project I would be working on. I noticed there was no mention of testing so I asked him why unit testing was included. He responded: "We don't do unit testing here because it takes to long.". You can guess how the project went...
Admin
I think it's actually assumed that you will override .Equals(), as a standard interface for evaluating object equivalency.
As opposed to operator== (which is called based on the type of the object in the current scope), calling .Equals() always calls the implemetation of equals of the instance type of that object. i.e. the .Equals() implementation of the sub class, rather than the super class.
Sub s = new Sub(); object o = new object(); object o2 = s;
s.Equals(s) // calls Sub.Equals() o.Equals(o) // calls Object.Equals() o2.Equals(o2) // calls Sub.Equals()
s == s //calls Sub.==() (if it exists) o == o //calls Object.==() o2 == o2 //calls Object.==()
When you do override .Equals(), the compiler will throw up a warning suggesting that you also override .GetHashCode() (if you haven't already done so).
If o1.Equals(o2) is true, then o1.GetHashCode() == o2.GetHashCode() should also be true. See the spec.
Admin
Hmm sounds rather like my employer, Grunts are outnumbered by managers 2:1.
Admin
Admin
It would make sense if the forum software threaded posts (and "in reply to 123666" doesn't count) - it would make it obvious which post you were replying to without needing to provide context manually, and you'd be free to only quote specific parts as and when necessary. But this forum doesn't do that.
Admin
Admin
I think it's asthmatic.
Admin
Admin
The first project I was assigned to when I started here was like this. It was originally given to the lowest bidder, who promptly fucked it all up and so I was hired permanently and told to fix the mess. The only thing was the deadline was fast approaching. The thing is still a clusterfuck of hellish, hackish, terrible code - but At Least It Works™, and that is how I work today!
Admin
Which is miles better than Flemish.
Admin
[quote user="WebDevHobo"]People, there is more to programming than just making it work. [quote]
Ahhh... the exuberance of youth. Yes, Spring indeed has sprung!
Admin
np: Moderat - Porc#1 (Moderat)
Admin
Admin
Admin
Obligatory hatred of fonts where 1 is identical to l (blockquoted code in the article).
Admin
TRWTF is that Frank didn't figure out in the interview that the interviewers were idiots.
Admin
TRWTF is that if they extended this to certain numeric types (e.g. whatever the C# equivalent is of Java's BigDecimal) this would be different from equals, because compareTo is not necessarily consistent with equals. (The canonical example being a fractional number that remembers precision - (4.00).compareTo(4.0) should return 0, but (4.00).compareTo(4.0) should return false.)
Admin
Admin