- 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
junior devs arent qualified to frist.
Admin
Cannot be bad code. As we learned the day before yesterday, Some comments is better than no comments. And these functions have got a nice XML-Doc description...
Admin
Ouch! This hurts!
Admin
that holiday code doesn't discriminate between summaries; if the date is in the file and some summary comes after it (not necessarily on the next line) then it is a holiday
Admin
My question is why was a "Junior Developer" not being monitored closely????
What was happening during the daily standup/scrum?
What was happening during the review/retrospective?
To me that is TRWTF.
ps: Since these were in a ".txt" file, rather than in Source Control, were they ever used in production code?
Admin
Admin
What is this daily standup you speak of?
Admin
One presumes that they are held locally to this junior dev's machine, and when he wants to use such functionality, he just cut-and-pastes it into whatever class he needs it.
I've seen such practices used all over the place. It makes you want to chew your own leg off to get away. The arguments in favour of this egregious style are: "These are quick and simple and it's quicker to do this than to go hunting around for the class where they live -- and besides, I thought you said last week that globals are bad." And: "In case we find we want to do something slightly different in the location where I [strikeout]bodged[/strikeout] pasted it in, ..." etc.
The points about peer review and standup/scrum are still completely valid, and are probably indeed the real WTF.
Admin
However, if said software is a pita to maintain yet management does not recognize that and sets impossible-to-keep deadlines, looking for new employment is completely acceptable (more so if the developer inheriting the software is on a "performance related pay" scheme and suffers financially for missed deadlines).
But what if the blame game is not possible? I once worked at a place where someone in department "A" was tasked with developing a module for department "B" (my department). When he delivered what he called an "example of how you can use the library" that example was so bad, I flat-out refused to accept the "example" (and thus the responsibility for failing to make it work) and told him "You developed it. You make it work". Shortly after, the developer from department "A" handed in his notice.
And I definitely couldn't blame him.
Admin
Admin
Must be a very, very junior developer when he has not heard of DateTime.ParseExact(...)...
I read this is a book once: If you find a task hard to implement, spend 5 minutes to look at the framework documentation very closely.
Admin
Admin
Admin
(*) A minor WTF, duh, also known as WTF in A minor.
Admin
At least I learned to know a new language feature of C#: extension methods.
Admin
Don't you guys have some sort of code coloring? This looks like something an intern would PM and ask "what's wrong here" repeatedly afterwards. Captcha: dolor, which appropriately means pain.
Admin
Another exhibit for the Museum of Re-Invented Wheels.
Also known as, "A typical company's code base."
Admin
Admin
erm... a single line to overload ToString()... but then you'd have to copy the code from his function into your overloaded method to format it as he wanted, so really... its not 1 line of code at all.
And he could have added his own method as an extension method to string class anyway, which might have been better - especially if someone else had already overloaded ToString for other purposes.
I think the WTF today is the article itself, not the WTF.
Admin
Yaaay, free code ... I am adding this to my Project_Utils.vb :-)
Admin
A particularly complicated way of dividing by 6.
Admin
GetVat() is a gem too, with its hard-coded magic number for the VAT rate, because the VAT rate never changes and does not vary at all between countries.
Admin
Or different goods. Not to mention that WTF is this doing as an extension method?
You would need at least the following :)
IVatCalculator VatCalculator IVatCalculatorFactory VatCalculatorFactory MultinationalVatCalculator ....
Admin
Just found this unholy pile of manure in a core app of ours:
Indentation is as I found it.
Admin
Yes, I noticed that as well. the XML doc is completely empty.... That's a red flag if I ever saw one.
Admin
Any code in your codebase in a file named "Utils" or something similar is inevitably full of this sort of helpful code.
Admin
It's that daily "fifteen minute long meeting" that lasts from 8:30 to 10:00, where your pointy-haired manager asks for everybody's status and demands explanations of why everything is behind schedule.
The idea that there's (1.5 * number_of_team_members) manhours consumed on status updates daily doesn't ever occur to them as one of the reasons.
Admin
Admin
Admin
So, who wants to takes bets after reading those methods that the junior dev wasn't a bad/inexperienced programmer so much as he was sadist? I just hope Graham's coworker will choose not to carry on this painful legacy.
Admin
I think my favorite part is potentially splitting the "Summary" string 8 times when one time would have been sufficient:
Admin
and the hours wasted surfing the net and fucking around
Admin
Found in util_init_.py:
^^ Useful and good abstractions.
On the other hand... found in macros.py:
^^ I happen to know there's a justification for that thanks to the input interface, and that it never comes near a user, but still....
Yeah that was a bit painful to see. Cycles ain't free, dammit.Admin
What I can't believe is that Alex wasted all these beauties on only one article. He could have milked this submission for a week!
Admin
Seems like you're splitting hairs on this one.
Admin
Something to add, which has been proven time and time again here:
Dates and time are difficult. Look for library routines to do at least SOME of the work. You won't be sorry.
Admin
I don't deny that you are not wrong about that.
Admin
Admin
No imagine working on an app where the lead developer writes code like this, and where that lead has been working on that app from inception, for over ten years.
Welcome to my world. sigh
Admin
Admin
Admin
Most code is up from "smelliest shit you can imagine" (most like thoday's post and some worse) to "smells quite weird". After that we can rewrite again and try to get to "I quite like the smell of it, don't you?", except that we never will... either because we won't be satisfied with it, or because I'll move to greener pastures and forget this shit.
Admin
Tell me that you are not serious, or NOT a dev.
THAT.
Admin
I will never ever ever understand why do many programmers think they have to do so many things themselves. Why in the world do people think "converting from one date format to another", or "formatting 3223 as $3,223" is some super custom problem that needs their solving?
DO THE MATH. Almost every time something is along the lines of "this must be really common, I can't believe it isn't easier then this 50 line function" it probably is.
Admin
Admin
At my old job we had a project that was "way behind", and by "project" I mean "what the people in charge wanted it to be that day" and by "behind" I mean "past an overly optimistic date chosen by someone who knew nothing about nothing."
Anyway, we needed to get it back on track, so a daily 1 hour meeting was schedule for the first thing in the morning. When that, somehow, failed to get things back on track, a daily 1 hour meeting at the end of the day was scheduled.
Of course nothing changed between us leaving that meeting and arriving for the next morning's meeting, so every morning meeting was a rehash of the previous days ending meeting.
Somehow having a whole team spending at least 2 hours of their days in meetings about how to get the back on track, at least 1/2 of which were a spectacular waste of time, even by these-types-of-meetings standards, also failed to get it back on track.
The solution they came up with was to throw the main developer on the project under the bus and ask for more time to retool...which is why that's where I "used to" work.
Admin
The code snippet cited is also not good Python practice. It makes the function more difficult for users to understand and is arguably less efficient than explicitly defining a function:
(Also, the code violates the coding standards outlined in PEP 8, so it would likely be rejected if submitted as part of a standard module.)
Of course, since we've already imported the random module, we probably ought to just replace this with calls to
Admin
True and true - though I don't think anyone cares about PEP 8 around here since Python is usually just used for prototyping and glue. ... and
shuffles in-place so it's not quite equivalent.Admin
Its entirely possible they are told not to use the built in libraries. That used to be a huge problem for the Java libraries...
Admin
I tried ConvertToMoney, and it didn't work.
I am disappoint.