NYCPHP Meetup

NYPHP.org

[nycphp-talk] Transitioning from Beginner to Intermediate PHP

B.A.S. lists at nopersonal.info
Thu Jan 17 14:45:12 EST 2008


David Krings wrote:
>> Unfortunately, I still have a really tough time trying to work out the 
>> logic of what I want a script to do, and my code is pretty primitive & 
>> verbose because of that (I have to painstakingly step through each 
>> little bit of logic in order to wrap my head around anything).
> 
> Welcome to my world, you are not alone.

That's always good to know. ;)

>> What do you guys use when working out the logic of an application 
>> you're building? I'm guessing that would be some kind of flow chart?
> 
> What I do is write the commentary first. I write down each step that I 
> know or think needs to be done in the respective sequence. It isn't as 
> formal as a flow chart, but it does the same job: first think about what 
> you need to do and then do it. Of course there will be changes while 
> writing the code and when testing and fixing bugs, but that will happen 
> no matter what you do. If you rather make a flow chart, go ahead, but 
> you do want to add plenty of commentary anyway.

Commentary is paramount--got it.

> Well, I went through the odysee of IDEs and still plan on finishing my 
> review of all the ones that I tested out. My three recommendations are 
> LuckaSoft's EnginSite Editor for PHP, Waterproof's PHP Editor, and 
> NuSphere's PHPEd. 

Thanks for the thorough reviews; that helps tremendously!

>> Please forgive the numerous questions, but I'm 40+ years old and want 
>> to approach this professionally, not just be some hack who writes 
>> sloppy code for for beer & pizza money and doesn't care about the client.
> 
> Don't underestimate beer and pizza! I think the best approach is to 
> schedule a lot of time and come up with a few projects that you are 
> interested in. Then pick one, write specs for it, establish milestones, 
> create the outline (either as comments or as flow chart), then star 
> coding, and finally do a lot of testing. When you are done, take the 
> project and put it somewhere in the corner of your hard drive and start 
> over again. You will be amazed how much better you are now and how much 
> better your code is. I work on a project now for three years and found 
> myself in the position to write code for a task that I coded before in a 
> different context. I didn't use the old code, but created new scripts. 
> Turns out that the new ones are half the size, run more stable, use less 
> variables and flags, require less db queries, and are just much much 
> better designed and written. I ditched the old code and used the new code.
> And don't get hung up on creating something that isn't there yet. I work 
> on a picture and video archiver/viewer and there are tons available that 
> are probably much better than mine. But with that approach you will 
> quickly find out that everything was already coded before. Other than 
> that, I completed an MP3 archiving/player system, started a bug tracking 
> and CRM tool (was too big of a task for me), and spend some time writing 
> a custom CMS for eLearning, but quit the job due to budget cuts (the 
> feds needed the money for the useless wars rather than for social 
> services for children and families).

I'm not a drinker, but, yeah, pizza is not to be underestimated!

What you're saying here is key to what I've been doing wrong: When I'm 
working on a web or print design project I document & organize 
everything and I have very specific methodologies I follow (worked out 
over years of trial & error), yet when I work with PHP I tend to 
approach things in a haphazard manner--i.e. I just dive head-first into 
the code and then splash around wildly trying not to drown.

That's not good. If I want to do this professionally then I need to 
treat even test/learning projects as if they were the real thing, just 
like my other projects. Thanks for helping me see that.

> And by all means ask as many questions as you can. Ask tons of 
> questions. The answers that you will get will propel you to the next 
> level. I don't think I'd be on the level I am at now if it wasn't for 
> relentless asking on NYPHP Talk.

I absolutely will do that.

Regards,
Bev



More information about the talk mailing list