Wednesday, May 25, 2011

Want To Learn Web Programming? Write A Blog Engine


Want To Learn Web Programming? Write A Blog Engine

What is the best way learning any kind of programming? Write programs! I sincerely believe that a blog engine is one of the rare pieces which employs all the basics of Web programming but can be simple enough to understand. More importantly you can even choose to learn more than programming – about the concepts, modern technologies and architecture of the Web.
One of the problems that a novice faces is where to start from. All the aspects are so interleaved that it might be difficult to start from just one end. It can get quite frustrating to write a sample application as most of the times you lose the motivation for it down the line. Here are some reasons why even a minimal blog engine for yourself is a better candidate.
  • There is no strict definition for a blog engine, rather it is flexible enough for you use your set of requirements. At the minimum, it is an application which takes input from you and publishes it.
  • It involves one of the simplest interactions with the database. Note that the database does not imply a RDBMS, you are free to implement a file based storage for your blog engine. However it will make you think about CRUD and exceptions.
  • Web interaction involved is minimal and lets you focus and learn the markup basics and specifications.
  • A blog engine, by default, has at least two contexts – the homepage and a single blog entry. Understanding this is extremely crucial, as you can build your display based on this. Inherently this also means that a navigation system is required to read various blog entries. This can help you understand how contexts map to the navigation systems.
If you extend the definition to build the engine for others, which is a big step, you can explore various content management concepts.
  • Thinking about the user adding blog entries or managing them makes you design your management space.
  • You can make various aspects configurable, so that the user can customize.
  • Other users might want to classify their blog entries, and this will introduce you to categories for blog entries. Interestingly, allowing multiple categories is also a good lesson for basic RDBMS design, if you end up using it.
  • You can then build a way of accessing these categories in your display system. This introduces you to more contexts. Technically this also makes you think about reusing your code for building archives.
At this point you can start thinking about various readers as well. A blog can have one author, but can have readers in a wide range of environments. Focusing on the display system, you can get exposed to standards and best practices of Web design.
  • Creating valid markup.
  • Using CSS for layout and styles. Though you might not be interested in visual design, this gives you enough exposure to how CSS works with markup.
  • Ensuring all the readers can access the blog entries. This can be your introduction you to the concept of accessibility.
  • One of the most critical aspects of the current trends in Web 2.0 is interaction with the readers. Introducing a comment system so that they can comment on the blog entries and start a discussion is a milestone in Web development. This makes your application a two-way communication system.
The beauty of a blog engine is that you can use it to understand various concepts. As you continue learning, you can use your knowledge to extend the concept of your blog engine. It is one of the best applications to employ concepts of REST and URL design. You can improve your design knowledge by exploring usability and applying it in your application.
A blog engine is a basic publishing system and most of the Web activity hovers around publishing content. Not only does this let you try out various concepts, but it also lets you expand this into a full-fledged CMS.
Of course, you can also learn a lot by reading code of existing blog engines, there already some very good ones out there. However, as I always say, code represents only the solution, not the problem. Writing an application essentially involves the problem statement and requires its understanding. It involves taking decisions and your design is nothing but a combination of these decisions.
I see a blog engine at core of our Web interactions today, at least technically if not in usage. Its tolerance with its definition, freedom of design choices, programming paradigms and interaction with various users makes it the ideal learning tool. Needless to say that this will also let you build your expertise in the programming language you are using. If you find the choices too overwhelming, start by cloning an existing blog engine, I am sure you will add your originality to it.
Oh, this gives one more advantage. You can always find some good blog engines that come with their source, that is, they are open source. Is there any better way of stepping into the open source world?
Whether your blog engine gets used or not, is liked or not, is evolved or not, it will be the best learning tool you can ever build for yourself.

Thanks to http://ifacethoughts.net

Wednesday, May 4, 2011