Page 1 of 1

Experienced coder, new to php, theory and design question

Posted: Tue Feb 02, 2010 11:56 am
by dev_php_11
Structured and organized code, for scalability, reliability, and re-use reasons, should be obvious. I have begun a little php on my free time away from c++/directx (game programming) and had a few questions on how to structure a certain project.

I realize there are numerous frameworks out there (cake, zend, etc.). I've never thought to use MVC for web programming, but that seems to be the norm. The question is, should I use a framework already made, tested, and re-tested, or create my own?

I realize frameworks have tested classes and libraries that will help with both security and fast-production deadlines. On the other hand, you have to learn the framework when time could be spent learning how to code your own php framework from scratch. Here lies the tradeoff.

Perhaps if I put the application into perspective it will help make some sense:

Stock market investment simulator

While it's not a MMORPG, and since I don't know much about web programming and database queries using the web, I was curious as to how you would go about scaling something such as this.

It doesn't seem like it would be heavily intensive as far as bandwidth or requests go, but it would need the potential (someday) to be able to handle many simultaneous "contestants" that might be logged in and viewing their portfolio at any given time.

I'm asking for suggestions on design patterns, frameworks, potential problems, etc. I realize that security is a big issue for web projects, and I'm questioning whether I spend the time to learn it (months, years?) or spend a shorter amount of time learning an already-built framework that has been tested again and again.

This is NOT a "how do I create..." thread. I'm asking about theory and implementation. Thanks.

Re: Experienced coder, new to php, theory and design question

Posted: Tue Feb 02, 2010 12:03 pm
by pickle
If you're new to PHP, I would strongly recommend against using a framework, and strongly discourage you from thinking your first project isn't going to have massive flaws.

You should follow the old adage of "learn how to do it the hard way before you learn how to do it the easy way". While that may be a load of bunk for physics & math, it's actually quite apt for web development. If you just learn a framework, you'll a) only learn that framework - what happens if you're in a position that doesn't use that or any framework b) not understand the underlying ramifications of using a particular framework widget. You may end up using 4 massive widgets because it's easy, but the performance hit could still be huge.

Re: Experienced coder, new to php, theory and design question

Posted: Tue Feb 02, 2010 12:11 pm
by dev_php_11
Thanks for the quick response.

What about quick-development? Many of these frameworks announce huge cuts in dev. time because of pre-packaged "grunt work" that's already done. Would it be beneficial to learn something that's standard in industry, or is the industry based around it's own framework?

I see what you're saying though. Coming from a game dev background I deal with "game engines" day in and day out. At the end of the day it's like you're relying on a dev package to do the work for you, and you spend more time learning function calls rather than writing code.

This excludes very, very low level wrappers (like putting input/output code into a class, how to blit to screen, etc.), because low level wrapper layers are basically what I would write on my own, but generally bigger engines are more for the "newbie" in which they try to sell you a body for a car with nothing in it.

Re: Experienced coder, new to php, theory and design question

Posted: Tue Feb 02, 2010 12:15 pm
by dev_php_11
Addition:

What bothers me is when you have to handle customer data on your web server. How can you ever code "good enough" so that you trust your work and know that your customers' data is safe?

I hate being trusted because I would feel as though I would not know something or forget something. It's easy with a team because you cross-check each other, but individual development seems to be far too ambiguous to take something such as that alone.

I'll take non-network programming (tools, interfacing, etc.) to web programming any day! haha.

Re: Experienced coder, new to php, theory and design question

Posted: Tue Feb 02, 2010 10:35 pm
by alex.barylski
If you're new to PHP, I would strongly recommend against using a framework, and strongly discourage you from thinking your first project isn't going to have massive flaws.

You should follow the old adage of "learn how to do it the hard way before you learn how to do it the easy way". While that may be a load of bunk for physics & math, it's actually quite apt for web development. If you just learn a framework, you'll a) only learn that framework - what happens if you're in a position that doesn't use that or any framework b) not understand the underlying ramifications of using a particular framework widget. You may end up using 4 massive widgets because it's easy, but the performance hit could still be huge.
I agree and disagree. :P

On one hand, learning the 'ins' of something always helps. On the other hand, learning from others mistakes will save you a great deal of time and energy.

I spent a few years some 10 or 15 years ago focused exclusively on assembler. While the experience was cool (something about setting a value in a registry in sequence to cause a character to flash) I doubt it did little to enhance my productivity as a developer. Gave me a deep insight into how systems level programming is/was done but much of that is irrelevant to a application developer.

Computer science is truly advanced enough now, one could spend a life time focus on a vertical, much like medical science.

You would never let a dentist diagnose your heart condition, or vis-versa.

Learning the guts of a framework, while never harmful, they can and will distratc you from doing the job of a good software engineer, that is, blurring the lines between software engineer and application/framework architect.

Just my two cents :)

Cheers,
Alex

Re: Experienced coder, new to php, theory and design question

Posted: Wed Feb 03, 2010 11:20 pm
by JNettles
A framework is only as powerful as the person leveraging it.

Re: Experienced coder, new to php, theory and design question

Posted: Thu Feb 04, 2010 4:51 pm
by alex.barylski
A framework is only as powerful as the person leveraging it.
Partially true. :P

A framework might very well be extremely limited in scope, in which case it's easy to master and still relatively useless. :P

Some frameworks are extremely complex and takes years to figure out and are still extremely restrictive (ie: Radicore?) :P

Cheers,
Alex