Software Dev - Taking the next steps...

nvanprooyen

Fortes Fortuna Adiuvat
Dec 8, 2008
3,189
82
0
Orlando, FL
I've been teaching myself PHP over the last few months and have been making decent progress. Now I'm interested in taking the next steps and writing code that's more organized, easier to maintain and easier to reuse (MVC / OO etc).

I'd like to use the experience I've had w/ PHP, so I'm not starting from scratch...although I'm willing to do so if someone gives me a compelling enough reason. I was looking around and found CakePHP and it looks like an interesting framework. I was also considering Ruby. I know one of the limitations I'm going to run into w/ PHP is threading, so it might be worth moving in another direction sooner than later.

Looking for some of the more experienced developers to weigh in and give me your opinions.

Much appreciated!
 


php is grand for 99.9% of stuff you need to do. when will you ever need threading? but definitely throw your code in classes and re-use as much as possible, i learned that the hard way.
 
Now I'm interested in taking the next steps and writing code that's more organized, easier to maintain and easier to reuse (MVC / OO etc).

If that's the goal, then pick up a new language. Once you get a hang of one language, it's much easier to learn another. I would recommend Python or Ruby.

Personally, I didn't understand the true power of OO programming until I wrote a few thousand lines of Java. Java is strictly OO, and the learning curve is much steeper than with PHP. But it will give you a new strategic perspective on coding.

Also, pick up a book on patterns. It doesn't matter what language you're in, patterns can be applied everywhere. The theory behind them will help you become a better programmer.
 
If you're interested in frameworks, check out CodeIgniter. It's well-documented and doesn't have a very big footprint, compared to other PHP frameworks.

Also, look for books that are about software analysis and design; there are a lot of them out there, but some may use C/C++ and others may use Java to demonstrate with. I'd recommend using Java to learn with because they have an API that is also well-documented (probably better then php.net).
 
You got to ask yourself what your overall long term goal here is? If you are strickly sticking to website based programming, then PHP should do just fine. It's rare when your doing simple page requests that threading would be an issue. If you see yourself eventually moving into applications such as bots that are beyond the simple "go to a, scrape code b, use that to post to c" then you would surely want to learn some other languages too.

Realistically in my opinion, learn what will give you the most options without having to learn completely new languages when you want to expand. Examples of that would primarily be Java which offers Application development, supported on almost all platforms, but also allows website development. Any .net framework allows the same, with the addition of silverlight (microsoft's spin on flash).

In the end PHP is nice because there's very little restriction on how you can do stuff, but if you want to expand your programming abilities, this is not always a good thing. You should learn to property declare your variables and typecast, which is something few people do in PHP.

However as explained already, once you learn one language, picking up others is fairly easy. Once you learn two, it's almost a piece of cake to learn another. I never touched a mac or C in my life and in a week learned objective C pretty well, in 2 weeks really well, in 3 weeks I was basically a pro in it (granted I still have to look up method names and structures since the intellesence blows and I havn't used it enough to know it by heart). Regardless of which language you pick, as time goes on you will be the same way.

The true key to a good programmer isn't the language he uses, but his ability to problem solve. An engineer with the most expensive equipment in the world is useless without the knowledge to use the tools at hand and all a programming language is is a tool to solve a problem. How to solve the problems at hand you need to train yourself in.
 
PHP is probably one of the easiest languages to step into learning, but it also let's you get away with the most in terms of messy and basically shitty code. You have to really force yourself to follow good standards in order to make yourself a good coder.

On the flip side, a framework like Rails has a way steeper learning curve but forces you to really learn what the hell MVC, Rest, OOP, and other techniques are, or else it simply will become impossible to work with.

So you have to ask yourself, do you really want to learn programming or do you have specific end goals and need to learn enough to get those goals accomplished?

I second any recommendation to learn CodeIgniter, it's a fun and pretty easy PHP framework that makes a great foundation for nearly any webapp and allows you to use basically any standard shared hosting account. Rails is a bitch in terms of deployment because you need to learn all about server admin stuff to actually make it work.

Ruby is a nice language though, and has one of the cleanest syntaxes of any language I've used.

Good luck regardless!
 
If you want flexibility in the future then definately try java. It will teach you solid programming practices that will let you pick up new languages and paradigms easily. The type safety of java is a godsend. Learn it in an IDE like Eclipse or Netbeans because the built in code checking will help to reinforce the language structure very quickly (basically if you fuckup it tells you straight away and gives helpful suggestions as to the correct way to do it).

Once you've got core java down pat then you can do a 1 hour tutorial on JSP and you basically have all the functionality of PHP right there. With the added bonus of a core that you can plug numerous frameworks on top of. There's a framework for almost anything you can think of in java world. Some of them can be steep learning curves and some of them have cascading dependencies, but I've always found that a couple of days invested in learning a new framework when I need it enables to me to build things 5 times faster than I would have otherwise. PHP is easier upfront but I can do things in java in a couple of days now that would take weeks in PHP...
 
If that's the goal, then pick up a new language. Once you get a hang of one language, it's much easier to learn another. I would recommend Python or Ruby.

Personally, I didn't understand the true power of OO programming until I wrote a few thousand lines of Java. Java is strictly OO, and the learning curve is much steeper than with PHP. But it will give you a new strategic perspective on coding.

Also, pick up a book on patterns. It doesn't matter what language you're in, patterns can be applied everywhere. The theory behind them will help you become a better programmer.

Do you have a book on patterns that you recommend?
 
If that's the goal, then pick up a new language. Once you get a hang of one language, it's much easier to learn another. I would recommend Python or Ruby.

Personally, I didn't understand the true power of OO programming until I wrote a few thousand lines of Java. Java is strictly OO, and the learning curve is much steeper than with PHP. But it will give you a new strategic perspective on coding.

Also, pick up a book on patterns. It doesn't matter what language you're in, patterns can be applied everywhere. The theory behind them will help you become a better programmer.

Thanks Stanley (and everyone else for your replies). I found a torrent of this and am going to start reading it - Head First Design Patterns - O'Reilly Media . Anyone else that wants it, feel free to PM me. I guess I'll make the language specific decision down the road a bit. Kind of leaning towards Ruby at this point.