CodeSOD: Leading Development
by snoofle from The Daily WTF on (#RZB5)
H. J. works in a place where best practices are known, but bitterly opposed. You see, they have a lead developer who is more experienced than the rest, and it is his mission to show the others how things should best be done. Some of his finer resume-worthy accomplishments...
- He removed salted hashes from the database and stores passwords in clear text
- He swapped out the challenge-response mechanism and replaced it with sending clear text credentials in every request and reply
- The data-access and object-persistence NHibernate layers were removed and raw db CRUD operations were exposed directly to the internet via these clear-text passwords
- Set-operations (e.g.: delete-query) were replace with a select and then iteration over the resultant rows - each in its own session (race conditions, transactions: fuggedaboutem)
- No keys or indices were used in db tables as NHibernate would handle it, even though many tables have more than a million rows
- Mandatory helper classes log and swallow error and fatal exceptions, leaving them scrolling by on the lead dev's monitor, in case he has time to look at them (this way, the application keeps going and if anyone ever notices something didn't work correctly, they can go scrape the log files)
- To simplify things, every class and interface had its own namespace and if possible, assembly
- The build auto-increments the version number of all (changed) assemblies (e.g. just about every class) after each build and then commits it to SVN, pretty much guaranteeing merge issues
- Created a utility to auto-insert "useful" comments for names of public classes, and name, type and parameters of public methods
This is one class, directly from version control, that deals with Visual Studio solutions and projects. SVN history says it has had precisely one change in it's nearly decade-long life: the addition of the auto-inserted comment:
using System;using System.Collections.Generic;using System.Text;namespace CompanyName.Service.Common{ /// <summary> public Class - Project_Helper</summary> public class Project_Helper { }}
...and the code:
[Advertisement] Use NuGet or npm? Check out ProGet, the easy-to-use package repository that lets you host and manage your own personal or enterprise-wide NuGet feeds and npm repositories. It's got an impressively-featured free edition, too!namespace CompanyName.Service.Common{ /// <summary> public Class - Project_Helper</summary> public class Project_Helper { }}