- 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
Edit Admin
The frist thing I noticed was the discrepancy between using
Convert.TodateTime(string)in one place andDateTime.Parse(string)in another. The only difference is that if the argument is null,Convert()returnsDateTime.MinValuewhereasDateTime.Parse()throwsArgumentNullExceptionGood bet the devs in question a) didn't know that and b) aren't trying to null-guard. They just hate being consistent in anything they do. Just like with their f-ed up naming. Maybe "hate" is too strong a word. Perhaps better said they're too haphazard a thinker to be consistent.
In terms of quality, haphazard thinking and software development go together about like water and electricity. In terms of commonality, it's more like peanut butter and jelly. Sigh.
Edit Admin
I was actually consider stop reading after Convert.ToDateTime but they lost me at ) with no CultureInfo in sight. At this point it really doesn't matter what the rest of the article has to say, because there's no coming back from that point.
Admin
I worked many years in a big engineering company, one with 100k people and B$ of revenues, where SAP was used to manage working hours in a decimal number format
Admin
To be fair if you are charging by the hour just keeping the hours logged rather than some sort of date structure makes perfect sense.
Edit Admin
I always say .NET's conversions should have defaulted to InvariantCulture instead of localized stuff.
Edit Admin
You hate Hungarian Notation, well, I hate Hungarian Notation and ASP.NET webforms. 😆
Edit Admin
Yeah, and InvariantCulture should have defaulted to ISO standards than some random local nonsense pretty much nobody in the world uses :-) But eh, .net is far from perfect by any means even though it is superior in many ways over it's direct and even indirect competitors.
Admin
Our old codebase had something worse than Hungarian Notation. Essentially instead of prefixing the variable name with a type abbreviation, the abbreviation WAS the name. So you get floating point variables called f and f2 and strings called s deep in the business layer. Some people also used Hungarian Notation for local variables on top of that. So you end up with descriptive names such as lsl for a local string list.
Incidentally the original concept behind Hungarian Notation was good. It was supposed to encode the "kind" of a value, not the type. For example you could have two ints: hMax and wMax. The prefixes standing for height and width. This makes a line of code like hNew = wMax look wrong, because it probably is. But people misunderstood this concept and thought the prefix should encode the type...
Edit Admin
There's the whole systems vs. apps Hungarian, but honestly it still just makes things cloudy. Even in your example:
height_maxis just a better name. I will grant, it's not entirely bad, if you look at the original paper, becausechar *could be either a string or a pointer to a single character, and you have no idea which. SoszMyStringfor a null terminated string does make at least some sense, but even then, a typedef is going to be my preference.In my ideal world, which isn't elegant in every language,
hMax = wMaxshould be a compile error, if I truly don't want to mix those types together.Edit Admin
I once worked in a startup where I had to use COM and OLE Automation and I still have nightmares from that.
The APIs were awful for sure, but the worse was the PHB who kept on my back with "but the MS regional sales manager said it was easy and <insert buzzwords with no relevant meaning>, so why aren't you done yet?"
Mostly because I had no spec and was working with a moving goal post that changed each time the boss was giving a demo to his VC friends.
Admin
The rant-to-lines ratio is big on this one. The lovely cherry on top is the simple one-liner that could have been used all along, although I get the creeping feeling it wouldn't clean the app up that much.
Admin
OLE Automation may be horrific to developers, but as a user it's incredibly powerful and useful. I once wrote a simple VB script that pulls some data from Access, does some mangling in Excel, draws contours of the results in Surfer, and pastes the resulting picture into a Word document with a suitable caption, all with a single button press. When you've got dozens of these to produce, it saves a lot of time and a lot of errors. And each tool is being used for the thing it's best at.
Edit Admin
I'm coming to like Hungarian notation just because it sets Remy off, and the results can be interesting/fun to read. As a programming thing, yes, I get the extreme distaste.
Edit Admin
As you've said many times before. What's weird here is that more than half of the article isn't you hating on HN, nor on the weird mixture of AHN (indicative of a weak type system) and SHN (indicative of a freight sect based on a misunderstanding of the original purpose of HN, that is, AHN), but rather the weird (in a more general sense) naming of certain of the variables and functions, and the cock-eyed history of Excel and 123 spreadsheet values.
But wart-only HN (as mentioned by Lukiko) is a mortal sin, whether it's AHN or SHN or some weird hybridised combination.
Edit Admin
This is making my days of FORTRAN seem relatively painless, in that the compiler allowed a maximum of six characters for variable names and function names. No one could waste even a single letter as a type prefix.