Everyone has their own style of writing code and doing things, but there are some pet peeves I've developed over the years, especially when I review other people's code, and I'm curious to know what pet peeves you guys have too.
Here are some of mine:
Just a quick thought:
- Commas at the beginning of the line instead of end. Not sure why this bugs me, but it does.
Columnar editing with variable length lines! Makes it easier, and of course ignoring JC's rant about punch cards.
- Sub-Selects when a CTE or Join will work
Working from bottom up, CTEs may not be the most readable options
- SSIS packages with a single Script Task and nothing else. My thought, just write it in VS, save it to an EXE, and schedule it as a Windows Task instead of adding the overhead of SSIS and SQL
Gives an immense power, packets creating packets, fully metadata driven, do it all the time.
- Spaces in column names. I generally try to use square brackets around my column names anyway, but I also always avoid using spaces in column names though not everyone else does
- Trying to use object oriented programming techniques within SQL. This comes from queries a few of my former colleagues (all Dot Net developers) used to write where they'd embed small queries into Views and Functions with their queries becoming a hierarchy of sorts. When troubleshooting I'd often have to dig 8-10 views or functions deep or more before finding where the table was actually used. A house of cards indeed.
+1, cannot object to that!
Anyway, not to sound like a stickler, but just a few things that always catch my eye
I assume most DBA's have a similar list of things that make them cringe, so just curious to see what's on anyone else's list.
Not being a DBA, no comment