Wonderful code

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

User avatar
MrPotatoes
Forum Regular
Posts: 617
Joined: Wed May 24, 2006 6:42 am

Post by MrPotatoes »

Hockey wrote:I hate:

1) Functions longer than 80-100 lines
2) Classes with more than half a dozen (or dozen at most) functions
3) Stupid comments like (Initialize variable)
4) Non-existant conventions (MyClass mized with My_Class)
5) Complicated code
6) Inconsistent file naming conventions (Smarty.php, mysmarty.class.php, etc)
7) HTML mixed with PHP - excluding template specific logic
8) JavaScript mashed with PHP or AJAX hell
9) Cross frame scripting
10) Monolithic applications, poor separation of concerns, etc
11) Poor file structures

Although I usually get at least one thing (an 'oh good idea' moment) on every peice of code I work on, so I guess it's not a total loss.
This plu sthe lack of corprate structure is what i have to deal with at my job. i'm taking in ALOT from here and learning so much. even in the absense of the things that i want, need, love. so, when i launch my own company (hopefully within the next 1.5 years) i'll have all of this when i get the venture capital to back up the launch and hire people. lets cross our fingers.
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

Yeah, my last job had no structure whatsoever, and since I was just learning PHP, I took the advice of a woker there who had more experience than I did. He actally sent me an email once saying that this was a wasted call:

Code: Select all

<input name="foo" value="<?php echo isset($_POST['foo']) ? $_POST['foo'] : '';?>" />
And that it should be this:

Code: Select all

<input name="foo" value="<?=$_POST['foo']?>"
Because "PHP doesn't care if variables are set before you use them." Naturally, that's when I stopped taking his advice and taking the advice of the DevNetwork. I'd say it was a better choice. ;)
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

superdezign wrote:

Code: Select all

<input name="foo" value="<?php echo isset($_POST['foo']) ? $_POST['foo'] : '';?>" />
Yay for view helpers :)
Post Reply