Learning programming for web apps

I understand the mechanics of programming, like the various control structures and have a decent aptitude for algorithmic thinking. In the programming classes I’ve had since secondary school in (BASIC/C/Matlab), I’ve done very well. Now I wish to learn some real-world skills. The projects and assignments in those classes were mostly computational and didn’t involve much I/O work, working with APIs or libraries, data structures, or security…etc. In short, I didn’t think I could still do anything useful besides the elementary accounting style apps.

Well, I got some webspace for real cheap via a promotional code ($9 for a whole year - Dreamhost’s Level 1 plan). So that’s given me the motivation to take it to the next step and learn some web apps programming.

I’ve two projects in mind.

1)Writing my own groupblog engine. Mostly because I’m dissatisfied with what I’ve seen. I’ve some specific ideas in mind for the user experience and organization.
2)Writing my own web-based notes/bookmarks/calender app.

I can run the usual PHP4, Perl5, Python2 apps with access to MySQL, as well as C/C++ binaries.

Which language should I pick? What’s the best way for learning and applying it? What resources?

Note: I haven’t learnt much about OO programming.
Thanks!

Well, I’m more of a windows web programmer myself… (obligatory link for http://www.brinkster.com/ for free/cheap IIS hosting though it seems to be having a few technical difficulties at the moment… :smack: )

I’m a little familiar with some of the above technologies though, and I’d recommend PHP4 as the most user-friendly and real-world useful of them. It’s got something of a funky syntax in my opinion, but you’ll learn a lot about working with a scripting language, which is something that can carry over to ASP and JSP pretty easily. Make the most of the mySQL account too… it’s a simple but quite powerful relational DB.

As far as learning for resources for PHP… the home site at http://www.php.net/ should probably be your first stop. I found the manual docs very helpful for a beginner. There are numerous good tutorial sites available on the web IIRC, and probably some good books in your local bookstore.

Hope this helps.

I’ve heard Python is easier to pick up. Which is more versatile for the types of apps I mentioned above?

Any books or resources in particular?

If your priority revolves around the type of app you’ll build (as opposed to wanting to self-educate for a job), I recommend you focus on what exists in the opensource world, then build off of that (as opposed to picking a language first). Search around at sourceforge.net for the apps you want to build. There are several out there in the areas you’re interested in.

Well I would advise you to try PHP, which is very similar to C if you ignore the OO part of it. I don’t know much about the Perl or Python as I’ve only learned PHP myself.

Are you suggesting that I modify existing programs? If so, that’s a good idea since it’s normally an illuminating exercise. But I would rather study the code and build from scratch, rather than adjust on top (Yes, I’m aware of coding practices in the real world.). I’m not too wedded to the applications I suggested. They simply presented themselves as useful opportunities where I could kill two birds with one stone: learn constructive skills and end up with some useful byproducts.

I’m not quite sure what a groupblog engine is… notes and bookmarks are a pretty standard sort of program, and either of them would probably teach you a lot about working with mySql as a database engine. Not sure if your programming language matters so much, except inasmuch as it provides easy access to the database, which PHP4 certainly would.

Calendars generally have their own set of unique difficulties to program. :slight_smile:

PHP is very user-friendly. It’s also extremely poorly designed, insecure, inconsistent and ambiguous. It will instill in you very poor habits and incorrect program design skills. Also it kicks puppies and kittens.

Perl is a great language, not just for webapps but for all sorts of stuff. However, learning to program it well can be daunting. Be warned: there is a tremendous amount of heinously bad Perl code out there. The two canonical books for learning Perl properly are Learning Perl and Programming Perl. Accept no imitations. The best board for discussing Perl is Perl Monks.

Python is also a great language, highly structured and very easy to pick up. It’s also great for general-purpose stuff, including webapps. However, it’s always object-oriented all the time, whether you want it to be or not. Perl gives you a choice of styles to work with.

In short, Perl, Python good. PHP bad.

Thanks. Confirms roughly what I’ve heard.

I guess that leaves me choosing Python as my preferred foray. Now, what books/resources can help one to learn use it in a real-world sort of way?

I don’t have a great deal of experience with Python, but O’Reilly & Associates publishes a parallel series of books for Python: Learning Python and Programming Python. I have found both to be excellent.

friedo wrote

I disagree. Perl and PHP have their own issues, and they’re both valuable in their own ways.

Coded properly, PHP is fine security wise, and it’s much much easier to develop simple apps in. (Which is an important security consideration, as difficult code tends to be less secure).

I can’t speak to PHP being “inconsistent and ambiguous”. I’ve used it a fair amount and have never run across that, but I’m no expert on the language.

Also, how do you mean it’s “extremely poorly designed”? it’s able to do all the things I’ve asked it in a straight forward way.

No matter what piece of software you try to integrate, you’ll find either a missing piece that you’ll need to construct, or a broken piece that you’ll want to rewrite. Don’t think of modifying existing programs, think of it as augmenting or repairing them. In this way, you can get familiar with the nuts and bolts of a language as well as learning to estimate the time needed to accomplish things in it.

I would suggest going with an OO language. It’s really the future of computing for reasons that are out of scope for this question. Just be aware that OO support in PHP is still nascent to some extent. In Perl 5 it is flawed and slated for major overhaul in Perl 6*.

  • I’m not bashing Perl, I love it for basic automation and pattern matching. Whenver I need to get something done, Perl is the rusty hammer I reach for first. But I’ve also done enough OO in it to know that it has problems, so I would hesitate use it for projects that are very large in terms of numbers of modules, depth of class hierarchy, and lines of code.