|
You've made a bad assumption yourself. Why is it just the "newbie's" write bad code?? I've seen more than a few so-called "professionals" writing bad code for bad reasons. Now THAT'S the sickening, yet amusing, reason why this forum exists.
Out of curiosity, do you stand outside the offices of "The Daily WTF" and protest their entire existance too?
|
|
|
|
|
No not at all. But this rubric is a little bit shooting on the little soldiers.
Even a professional programmer is little fisch.
Who never wrote a bad piece of code? Maybe in an 'emergency situation' If you see it out of the context it can be very strange?
For me a rubric like 'Horror Managers' , 'Horror Architect' is perfect possible.
Dirk
|
|
|
|
|
a.p@pandora.be wrote: Who never wrote a bad piece of code?
Everyone writes bad code at some time in their life. Most of us weed it out before it gets into a production environment!
|
|
|
|
|
a.p@pandora.be wrote: Who never wrote a bad piece of code? Maybe in an 'emergency situation' If you see it out of the context it can be very strange?
For me a rubric like 'Horror Managers' , 'Horror Architect' is perfect possible.
In other words, you're happy to pick on others but scared if it could apply to you ?
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
The first post on this forum, if I remember correctly, was from me, and the horror I posted was my own. Either way, when people write bad code, it's not 'positive' to look the other way, it's positive to examine it, discuss it and learn from it.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Christian Graus wrote: and learn from it.
Hear hear!
And this way many people can learn from one mistake. It doesn't matter who made the mistake as long as we all learn.
|
|
|
|
|
"That's the problem with a spell checker. It only helps with bad spelling, not stupidity." - Rob Graham
|
|
|
|
|
I came across this ORDER BY clause in a T-SQL view when I was asked to fix performance issues (command timouts) on a legacy internal application:
ORDER BY dbo.dt_Downtime.PU, CONVERT(smalldatetime, CONVERT(varchar, dbo.dt_Downtime.StopTime, 101), 101), LEFT(CONVERT(varchar, <br />
dbo.dt_Downtime.StopTime, 114), 5)
Then to add to the problem the WHERE clause of the query referencing the view looked like this after being concatenated together:
and CONVERT(smalldatetime,CONVERT(varchar,StopTime,101),101)>='2/14/2008'<br />
and CONVERT(smalldatetime,CONVERT(varchar,StopTime,101),101)<='2/15/2008'
Fixing these two lovlies brought the cost of the query plan down to 9 from 77
|
|
|
|
|
I've had to fix that sort of thing as well. In one case the program had been taking forty minutes to run and after I rectified it (and added a bunch of new functionality) it took only ten minutes to run.
The guy who had previously been maintaining it said, "It was like that when I got it, and if it ain't broke..."
The craziest part was that the code was doing:
and CONVERT(varchar,CONVERT(varchar,StopTime,101))>='2/14/2008'
and CONVERT(varchar,CONVERT(varchar,StopTime,101))<='2/15/2008'
(except in embedded RDB syntax, not T-SQL)
When I asked why it was converting varchar to varchar the response was, "The guy who wrote it said it wouldn't work otherwise."
|
|
|
|
|
Any idea what the point was with that? I mean, I know it's bad, but there must have been a reason for it...
I hope you replaced it with a stored proc with nice type-specific comparisons.
|
|
|
|
|
No body is around who ever had anything to do with writing the application. As far as I can tell from the code the idea was to sort by date then by time
If they had any other intent then they didn't do that right either because that's all that code does (The order by anyway).
|
|
|
|
|
Mark J. Miller wrote: No body is around
Well hidden I suspect.
|
|
|
|
|
how to zoom and pan an image using asp.net 2.0 with c#?? Or using AJAX in it.
|
|
|
|
|
You need to have a frying pan and draw the image on it.
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
you forget to mention to use a teflon-coated pan to avoid sticking.
(yes|no|maybe)*
|
|
|
|
|
And don't forget to make humming noises
Zmmm, zmmm, zoommmm , zoommmmm
codito ergo sum
|
|
|
|
|
damn, forget that...
like [do not post programming questions in this forum.] is quite difficult to read... or maybe it's a parsing problem
(yes|no|maybe)*
modified on Wednesday, February 20, 2008 1:57 AM
|
|
|
|
|
s_mon wrote: (yes|no|maybe)*
Maybe
|
|
|
|
|
Adwita wrote: how to zoom and pan an image using asp.net 2.0 with c#??
Get a chair with wheels. Next get an X10 adapter for little motors that you can attach to the chair, the rest should be easy enough to copy from the X10 SDK.
|
|
|
|
|
One my friends once wrote
<br />
int i = 0;<br />
<br />
while(i < 10)<br />
{<br />
i = i++;
}<br />
i laughed my ... off.
The fact that it makes sense, made it more funny...
-st0le [st0le'n'stuff softwarez!]
http://st0lenc0des.googlepages.com/
modified 20-Oct-19 21:02pm.
|
|
|
|
|
That's a subtle horror!
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
ever asked him, what that should do... and what i++ means... sry, i'm curious about it
(yes|no|maybe)*
|
|
|
|
|
st0le wrote: The fact that it makes sense
Makes sense in the fact that it compiles and does not break anything?
|
|
|
|
|
leppie wrote: it compiles and does not break anything
Two big qualities indeed.
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
Perhaps I'm being Captain Obvious but, in plain C at least, the result is undefined. The compiler I'm using at the moment does not leave the loop as i is never incremented.
|
|
|
|