Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I want to preface this question by saying that I've read a ton of questions on Programmers leading up to this one. I was/am particularly affected by the assertion that PHP as a language suffers because of poor coding and the leeway it provides.

I have been coding PHP for a long time - I learned a lot as an apprentice to a senior, but have been mostly restricted to web development. I have enough knowledge to quickly respond to challenges and to provide web-based solutions that are secure. I am getting slightly more familiar with MVC and OOP in general, but it isn't a strong point for me.

My fear is that I fall into the category of people that give PHP a bad rep - not for vanity purposes, but because I'd really like to be the best programmer/developer possible. I have a penchant for learning and I think it is time to "graduate" to a more in depth understanding of programming and development in general, so I can improve my skills and become a better programmer.

I think this starts with learning a new language and building a hobby project with some expertise found in literature - books like Code Complete, Clean Code, and references on algorithms. I'd like to integrate their best practices and advice. There are some community college courses as well, but my concern is that I may be beyond some of the classes - they are very introductory.

I'm looking for suggestions and tips to attain my goal. I would love to get feedback from the community so I can learn more and (hopefully) be great.

Edit: I'm considering Python or Ruby to dive into, but I think a non-scripting language would help me out more. If you have a suggestion there, please include it in your answer :)

share|improve this question
add comment

4 Answers

up vote 10 down vote accepted

Find a new language (preferably something more general purpose than PHP), learn it, and start doing Project Euler problems. It's a great way to learn problem solving an efficient programming.

Edited to add: Learning a "closer to the metal" language like C would be quite enlightening I think. Any paradigm shift would teach you great things really.

share|improve this answer
    
Thanks for the answer. I think you're right about C; I look at some C sample code and I'm off in lala land with it. Am I right in feeling that it doesn't have as many shortcuts? –  Nic Apr 21 '11 at 19:35
    
This is exactly how I learned Python. +1 –  chrisw Apr 21 '11 at 19:36
    
Just wanted to let you know that I'm re-tackling C and it is a lot easier than I convinced myself it wasn't, and I'm having a blast with it too. Thank you! –  Nic Apr 24 '11 at 7:13
    
@melee: Glad to hear you're having fun :) –  System Down Apr 25 '11 at 15:49
add comment

As a contrast to PHP I would look at C++ (for a compiler I would choose GNU gcc in Linux) and C# (.NET 4); here is why.

C++

  • It is an amazing language; it is huge, complex and powerful.
  • It is easy to write badly and hard to write well, but there are lots of good books that explain the pitfalls and how to avoid them, for example Scott Myers Effective series and I think learning those skills makes you think much more about the code that you write in other languages which not so strict.
  • It does not do all of the memory management for you, so you need to start to think about how to assign memory and how to manage the lifetime of that memory: that is good because it gives you an appreciation of what might be going on under the hood in memory managed languages.
  • C++ has strict typing without a generic object type which creates lots of interesting programming challenges.
  • C++ development places a lot of importance on performance and optimization: writing code in certain ways and using certain patterns allows the compiler to make your code run faster. Understanding how it does that and why generally teaches you good programming habits that you can take to other languages.
  • It has multiple inheritance, which makes thing more complex and interesting.
  • It has templates (I don't know of any other languages that do) and these are complex and powerful beasts that can do all kind of clever and exciting things and will be a source of many woes and excitement.
  • Knowing C++ is a really useful skill in the programming world in general; it is different from C but knowing C++ will help you read it and; lots of companies have a lot of C++ floating around.

I think that my point is that it is a real challenge to learn, is very interesting and if you learn it well you will be a much better programmer for it.

C#

  • Is amazing for sort of opposite reasons.
  • Is incredibly powerful and has a beautifully thought out syntax and library.
  • Has hands down the best IDE that exists.
  • Is designed from the ground up for productivity and writing solid testable and usable code.

Essentially C# lets you write code without needing to think about all of the nasty bits that you did in C++ and you aren't generally tied down by the constraints of the language letting you concentrate on the patterns and the architecture.

share|improve this answer
add comment

There are some excellent videos on MSDN's Channel 9. Particular Erik Meijer's Functional Programming Fundamentals and Yuri Gurevich's Introduction to Algorithms and Computational Complexity could be very interesting for you.

I also second learning a "close to the metal" language. For learning 'C' I can highly recommend C Programming: A Modern Approach. It is pricey but IMHO worth every penny.

Working through the book How to Design Programs and then immediately jumping into JavaScript preferably with Douglas Crockford's excellent JavaScript lectures could offer a lot of value for you learning. HtDP starts of really slow and uses a language that on surface is very different from JavaaScript, but combine it with Crockford's videos and it'll start to make sense and give you a very solid grounding for actually using JavaScript as it is supposed to be used.

A much more rigorous - but less accessible - alternative to HtDP is The Structure and Interpretation of Computer Programs. UC Berkely uses this book for the course Computer Science 61A.

For getting into Algorithms I found Algorithms in a Nutshell and Python Algorithms way more accessible than the usually recommended Introduction to Algorithms - which IMHO is one of the most perversely named books in history, but 'comes with' a good freely available lecture from MIT - or the Algorithm Design Manual - which is an excellent book, but maybe a bit tough for a first contact with the topic.

share|improve this answer
add comment

While C++ is an excellent language, I would give some consideration to studying and learning C first. You've got a couple of motivations for doing this:

  1. PHP is written in C. Insight gained by looking under the hood of your language is always helpful.
  2. Syntatic sugar is very similar to C (and C++).

The first thing that you'll gain is a much deeper appreciation for exactly how much PHP spoils you. This is part of the reason why it gets a very bad reputation, it makes doing bad things quite easy. C does too, but the resulting program tends to blow up very quickly.

Learning how to manage your memory will make you much more conscious of what you're doing in higher level languages and let you better approximate just how much more expensive one method might be over another.

Additionally, you'll end up working more with the basic fundamentals of programming that aren't at all unique to C. Bitwise shifting, enumerated lists, linked lists, structures and you might even develop an appreciation for proper alignment.

With a bit of practice and learning, you'll be able to write your very own PHP extension. It might not do anything more than print some strings, but the thrill you'll get out of calling myfunc_foo($bar); without previously defining it (in PHP) is awesome. So, with C - your studies will yield more immediate practical use when paired with the language that you use.

Don't stop at C. C++ is the next logical step.

I'm not saying that you should or need to become an expert in these languages, but you would do quite well to be able to work with them and the resulting experience will indeed make you a more defensive and decisive programmer when working with interpreted languages.

share|improve this answer
1  
"Defensive" is an absolutely perfect way to put it. Well articulated. –  Nic Apr 21 '11 at 22:29
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.