snoofle

After surviving 35 years, dozens of languages, hundreds of projects, thousands of meetings and millions of LOC, I now teach the basics to the computer-phobic

Oct 2015

Leading Development

by in CodeSOD on

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:


Filing Data

by in Feature Articles on

Databases are wonderful things. They help you organize your data at multiple levels. Large logical units of data are stored in databases. Smaller logical divisions are stored in tables, and individual records are stored in rows. Once you have your data stored like that, you can access it in all sorts of wonderful ways.

Meertens6

Of course, there's more to it than that. Beneath the database is the file system. Beneath that, there are one or more drive arrays each with one or more disk drives, each with one or more platters. Read/Write heads move back and forth to access the data on those platters. All sorts of sophisticated mechanisms have been developed to minimize the dead time of having a head in the right place, but waiting for the platter to spin the data beneath it for retrieval.


A Handle on Events

by in CodeSOD on

As developers, we try to write software that will be helpful to our users. Sometimes, we'll do key-by-key examination of what they're typing to do auto-complete. Sometimes, we'll look at a type-field entry to display the relevant subset of subordinate fields to be entered. Sometimes, we'll even try to coalesce error messages so that the user gets one message with a list of mistakes as opposed to one message per mistake.