views:

251

answers:

8

I am mainly a C++ developer with decent knowledge of other languages.

At work we develop a C++ browser plugin which has some associated web code written using PHP, MySQL, Javascript and Dojo.

The problem is that we are a small team and none of us is specialized in web development. In other words, everybody knows what I know: to write some PHP which generates ugly HTML with layout using tables nested in other tables created using a very painful process of trial and error etc.

I manage to do C++ professionally but the web part is giving me headaches. And it is quite clear to me that this is because I learned C++ professionally while for web code I always did ad-hoc programming rather than learning good practices, bad practices, concepts etc. It is also obvious it is possible for web development to be fun rather that frustrating.

Given the situation:

  • I need to be able to get guidance on how to write web code that
    • works well
    • is maintainable
    • doesn't take a huge amount of time to write
    • is fun to write
  • I don't need to become an expert web developer

So please suggest books that:

  • help you raise from amateur to professional (or at least decent) web developer
  • do a good job at covering the whole picture (I can compile a list of good books for each of the technologies myself)
  • cover good practices
  • cover bad practices
  • do not assume that you are new to programming
  • are not dumbed down
  • balance concepts and real world examples
  • preferably (but not necessarily) apply the discussed concepts in the above mentioned technologies
+1  A: 

Agile Web Programming with Rails seems to fit those specifications for most people. It was indispensable to me as I learned Rails, and I had never done web programming before.

The book teaches you the "Rails Way," which falls into the MVC design pattern that you may already be familiar with in applications programming. It walks you through the design and implementation of a sample application, and I dare say, is "fun".

gregsabo
I'm in a similar boat - I'm an experienced C++ guy who had never had to do web stuff until recently. Using the book referenced above, I've been able to become reasonably proficient really quickly. However, one of the other guys on my team is an experienced java/javascript/C# guy, and he absolutely despises both rails and ruby. I don't think he'll ever grok rails. Rails has a low learning curve, and you can do some great stuff, but based on my co-worker's reaction I get the impression that rails skills don't necessarily translate to well to/from other web technologies. Food for thought.
Darryl
A: 

If you want to have fun while reading and never get bored, then you are definelty looking for "Head First" books, here is their PHP book Head First PHP & MySQL

Sometimes when i read books from those series i really laugh. They are amazing and can get your attention.

medopal
+1  A: 

The Django Book, if using Python is not a problem. Being free, you don't have anything to lose by just trying out.

Imran
A: 

As you are already using PHP, I'd recommend PHP in Action. It was written by some very knowledgeable guys from the site point forums. You shouldn't fall into the same trap most PHP developers do because you're not learning to program with PHP as your first language.

As I'm sure you've found, the syntax is sufficiently similar to C/C++ and lacks many of the complexities - though it's a bit function heavy at 3k+!

Is it actually the server side programming you'd like books on, or are you looking for more information on using cleaner xHTML, CSS & Javascript?

Greg K
On the flip side, I'm a web guy trying to break into C++ (or more specifically Qt4 development, maybe it's me but I figured the learning curve was steeper from web -> systems language than vica versa).
Greg K
Both server side and client side. Cleaner everything - PHP, HTML, CSS, Javascript - :). And cleaner architecture, conventions, examples in separating logic, presentation, database etc.
Catalin Iacob
The latter will be covered by the books already mentioned. But you'll need CSS and javascript specific books for those technologies.As far as javascript goes Mozilla have the MDC (google javascript MDC) which is a good resource and javascript frameworks (jQuery) will help speed up dev / remove a lot of cross browser idiosyncrasies.
Greg K
+1  A: 

Don't learn HTML/CSS in an adhoc manner, its a technology that has evolved by accident rather than design. You should definately grab a book like "CSS Mastery: Advanced Web Standards Solutions" to reduce the frustration in learning HTML layout.

Frank Schwieterman
I totally agree. It covers/explains a lot of techniques and is a great reference.
Zack Mulgrew
A: 

I'd go straight to the PHP manual - really. It is one of the best I've ever seen - functions reference is plain excellent, documentation is always up to date, and user comments in the online manual often contain chunks of good, working, sometimes even educating code. The manual itself does contain examples - sufficient amount of them.

The manual will definitely help you raise to at least decent development - as it contains enough details you may need developing in PHP.

To cover the whole picture you may need to do some reading in adjacent technologies - starting with HTTP (highly recommended - especially headers, response codes, and POST requests), and ending with client-side DOM/XHTML/JS/CSS/you-name-it, which is still a very different topic from PHP.

As for good and bad practices: always check/sanitize [user] input, and do separate logic and output as much as possible. I found that the easiest thing to achieve separation is by using associative arrays, but using an established template engine like Smarty could be a more professional choice. You may want to find a few short articles on best practices - you definitely do not need a whole book for that.

Finally, to avoid re-inventing wheels (like MySQL access layer) - have a look at PEAR libraries (e.g. MDB2 for MySQL).

chronos
I do use the PHP manual of course but I don't feel that's enough. I would really like to read some books for the more general subjects (also client side) that don't fit well in a manual section.
Catalin Iacob
I believe you want too many separate technologies from a single book (PHP, HTML, CSS, JS). If you really need all of that - then focus on HTML/CSS first, then add JS, and only after that add server-side processing. I believe it won't really work if you attempt everything at once (or will be too slow), but of course YMMW.For conventions/logic/presentation/etc, you may want to start with one of the existing PHP frameworks (CakePHP, Symfony, and others). It raises the learning curve, but you'll be able to dive into not-the-worst code from the very beginning.
chronos
Thanks for your answer. It would be too much to ask for one book but I ask for several books ;). I like reading them and have spare time each day because of commuting. The framework vs. non-framework choice is interesting but I have to look in more depth at frameworks to make an opinion about that.
Catalin Iacob
I wouldn't recommend PEAR, look at the Zend Framework instead which has essentially superseded it. PHP has the PDO now for DB access. At work we use the ADODB library because PDO wasn't stable at the time.
Greg K
@Greg: PDO rules!
Jason S
A: 

I'm not sure if it counts for this question, but the book that helped me with web programming the most is SICP, because it's the book that helped me the most with all kinds of programming.

I found it both fun and practical, and it doesn't assume anything (it starts with adding two integers, and moves fast: halfway through the book you're writing a metacircular evaluator). It is definitely not "dumbed down".

It has nothing directly to do with the specific technologies you mentioned, though it's not far from Javascript. Still, anybody who has read this book is going to be a far, far better programmer even if they have to use a simple language like PHP.

Ken
I didn't downvote you, but I can understand the -1. Be aware that the mindset behind SICP (great book, every programmer should read at least part of it) is about the opposite of most of modern web programming, which is a land of illogic and complex systems, and of a blizzard of tools which variously fall into categories of timesavers, snakeoil, bad-habit-forming substances, and/or tar pits. OP already has programming experiences: touting SICP is like giving someone who wants to learn catering a chemistry set instead of a cookbook and a cuisinart.
Jason S
I agree somewhat, but I like to think that the reason people ask questions here is to learn, and therefore escape "most web programming", because "most" of anything is crap. He also specifically asked for "good practices", and "fun" (which I've found in virtually no other computer books).I'm not trying to be contrary: when I first had to jump in and do full-time Rails work, I tried the PP books, but found them (like most programming books) pretty much useless, like the instructions on the side of a microwave dinner. SICP is like a really good cookbook which also has chemical formulas. :-)
Ken
A: 
Jason S