|
|
string.Split() was available in framework 1.0 and 1.1 too..
|
|
|
|
|
But only with splitting on single-character delimiters, not multi-character (string) delimiters.
|
|
|
|
|
The split(string, delim) function from earlier VB versions is still available and accepts multi-character delimiter parameters.
|
|
|
|
|
Less subtle, and probably posted a thousand times:
bool b = whatever;<br />
<br />
switch(b)<br />
{<br />
case true:<br />
break;<br />
<br />
case false:<br />
break;<br />
}
Seen as PHP-Code...
This is completely unrelated, but it just came to my mind...
"Obstacles are those frightening things you see when you take your Eyes off your aim"
- Henry Ford
Articles
Blog
|
|
|
|
|
Sometimes I ask myself. What’s the real horror in this rubric?
The people that wrote the code or the people that are posting it and reading it?
I think the last ones.
Did you ever see on the internet a website where plumbers are smiling with the mistakes of “newbie’s” plumbers?
In my company we have a positive approach.
Dirk
ApTools.Net
|
|
|
|
|
a.p@pandora.be wrote: What’s the real horror in this rubric?
The people that wrote the code or the people that are posting it and reading it?
The posting people: you & your company, with your positive approach are indeed the proof.
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
|
|
|
|
|
And people like you ranting about people like us ranting about people like them are a horror on their own, too
|
|
|
|
|
Newbie plumbers don't learn plumbing from a book and then claim to be professionals worth the same hourly rate as properly-trained and experienced plumbers.
Plumbers and auto mechanics should have a horrors site for stories of what they find when a do-it-yourselfer's wife finally makes him call a professional.
|
|
|
|
|
...And posting the errors on the internet is the best way to make professionals from them?????
Give the newbies a compliment or flowers when they do something good. New programmers will be born
|
|
|
|
|
a.p@pandora.be wrote: Give the newbies a compliment or flowers when they do something good. New programmers will be born
When we get a paycheck for doing something stupid? I don't see it. You either do a good job because you see value in doing things well, or you don't do it at all.
But who is the king of all of these folks?
|
|
|
|
|
Give them a few compliments and new programmers will be born? What, no dinner first?
|
|
|
|
|
a.p@pandora.be wrote: In my company we have a positive approach.
Yes, catching such things in a peer review and enlightening the developer right then is best.
These stories tend to be about situations where that opportunity is gone, but the lessons may yet be passed along.
|
|
|
|
|
a.p@pandora.be wrote: Sometimes I ask myself. What’s the real horror in this rubric?
The people that wrote the code or the people that are posting it and reading it?
I think the last ones.
Did you ever see on the internet a website where plumbers are smiling with the mistakes of “newbie’s” plumbers?
In my company we have a positive approach.
Interesting point Dirk, but I think you are missing a bigger part of the puzzle. The whole point of the horrors is to learn and improve - what's the point of repeating the mistakes that others have made. Which would you rather:
1. a plumber who knows not to plumb the waste pipe into the water supply because he knows that somebody else did this and caused a lot of damage, or
2. a plumber who hasn't learned and ends up costing you thousands?
If you answer 2 then you are either lying or I'm coming round to replumb your house for you.
|
|
|
|
|
Imaging!! Imaging!!
Your brother, wife or sun comes home from his first workday. You ask him. "How was your day?"
and he answerd disapointed.
" I made a stupid mistake. You can read it on the internet in the codeproject site, it’s a site with 4,848,546 members and growing! "
This is real horror
Dirk
APTools
|
|
|
|
|
If they learned it was a mistake then it was good, but the problem is most codding horror stories/sites I look at are the ones where people "found" the code in a project they were working on and wasn't written by themselves/current coworkers.
I'm sure if the poster would have know the author they would just inform them of the mistake. Unless it is something so bad that you can't forgive so easily... IE causes someone who knows what they are doing weeks of work to rewirte the code for the "fix"...
Maybe is just because we coders are such bitter people and we must laugh at those lesser than us nah that never happens
|
|
|
|
|
a.p@pandora.be wrote: Did you ever see on the internet a website where plumbers are smiling with the mistakes of “newbie’s” plumbers?
Hm... after few minutes of search:
http://www.selfhelpforums.com/forumdisplay.php?f=88[^]
Construction Horror Stories Witness or heard of a Construction Nightmare. Rather it be construction, electrical, or plumbing, this is the place to tell us !
Mostly, when you see programmers, they aren't doing anything. One of the attractive things about programmers is that you cannot tell whether or not they are working simply by looking at them. Very often they're sitting there seemingly drinking coffee and gossiping, or just staring into space. What the programmer is trying to do is get a handle on all the individual and unrelated ideas that are scampering around in his head. (Charles M Strauss)
|
|
|
|
|
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
|
|
|
|