At the Forge

First Steps with Web Development

Reuven M. Lerner

Issue #244, August 2014

Interested in becoming a Web developer? Here are some tips on where to start.

The Web is more than 20 years old, and a huge number of developers now work with it. It used to be enough to be a “Webmaster”, meaning a jack of all trades: developer, designer, database administrator and system administrator. Today, we see increasingly specialized aspects of Web development—front-end developers, back-end developers, devops professionals and then “full-stack developers”, who can do it all, or at least claim to.

This increased specialization reflects, in large part, the degree to which the Web has become huge and essential. Web sites are an important part of the world economy, and as befits an important part of the economy, they need to be designed, developed and maintained like any other type of engineering.

But with the specialization, and with the growth of the Web, also comes opportunity. During the past few months, my consulting work has increasingly involved coaching individuals who see the potential payoff (financial and personal) for becoming Web developers, and who want to improve their skills in order to do so. These people know if they manage to learn these skills, they'll be able to find a job, either with a startup or a large firm—or even better, starting their own on-line businesses.

I've been exposed to more and more people who know they want to work with “the Web”, and they know they want to develop software, but they really don't understand the fundamentals or even where to begin.

So in this article, I describe some of the basics people should know if they're interested in doing Web development. As a full-stack Web developer myself, I think it's important for anyone working with Web technologies to have at least a passing knowledge of each of these topics: Linux, databases, a server-side language and framework, and client-side technologies (HTML, CSS and JavaScript).

If you can learn at least a little of each of those, you'll be well on your way to being able to create Web applications. Moreover, you'll probably find that one or more parts of this technological constellation are particularly appealing to you, giving you a sense of the area in which you want to specialize. Or, if you find that you enjoy it all, you can be more of a generalist, applying your broad knowledge to many different aspects of Web applications.

Linux and Servers

Perhaps it won't surprise a reader of Linux Journal that being familiar with Linux is a good thing. However, it's not just good, but essential, given that Linux powers a surprisingly large proportion of the Web. Not only are many traditional servers running Linux, but virtualization has become a stable and popular technology, using such systems as Vagrant, an open-source system that lets you develop on a virtual machine and then use that same virtual machine in production. I must admit that I haven't yet taken the plunge and used Vagrant, but each time I have to wrestle with server configuration or get something to work on my employee's computer that worked fine on mine, Vagrant seems like an increasingly good option.

But really, if all you want to do is start with some Web development, a deep dive into Linux isn't necessary. Yes, you need to understand some basics, such as directories, users and permissions, as well as how to install and run programs. You also should know where your system's log files are—both general-purpose log files and also those produced by your HTTP server.

If you're new to the world of Linux administration, learning such systems as DNS, SMTP and SSL might well confuse more than help you; try to rely on third parties for as much of this as possible.

Knowing how to use a classic UNIX text editor, such as Emacs or vim, will help a great deal, even if you're more of a GUI kind of person, simply because you won't always have access to a GUI. And of course, learning the ins and outs of UNIX utilities, such as grep and find, will help tremendously.

I would say that you shouldn't worry too much about all of the virtualization and container systems that exist—not because they are irrelevant, but because they likely will confuse and complicate your progress, and those are things you can learn over time. If and when you decide to use Vagrant, Docker or Amazon Web Services, you can specialize and learn those particulars.

I should add that Linux is a deep and complex system, one that takes many years to understand and internalize fully. If it seems foreign and difficult at first, that's only natural, but over time, you'll customize your environment, learn more about how to work with it and feel more comfortable working with it.

Databases

There is no requirement that a Web application have a database. However, in practice, it's rare for a modern Web application not to use a database at all. (My company's Web site doesn't have a database, but that's because it's mostly for promotional purposes. However, my blog does have a database to store posts and comments, among other things.) I'm an old-school kind of guy, so I believe that traditional, relational databases with SQL are the right way to go for many Web applications. However, I do admit that the learning curve—of a client-server protocol, of the SQL query language and of the various tricks involved in a relational database—can be steep.

For this reason alone, many people starting off in Web development have begun to use so-called NoSQL databases, such as MongoDB, which allow you to store complex documents in a format that naturally maps to objects and modern programming languages, without the overhead of SQL queries. I can understand this perspective, and if you feel that learning SQL would be too complex for you, you might indeed want to go this way.

However, I think there's a reason why relational databases continue to be so popular, namely because more than 40 years of research and practice have been so beneficial. I personally think it's worth the time and effort to work with a relational database, particularly if you'll be using a high-level language and object-relational manager (ORM) that handles most of the queries for you and, thus, hides many of the queries from you. The long-term benefits of understanding SQL and relational databases, and the flexibility of a normalized relational database, are still without peer, in my view.

This doesn't mean I think that all NoSQL is meaningless or worthless. However, I have found much more utility in key-value stores, such as Redis, than in NoSQL databases, such as MongoDB, particularly with the recent advances in PostgreSQL, which make storing and retrieving JSON objects easy and efficient.

If you're interested in database technology, a great book to try is Seven Databases in Seven Weeks, by Eric Redmond and Jim Wilson, and published by the Pragmatic Programmers. That book, as the title describes, is something of a survey course in modern database technology, looking at a number of different systems and comparing the advantages of each.

Programming Languages

Next comes the most important choice, but also the one that probably causes the greatest number of arguments among developers: the server-side programming language. Longtime readers of this column won't be surprised to hear that I think Python and Ruby are likely to be your best candidates, both because of the languages themselves, and because the Flask and Sinatra frameworks are simple, powerful and well documented, with large communities. You can create great Web applications with these frameworks—or, if you find that you're cobbling together too many separate packages, you can move up to Django and Rails, frameworks that undoubtedly can handle whatever you throw at them.

Although I personally prefer Ruby for Web development, there's no doubt that Python is not only capable, but that it's also easier for newcomers to programming to understand. (I say this after having taught two to three Python courses every month for the last five years.)

An increasingly popular option is JavaScript, often using node.js, on the assumption that it's a good idea to use the same language on both the client (that is, in the browser) and on the server. I haven't yet found node.js to be a compelling framework, partly because of its use of the “reactor” pattern, and partly because I'm used to the comforts of other, more mature frameworks. But given the huge number of people working in JavaScript nowadays, and the understandable interest in reducing the number of languages needed to engage in Web programming, I would expect JavaScript to become an increasingly viable option for Web development in general and for newcomers to the field in particular.

There are other options, as well, such as PHP, which is easy to learn and has a huge community. However, PHP has never impressed or excited me as a language. That said, the fact that WordPress now powers about 10% of the Web indicates that PHP is not going away any time in the near future. Moreover, there are many opportunities to extend, expand and work within the WordPress ecosystem. One friend of mine has a very successful business as a WordPress e-commerce consultant. Given the size of that ecosystem, I expect that he will have clients and work for about as long as he would like.

Depending on your development background, experience and taste, you might want to try something like Go, Scala or Clojure, all of which can be used for Web applications and have active, strong communities that continue to grow.

The bottom line is, if you already know a programming language, you should try to leverage that knowledge and use it to dip your toes into Web development. If you don't already feel comfortable with a language, I suggest trying Python or Ruby. They're easy to learn, have large communities and ecosystems, and have multiple frameworks that can cater to needs large and small. Of course, you may decide to go in a different direction—and if you do, the odds are that you'll be just fine. Learning to be a Web developer is generally more difficult than learning to develop Web applications in a new language or with a new framework.

Front End

The whole idea of the “front end” in Web development has been increasingly critical in the last decade. Whereas it was once enough to know about HTML, and then CSS, the combination of HTML5, CSS, JavaScript and numerous APIs has made front-end development a complex but vital part of any Web application stack.

That said, don't feel that you need to understand everything at once when working on the front end. You will need to learn some HTML, as well as some basic CSS. And the odds are good that you will need to learn some JavaScript as well, although just how much you will learn depends on how much client-side work you will need to do and how sophisticated it will need to be.

Perhaps the biggest boon to front-end development in the last few years has been the creation of front-end frameworks, such as Zurb Foundation and Twitter Bootstrap. These frameworks make it possible to focus on the design you want, taking advantage of the fact that others have had to struggle with the same issues before you. I have used Bootstrap on a number of projects and have found that it saves me time, while allowing the design to look far better than otherwise would have been the case. Bootstrap and Foundation don't mean that you don't have to learn CSS, but they dramatically reduce the amount of CSS you need in order to get a site up and running.

JavaScript is also enjoying a surge in popularity, partly because Web applications are becoming more sophisticated, and partly because everyone has a JavaScript development environment—namely a Web browser. The number of modules and packages for JavaScript is extraordinarily large and shows no signs of stopping. The growth of Ember.js and Angular.js is encouraging and interesting. At the same time, I think these front-end frameworks are too complex for beginning programmers. jQuery, although somewhat old-fashioned, is still a great JavaScript library that makes it easier to manipulate the DOM in a cross-platform way.

JavaScript is a vital skill every Web developer should have. The book Eloquent JavaScript, by Marijn Haverbeke and at eloquentjavascript.net, is a great introduction to the JavaScript language, although it focuses on the language, rather than its use in Web development.

So, Where Should You Start?

The good news is that Web development is so diverse, it's hard to make a bad or wrong choice. Almost no matter what you choose, there is a community using those same technologies.

If you're a complete newbie, I'd suggest trying Python, along with the Flask framework, the PostgreSQL database and the Bootstrap front-end framework along with jQuery.

If you feel very comfortable with object-oriented programming, or feel like you want a bit more flexibility in your code style, you might take a look at Ruby with the Sinatra framework—and also PostgreSQL, Bootstrap and jQuery.

Finally, WordPress development is a good way to get your feet wet in its own ecosystem. I'm not sure if I'd say that WordPress is the paradigm of beautiful software development, but it's hard to argue with the market share and plugin ecosystem that has grown up around this very successful, very user-friendly system.

Conclusion

It sometimes seems as if all software development is becoming Web development. That's obviously an exaggeration, but the demand for Web developers, and the number of interesting projects for such developers, continues to surge. It doesn't matter very much what language or technology you learn; the important thing is to learn the Web mindset and try to figure out what niche of this growing industry you want to be a part of or benefit from.

Reuven M. Lerner is a Web developer, consultant and trainer. He recently completed his PhD in Learning Sciences from Northwestern University. You can read his blog, Twitter feed and newsletter at lerner.co.il. Reuven lives with his wife and three children in Modi'in, Israel.