Thread: Funny stuff
View Single Post
Old 25th October 2010
Carpetsmoker's Avatar
Carpetsmoker Carpetsmoker is offline
Real Name: Martin
Tcpdump Spy
 
Join Date: Apr 2008
Location: Netherlands
Posts: 2,243
Default

Wow, that sounds so familiar. I'm more or less in the same situation; The previous guy was hired especially for this job, university degree and whatnot. Worked for half a year, and then left. I left my old (crap-ish) job at the same company took over his.

At least your predecessor used functions
I think the first two weeks I *only* did code refactoring. There was no generic API for communicating with our Administration software for example, everything was just inline MySQL queries and such.

Making "GetArticleByNum()" functions and such really isn't that hard.

There was *exactly* one function: Find(), which is just a wrapper around strpos() which returned True or False (... And it is even a stupid function, using === would accomplish the same).
This was our *entire* API ... Even the MySQL credentials were just in a file which was included() ... Note that there wasn't *one* file, but this file was copied about 10 times to various locations ...

To make things worse: We only have one guy doing programming for in-house tools and such, so proper documentation and proper code is *even more* important because if "that one guy" leaves, all knowledge leaves with him.

Quote:
As a note, I say "query" because she used what I call the "magic model" style where you create a model of your db with some tool that read the db information and it creates class that magically select, update and insert information into the db. Personally I really hate tools that do this. I think if you don't know SQL enough to write these kind of classes yourself you shouldn't be writing application that interact with databases.
I have mixed feelings about these tools; Our old website used it for example, and it was pretty easy to interact with. The downside is that there is a lot of abstraction and it's harder to figure out what exactly is going wrong.

.. I prefer to keep things KISS though whenever reasonably possible ... But I can see the value in these tools though ... Assuming they are used properly though
__________________
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things.
Reply With Quote