Hari's Corner

Humour, comics, tech, law, software, reviews, essays, articles and HOWTOs intermingled with random philosophy now and then

A change of tagline

Filed under: Site management by Hari
Posted on Tue, Dec 4, 2007 at 14:14 IST (last updated: Tue, Dec 4, 2007 @ 14:15 IST)

Not a big change; this blog site's tagline now reads:
Humour, tech, software, reviews, essays, articles and HOWTOs intermingled with random philosophy now and then

I think it reflects the focus of my writing as it has evolved over a period of time. Not that the previous tagline didn't; I just thought that it was a bit vague.
Comments (5)  

PHP templating systems - pros and cons

Filed under: Software and Technology by Hari
Posted on Sat, Dec 1, 2007 at 10:42 IST (last updated: Wed, Jul 16, 2008 @ 20:38 IST)

As I was in the middle of programming my new blogging system a few days ago (the PHP/SQLite one), I decided to go with Smarty, a PHP templating system which allows programmers to separate content presentation from the application logic. In its simplest form, a templating system provides a mechanism which allows you to define "tags" within HTML files which can be replaced by data generated by PHP code. But Smarty goes way beyond that and allows you to manipulate complex documents with relative ease while keeping the PHP functions separate from HTML code. Here are some of the pros and cons of using a PHP templating system. Keep in mind that using a system like Smarty is a highly addictive way of developing applications because it makes things so simple from a programming perspective and makes your code highly readable. I suspect though that it does have a few drawbacks as well. Here is my opinion on using a templating system as opposed to intermingling PHP tags with HTML.

Pros:

Cons:

Yes, there are some cons of using templating systems as well. Here's what you have to watch out for:

That's all. Whether you use a templating system or not really depends on how you visualize the development of your application. Monolithic or small projects can get away with intermingling PHP with HTML code, but even with a moderately sized PHP application, you would be forced to think of ways to minimize PHP embedded in the HTML files and so you would have to write your own library of "feeder" functions which insert data into HTML. So why not use a pre-existing library which not only saves you that task right off the bat, but allows gives you a lot more features and flexibility to work with?

So remember, if you are ever planning to develop a non-trivial PHP application involving a bit more than simple content display, make sure you have a plan in hand to separate the content display from the application logic. It will save you a lot of headache later.
Comments (8)  

Oldies: selected posts from November 2005

Filed under: Bits and Bytes by Hari
Posted on Wed, Nov 28, 2007 at 20:55 IST (last updated: Thu, May 7, 2009 @ 21:34 IST)

Here's my next version of "Selected Posts." It's been a while, actually and from November 2005, I have a fairly large selection of posts to offer you.

Choice: the spice of Desktop Linux - Here I wrote about why Desktop Linux is not limited to just KDE or Gnome. You actually have a wide range of lightweight Window Managers to choose from and they are not as heavily loaded with features as the full fledged Desktop Environments. If you need a GUI for your work, but don't need it to "get in the way" like KDE or Gnome sometimes can, use one of those!

Is the internet really polluted by blogs? - some years ago, people questioned the relevance of blogs. Read this article to find out what I thought about the issue. Surprisingly, it has suddenly become relevant today in the context of SEO penalties imposed on sponsored blogging by a popular search engine ;)

Why I don't debate online these days - Ask any experienced online forum user and you will get the answer to this question. Meaningless debate over the same topics over and over, adding nothing new to the original topic can become very tiresome as I found out during my extended stint at LinuxQuestions.org forums.

phpBB upgrade tips - I never really regretted giving up phpBB 2.0 after an endless cycle of security problems followed by quick, patchy updates. Upgrading a well-modded phpBB forum is akin to a visit to the dentist. And till date phpBB 3.0 is still officially "unstable." :roll:

The bloggers' definition of success - This article will tell you my blogging philosophy. It is somewhat long-winded by my current standards, but it's still worth a read. Till now I guess I've broadly followed those principles.

SUSE 10 review - A (surprisingly positive) review of SUSE 10. Since then, I've changed my views. I don't currently want to use SUSE and I guess I will never really use SUSE Linux. A big yawn probably sums up my current attitude to SUSE Linux (and many other Linux distributions) better than any words. I'm currently at the stage where Linux by itself doesn't interest me so much as what productive work I can do with it. I guess the novelty factor wore off long ago. :)

That's all for this edition. Oh, and don't forget to check the full archives for November 2005. There are some other good articles I've left out, among them some cricket articles (I was actively blogging about cricket those days). So feel free to leave behind your thoughts on any of them. :>>
Comments (4)  

Geeky and Meeky 15 - Evil twin

Filed under: Geeky and Meeky comic by Hari
Posted on Sun, Nov 25, 2007 at 08:50 IST (last updated: Thu, May 7, 2009 @ 21:22 IST)

Here's my next Geeky and Meeky episode. Maybe this one should be entitled "Geeky and Geeky." Anyway, hope you enjoy this! This is the last of my toons drawn with a mouse (done a while ago). I've already drawn the next one with my new iBall WP5540 graphics tablet and pen.

Geeky and Meeky - Evil twin
Comments (5)  

Why end-users prefer blogs to CMSes and more

Filed under: Software and Technology by Hari
Posted on Fri, Nov 23, 2007 at 09:04 IST (last updated: Wed, Jul 16, 2008 @ 21:12 IST)

While I was writing the code for my new blog/CMS system yesterday, I realized why people prefer blogs to Content Management Systems and why developers prefer databases to XML for content storage.

To answer the first question: blogs enforce structure on websites which makes it very easy to insert content. By providing a convenient method of organizing information without requiring too much input from the end user, blogging platforms are way friendlier and easier to administer/manage from the back-end.

CMSes are unique beasts. They have a layer of abstraction that requires the end user to think a lot more about the structure. Even a simple CMS like Drupal forces you to think about content organization. While Drupal can be used as a basic blog, I think the point is that it is so flexible in terms of content organization that it does confuse one as to what is the best or optimal way of using it. That, I think is the crux of the issue. Thinking, planning and organizing a large website is a specialist design team's job. Blogging, on the other hand, allows people to create as much content as they want without having to indulge in structuring. Of course, categories and tagging allow people to manage content to an extent, but that is built into the system and so requires little maintenance. CMSes allow such flexibility in design that sometimes it's harder to think about how to manage content and to visualize how future content will affect a particular structure. They also carry a lot of features (or bloat, if you prefer) that are unnecessary for personal websites.

Coming to the second point, I think the reason why databases are more popular than XML with developers is something similar. Databases impose norms and rigid structure (fields and records). Of course, they are powerful because they can be queried in an endless variety of ways. But they scale well for small as well as large applications and it is easier to visualize how a database design will work with large amounts of data than to custom design an XML format that will allow future flexibility. I also think that with XML there's the issue of choosing a suitable XML parser for the particular application in question. The generic nature of XML parsing imposes a lot more pre-planning in terms of code, while it is a lot easier to write a specific set of SQL queries to work on a particular database that will completely manage data-handling for the application.

In the end, I think the answer lies in the fact that as people, we like structure and simplicity to generic flexibility and complexity in design. Structure doesn't necessarily mean rigidity while simplicity doesn't necessarily imply lack of features. It's the layer of abstraction that makes generic design (as opposed to one specific design) harder to visualize.
Comments (6)  

My first GIMP video tutorial - lighting and bump mapping

Filed under: Tutorials and HOWTOs by Hari
Posted on Mon, Nov 19, 2007 at 09:57 IST (last updated: Sun, Apr 5, 2020 @ 15:19 IST)

I thought it would be cool to create a video tutorial showing how easy it is to use GIMP to create 3d objects using lighting and bump-mapping effects, combined with the 2d blending mode. More than words, this video shows how simple GIMP really is. Writing a full fledged tutorial would have complicated the whole process. I created the following video using XVidCap.

(Yes, YouTube does blur the video even though I tried to keep the captured region as small as possible)

Comments (15)