- 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
Not to mention the fact that row["clientname"] is used for <sessionid> as well. So if row["clientname"] contains "My favorite <client> name!" you can get a file name like this:
"My favorite My favorite My favorite <client> name! name! name! My favorite My favorite <client> name! name! 09 10 1998.XLSX"
Admin
What bothers me about this code isn't that this guy may or may not know about "newer" features like String.Format() or StringBuilder. The guy is clearly familiar with string concatenation as evidenced by the line that replaces <sessiondate>, so why not just use concatenation in the first place? Why is he doing a replace on a string format he defined?
Of course, that's a rhetorical question, because his code clearly shows that he's a crappy programmer, and this is the code a crappy programmer writes.
Admin
Admin
Well, this code might very well have been migrated from older languages and the string to replace might have been located in resources at some time.
And when migrating old code you many times do not try to rewrite it all to new specs but just enough to get everything to work, thinking that you can fix it up later (which never happens of cause ...)
Admin
Admin
You're right. A small hobbit is not going to be able to destroy it simply by throwing the One Ring into Mount Doom this time.
Admin
I can see a HR person not knowing when C# was invented (although someone with knowledge should actually be LOOKING at what HR is putting out there.) But I've seen places that required 5 years experience with Visual Studio 2010, and that was a year ago. You'd think they'd notice that something is wrong with that.
Admin
MORE DOTS!
Admin
Guess you got stuck on a waiting list to have your head removed from your Ass. The NHS and ACA have npthing in common. They couldn't be more different.
Admin
Once upon a time I was looking for a web development job and I was interviewed for a place that was looking for someone with 5 years experience in a web technology (I forget which one it was) that had only been around 2 years. I didn't get the job, I guess they thought I was too under-qualified with only 2 years experience in it....
Admin
I'm one of "the poor" and I do NOT want his Healthcare junk!
Admin
How do I make it a featured comment?
Admin
You fools. The proud C# developer has 15 mercurian years of experience, not 15 years of 365.25 days each.
Admin
When you don't have CMM level certification, code review is in non-existence.
Admin
Admin
code review is blasphemy to rockstar senior programmers
Admin
After reading this code, my brain feels weird. Does that happen a lot around here?
Admin
I thought your brain was dead, bro. Besides all that, the C# dude did not misuse regular expressions. I fear he is not senior enough, at least not in a level comparable to Nagesh.
Admin
I love how every says he replaces client twice, when he never replaces sessionid at all either. Unless TRWTF is using the client name as the sessionid.
Surely it should be str = str.Replace("<sessionid>", row["sessionid"].ToString());
not str = str.Replace("<sessionid>",row "clientname"].ToString());
Admin
Bollocks! Rockstar senior programmers can't wait to get a whole team of worshippers to read every byte of their limpidly lucid effulgence.
Admin
Admin
Admin
Admin
(Apologies to the other people who presumably said the same thing - I'm not going to read all the comments just to make sure and then come back to this....)
Just sayin....
Admin
Admin
IMHO the problem is that recruiters/employers think years experience is important...And remember the employer wants a better candidate than they'll get, and an employee wants a better job than they qualify for so:
One of the big problems in IT is that long term experience can be a bad thing - Technology moved on, and this guy didn't....while it could be that it's because he loves the old technology, or is the only person who understands it it's more likely that he's incapable of self-development....
Finally (before this gets too long) I think a lot of hirers/employers (in some respects I think that many employees/candidates don't either) don't really know what experience means - although it might be that they're trying to account for the fact that Jimmy will count his secondary school years where he was making footy tip programs at home...I would imagine most people peak in less than 3 years on a particular technology (they never know everything, but they increasingly know where/how to look for the bits they need that they don't yet know). Beyond that, they either plateau (because they realise they don't need to know absolutely everything) or fall aways (because they stop keeping up with advancements in new releases). One of the problems with Humans is that we're sentimental fools. I think it's inherent in our nature that we don't really believe a new way to do something is better....sure it might be quicker, less risky or more self-explanatory using this new-fangled way, but before you pups (who by the way don't understand the first thing about this technology) had this oversimplified mechanism created we used to do it differently - because we actually knew what we were doing...
Now get off my lawn!
Admin
Admin
Admin
In the IT industry, one should be aware that changes occur and improvements are constantly made, no matter what rank, "seniority" or otherwise. I see this error quite a lot in professors, too.
The real wtf here is that the author hasn't recognised that brains degrade naturally with age, and that he is probably doomed to the same fate. Hopefully he will choose the path of humility and forego the title of "seniority", to prove to his peers that he's not interested in discriminating by age.
Before I get lotsa "this butt-hurt, old man" comments, I'm twenty-five. I've worked along-side "seniors" (people who have served in the army, ex-teachers, programmers). They may be a bit hazy at times, but they have some interesting stories to tell, interesting lessons to teach and interesting ideas to share. If you're not willing to learn, then you're probably too arrogant to write software.
Lets learn from the past, and not repeat the mistake that is this article...
CAPTCHA: augue. I like to augue, in case you haven't noticed.
Admin
I also like to augue. There are seniors and seniors You can always learn from them anyway: from one kind you learn how to do things correctly, from the other your learn that you should not do what they do:
public static final int TWENTY_ONE = 21; //what the heck is this magic number?
... someVar = blah(); //someVar is not used anywhere else return someVar;
if (x == true) return true; else return false;
try{ //some code } catch(Exception e) { //too generic //nothing here. Not even e.printStackTrace() }
public class Blah { //6000 lines of unindented noisy code with lots of //deprecated comented code in between }
private List<Shit> someMethod(...) { // a thousand lines here return shits; }
new BigDecimal("1")
BigDecimal weight_of_john_doe = BigDecimal.GOOGOLPLEX; String something_that_could_be_enumerated = ...
// returns frist public String getFrist() ..
captcha "bene" - the are always our bene-factors
Admin
...all of this done in a verbose language with a monstrous ecosystem.
Admin
Btw, I can't see any part in this article say the code is written "in the old days".
P.S.: I'm pretty sure VS2002 is the first publicly avaliable .NET IDE, with beta released sometime around 2001 (I still have one beta CD I got from talk in the university).
Admin
Captcha: He's my haero.....
Admin
Admin
15 years experience should not be a problem...everything is still Octal...right???
Admin
I tink augue comes from lorem ipsum
Admin
The real WTF here is that there isn't a better way to do such replacements built in to the .NET library.
After all how hard would it be to have the previous look something like this:
string str = "<sessionid> <client> <sessiondate>.XLSX"; string[] rep = new string[3]; rep["sessionid"] = row["clientname"].ToString(); rep["client"] = row["clientname"].ToString(); rep["<sessiondate>"] = time.Day.ToString().PadLeft(2, '0') + " " + time..........";
str path = string.converge(str, rep);
Admin
Du-uh? What's wrong with:
... or whatever the damn format is of this language? I refuse to believe you need "ToString()" methods on what are very probably strings.
Admin
I worked for a BIG name company (not going to say any name but all of you know it) and exactly the same style was used instead of being C# it was Java and instead of using human readable <client_id> something like @c.
Just to note that it wasn't for backward compatibility reasons the "product" was brand new and String.format was an option ...
After I showed them a benchmark of the cost of String.replace compared to String.format they just replied that it worked well enough the way it is so no need to update the code ...
Oh well ...
Admin
Of course, they might be excused for conflating Windows 8 with Win2k8, which really was released about 5 years ago. I had fun with a job shop advertising for 5-10 years experience with Win95 in 1996. The pimp^H^H^H^Hrecruiter didn't blink when I explained to her how Windows 95 used to be called Macintosh... lusers LOL
Admin
Admin
I'm not sure about String.PadLeft but I'm pretty sure String.Replace and String.Format have been around since 1.0 (.Replace definitely has; what would you use otherwise?)
Admin
The point that most of the regular readers seem to be missing is that people will program in a format they're comfortable with.
When ADO .NET came on scene, there were multitude of programmers adding references to the COM ADO libraries and using them. I am currently overseeing one such project.
Admin
So admittedly, I reached my conclusion very lazily. I have no idea how to determine exactly when a feature was introduced, but I would have expected all 3 of those methods to exist in 1.0.
Admin
Admin
If anyone actually cares, below is one of the best (I don't claim it's the best!) ways to do this in C#. The real meat is in the last line, but I included some build-up code in case anyone wants to test it.
Matt, you are right in that ToString() is not necessary for the string concatenation of the values that are actually strings. C# will coerce them from the objects that the DataRow provides.
Admin
Exactly. When a company claims to have 25 Web Experience, this just means they were working on the web and its logical predecessors. Before gore createth the WWW (actually not gore himself, but bright men inspired by gore), there wert USENET, Gopher and other beasts of the field. A company that was spamming people on USENET and transitioned to HTTP could claim 25 years of web experience.
Visual C# had many logical predecessors, including Visual Basic and Visual C++. Visual Basic had a diverse set of logical predecessors, including work in Benefits Administration and/or Occupational Therapy. With retirement ages rising, resumes could plausibly list 40 years of experience in C#.
I see what I just did there. I agreed with registered Nagesh. Must. Rethink. Life.
Admin
I would suggest that J (a Java mimic for which Microsoft got sued) and Delphi .NET (a platform which Microsoft essentially stole by buying out the lead Borland developer) are probably better predecessors than Visual Basic. I'm far too young.
Admin
You were probably thinking of Microsoft Visual J++, which indeed was the Java clone for which Microsoft got sued.
Admin
I remember early on in .Net's life (2 years after 1.0 was released) having head hunters ask me if I had 5+ years experience in c#. For awhile I uselessly tried to let them know that the language hadn't been around that long; then one day I finally just said Yes to get past the crap.
Of course they like to "format" your resume over here before sending it on to the people actually doing the hiring. When I'd get to an interview I'd explain to them that, yes, I knew c# hadn't been around that long, and yes, I have no idea why the recruiter would put that on there while telling them exactly how much experience I had.
After awhile you don't tend to update your resume much. Just change a few numbers around, maybe add a couple more hot button terms. So, I wouldn't call this one much of a WTF.