IWETHEY v. 0.3.0 | TODO
1,095 registered users | 0 active users | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New Todays additions, mysql version.
(1) Code to the absolute mininum spec. Your website might be hooked up to mysql 1.0 at some point, so don't make use of any fancy features like joins and such. Just do all the complex data manipulation in your application code rather then on the database server.

(2)Many languages have a way you can escape keywords and special characters. Take advantage of that to embed them into the code. It won't stop a determined programmer but it's like leaving caltrops for them to stumble over, it slows them down.

One simple way is to create database tables with column names that are key words. If your using 1 from above, this won't get in your way at all, but will annoy anybody that comes after you if they want to add some SQL code.

(3)Index are overrated, particularly unique ones. Putting some sort of unique index on all tables just makes it easier to trap errors that you might be able to gloss over overwise.

(4)Personalize function names. JayPrint, DisplayBob and myFileOut are fine, particularly when you use the same prefix or suffix all over the place so it just makes function names longer and slighly more obscure. The fun comes when somebody else comes along and has to modify JayPrint, do they change the name or leave the now incorrect one?

This can be double effective when combined with mysql, where you can obscure the difference between mysql's database functions and the ones you created by starting all the functions you write with 'my'.

Jay
Expand Edited by JayMehaffey June 29, 2004, 06:35:56 PM EDT
New No, seriously, where are you sitting?
(1) Code to the absolute mininum spec. Your website might be hooked up to mysql 1.0 at some point, so don't make use of any fancy features like joins and such. Just do all the complex data manipulation in your application code rather then on the database server.
You have more control of it that way. Who are these nameless database developers to think they can write an optimizer that is smarter than hand-tuning the join logic in program code?

(2)Many languages have a way you can escape keywords and special characters. Take advantage of that to embed them into the code. It won't stop a determined programmer but it's like leaving caltrops for them to stumble over, it slows them down.
For extra credit, look ahead at the specs for the next major revision of your programming language. Note some nifty new functions that will be available and implement them. Use the same name, but not the same order of parameters.

One simple way is to create database tables with column names that are key words. If your using 1 from above, this won't get in your way at all, but will annoy anybody that comes after you if they want to add some SQL code.
Name a column 'date'. This can cause hours of joy. Or a table called 'user'. That's fun too.

(3)Index are overrated, particularly unique ones. Putting some sort of unique index on all tables just makes it easier to trap errors that you might be able to gloss over overwise.
Geez, that's what code is for. Sure, you probably don't ever want to entries in the 'user' table with the same username. But hey, you can't anticipate everything you may want to do in the future.

(4)Personalize function names. JayPrint, DisplayBob and myFileOut are fine, particularly when you use the same prefix or suffix all over the place so it just makes function names longer and slighly more obscure. The fun comes when somebody else comes along and has to modify JayPrint, do they change the name or leave the now incorrect one?
This is also good for directories. When developing on that live environment in a parallel directory, don't just leave your development code around when you're done: point the other live code into it! That way the directory that looks like it ought to be live is obsolete, and the 'bob_admin' directory is actually in production. Much fun when someone naively deletes the 'bob_admin' directory.

This can be double effective when combined with mysql, where you can obscure the difference between mysql's database functions and the ones you created by starting all the functions you write with 'my'.
All private methods must be prefixed with 'my'. Even though php4 doesn't support true private methods yet. So when you decide something that's prefixed 'my' really should have been public just start using it.
===

Implicitly condoning stupidity since 2001.
New Re: No, seriously, where are you sitting?
Name a column 'date'.

I've now run into applications pulling that trick in Access, SQL and mysql. A rather sad trifecta.

Jay
New Don't do that!
I've now run into applications pulling that trick in Access, SQL and mysql.
SQL is a standard database language. SQL Server, if that's what you meant, is a proprietary Microsoft product. Don't give them the term. They've already taken "the internet".
===

Implicitly condoning stupidity since 2001.
New Namespaces, fellas.
...they do work when used correctly. In other words, if your flavor of SQL won't let you name a column whatever you like, its implementation details are getting in the way of your design.

Reason #2147 for maintaining schema outside of the databases themselves.
New Dude, MySQL is not Oracle
===

Implicitly condoning stupidity since 2001.
New Dude, Where's My Cobb?
Regards,

-scott anderson

"Welcome to Rivendell, Mr. Anderson..."
New Not true
Namespaces, fellas.
...they do work when used correctly. In other words, if your flavor of SQL won't let you name a column whatever you like, its implementation details are getting in the way of your design.

That can't be true, because obviously there was no design to begin with.

And yes, there are ways to work around it. But why make extra work for yourself? I would much rather insure all column names are not key words and include no spaces upfront.

Jay
     I seem to recall this being shown before... - (folkert) - (14)
         "marypoppins = ( superman + starship ) / god;" :-) -NT - (Another Scott)
         Some additions based on recent experience - (JayMehaffey) - (12)
             Okay, where are you sitting? - (drewk)
             I18N is a lot easier put in at the beginning... - (admin) - (1)
                 Depends on if your providing real I18N or not - (JayMehaffey)
             Todays additions, mysql version. - (JayMehaffey) - (7)
                 No, seriously, where are you sitting? - (drewk) - (6)
                     Re: No, seriously, where are you sitting? - (JayMehaffey) - (5)
                         Don't do that! - (drewk)
                         Namespaces, fellas. - (FuManChu) - (3)
                             Dude, MySQL is not Oracle -NT - (drewk) - (1)
                                 Dude, Where's My Cobb? -NT - (admin)
                             Not true - (JayMehaffey)
             Wandering into madness edition - (JayMehaffey)

That'll be $8.50, Mac.
49 ms