Chris McGrath’s Blog

Just another Developer’s Blog

Posts Tagged ‘Rant

SQL Generators

leave a comment »

SQL Generators are known for how many brackets they love to put in. So many in fact it made a simple query hard to understand.

Like most professional developers I don’t spend too much time using generators, I much prefer to write the query myself. And I generally stay away from DataSets completely. But today I had to paste my SQL into a query in a DataSet, and I noticed how Microsoft had tried to optimise the Builder so when it reformatted my SQL it didn’t have so many brackets.

The problem was it removed the useful brackets and added useless ones.

Here’s what I entered…

(x1 = x2 AND y1 = y2) OR (n1 = n2 AND m1 = m2)

And here’s what it optimised it to…

(x1 = x2) AND (y1 = y2) OR (n1 = n2) AND (m1 = m2)

How completely stupid! The main reason anyone adds brackets in SQL is to make the order of operations absolutely clear. Yet it removes those ones and adds sets around single statements.

The query might be correct but a human has trouble – not everyone knows the order of operations with booleans.

Written by Chris McGrath

August 31, 2009 at 4:16 pm

Posted in Blog

Tagged with ,

The worst thing about Batch files

leave a comment »

Date manipulation. So very painful. Not only do you have to do the annoying string manipulation dates are made worse by something else – stupid formats. I’m Australian and I believe in the 2 logical formats for dates day-month-year and year-month-day. It makes sense – smallest unit to largest unit or largest to smallest. But then there’s the American format of month-day-year. Seriously how does this make any sense to anyone? why not we change general numbers to act like this, 842 can become 824 (hundreds-ones-tens).

Anyway, it’s this fact which makes it really annoying. The batch date doesn’t allow you to enter the format you want it outputted as. So if I extract the values to a day, month, year variable then put it on a computer which doesn’t have the same format it doesn’t work.

Luckily we now have Powershell which allows us to manipulate objects instead of strings. Thank you for logic.

Written by Chris McGrath

July 28, 2009 at 12:59 pm

Posted in Blog

Tagged with

To anyone distributing an installer online…

leave a comment »

Please don’t call your installer Setup.exe. It might be fine when initially installed but people will forget what it contains within a week. And clearing out your downloads folder is really annoying when you have no idea what an file is. This especially goes out to the Microsoft Virtual PC team.

Written by Chris McGrath

July 13, 2009 at 3:23 pm

Posted in Blog

Tagged with ,

Don’t reuse the class name in a property name.

leave a comment »

Seriously this is something that always annoys me. It make the code…

  • Less readable – I can’t see how anyone can argue person.PersonName reads nicer than person.Name.
  • Less consistent – unless you put the class name in front of every property.
  • Harder to search – Best Example is on WinForm’s Form. So many times It has taken me forever to find the Form’s Border Style. Why? Because I look under B and they called it FormBorderStyle.

The biggest offenders seem to be ID properties. I think it’s because in a database the standard seems to be to call IDs ‘PersonID’ or ‘EmployeeID’ and that’s fine – just don’t blindly copy it across to the object definition.

Written by Chris McGrath

April 28, 2009 at 5:32 pm

Posted in Blog

Tagged with ,

Can we stop using the term “Next-Gen”?

leave a comment »

Why are people still refering to Xbox 360, PS3 and Wii as “Next Gen”? Each console has been out for over 2 years.

And it’s not just the consoles which use this term, Apple are saying their computers have “Next-generation Intel processor”.

Let’s get back to basics and refer to “Next-Gen” for stuff that has not come out. If it is out, it’s current gen. If “current” isn’t exciting enough for your advertisements use “new” or “latest”.

Written by Chris McGrath

April 21, 2009 at 4:16 pm

Posted in Blog

Tagged with ,