- 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
i've used wrappers like this for localization (not WTF). overloading "confirm" was not an option.
Admin
On a similar subject, i found this little POS in an XSLT file today.....
<!-- This repayment fee --><xsl:variable name="rfval"> xsl:choose <xsl:when test="number(translate(key('bopsdata',concat('REPAYMENTFEE',$thisnum)),'£','')) = number(translate(key('bopsdata',concat('REPAYMENTFEE',$thisnum)),'£',''))"> <xsl:value-of select="number(translate(key('bopsdata',concat('REPAYMENTFEE',$thisnum)),'£',''))"/> </xsl:when> xsl:otherwise <xsl:value-of select="0"/> </xsl:otherwise> </xsl:choose> </xsl:variable>
i hate having to maintain this gash!
Admin
Admin
Admin
Admin
Yes. I agree entirely.
But I meet your sound reasoning and raise you "commented code". A comment like
/*
would have sorted it all out.
Admin
This is a trivial change, 200 places, 1 place or 10000 places. If it was a compiled language it would be optimised out by the compiler. The manual refactoring is the human equivalent of the same.
There's better reasons for not refactoring than the baseless worry that you'll alter the program's logic.
First commit: "Removed checkMessage(msg) method". Someone checks out. Second commit: "Refactored checkMessage(msg) to message(msg)." .... two hours pass, people check out or update their code, and all get red all over their IDE's screens, what, no such method? ... Two hundredth commit: "Refactored checkMessage(msg) to message(msg)."
Manager to You: What the dangnabbit are you doing? (if you have email notifications for each commit, you'll have the entire department on your arse).
Far far far far far better to commit all changes ONCE, with ONE comment. You show a clear and total misunderstanding of how versioning systems work by not knowing that your ONE comment is applied to ALL the changes so that you can keep the full history that you require.
Maybe if you work on your own per-developer branch, you'd get away with it, but I'd be livid that you would take 2 hours to do a 30 second commit. You'd still have to merge the results of all your commits into the parent branch of course...
I think the same, about you.
Admin
Admin
Saying that it is stupid is stupid ...
It night have been a wrapper function, that would display a DIV or something with a fancy form, but was removed after some revision / isn't yet done.
Would you rather change hundrets of onclick="confirm(...)" in separate HTML files, or ONE functions body?
Admin
Admin
Admin
not a wtf!!
Admin
this typically occurs when first there is a need of a wrapper function, then later on due to changes the added logic is not needed anymore and the wrapper code becomes the same as the available library function. Instead of updateing the function call throughout the whole system, the easy way out is just to leave the wrapper in place...
Admin
I've actually written very similar code, makes it possible to write proper unit tests