GEEK RANT - Repeatative coding

Marc

Well-known member
OK just had to get this out...... Decided on coding a backup solution for my databases on the server, for no other reason than its somethin to do. SO basic idea is I will connect to server via SSH mysqldump the database with gzip and a date stamp, download via sftp and will be run on a daily basis automatically as a service on windows.

So like any coder, why reinvent the wheel right? So looking for what other people have done, particularly with connecting to SSH and running commands. When finding an open source jobbie I find that someone has hard coded port 22. Worse than that they have not even put it in a constant and reused it, they have added it a hundred or so times!!

Now I decide Im gonna do some stuff for work as Im peed off with it now and I'll look at it later. So opens a project that is from a coder who used to work with me only to find the following:

  1. Connect to database
  2. Fill recordset
  3. Load into grid
  4. Set filters
  5. Record success in database
A 10000000000 times ~(or it felt like it lol )
What on earth is wrong with "public function fillGrid(connStr,gridView) returns bool"?
What is wrong with constants?
As someone learning php and the likes at present I can understand someone not knowing what they are doing a little. However what I cant understand is why someone would not do something fundimental that stops them repeating the same things over and over and over again.
Rant over LOL
 
Is this specific to XenForo software/code or is it a standalone solution?

Will this be an add-on for example?
 
First one is for backing up my xenforo database to my windows machine (windows app) which will probably release if others want it. Second completely unrelated ... Over all, just a rant about bad coding LMAO
 
PHP has a LOT of bad coders. Don't want to sound bad but there are a lot of people making add-ons for XenForo who learnt their stuff with vBull so have no real knowledge of proper OOP coding within XenForo. Some of the larger mods are very much procedural in code design.
 
Top Bottom