My favourite pet: Python

Now that the Firefox series is over, it’s time to move on to other
things. One of the many questions that new programmers have is: Which language do i start with? I suggest Python.

Python is a programming language, or more correctly, a scripting
language. It’s interpreted, not compiled. That means that once you’ve
finished writing your program, you can run it straight away, without
having to compile it and sort out errors first. If there are errors,
then they’ll come out when you run the program. But the best part is
that if there are syntax errors, then they’ll come out while you’re
writing the program itself. How? Python is interactive, it scans your
program while you type and makes you fix syntax then and there. No more
searching through your program trying to decode weird error messages.
It is also a very high level language. That means that you don’t have
to worry about things like the size of arrays, since Python takes care
of all that for you. You just worry about writing a good program. After
C++, this is very welcome. Tomorrow I’ll give you an extended comparison of Python with other languages and explain why it’s perfect as a starting language.

Technorati Tags: , ,

Extend Firefox into a Superfox: Part 4

Here we finally are, the last part of the series. This final post will just talk about some common extensions that you probably will find useful.
First off is AdBlock. If you don’t have this extension, get it. Now. It does just what the name says: it blocks ads. Simple and intuitive to use and completely effective.
One of Firefox’s most basic tools is tabs. They’re good enough on their own, but the Tab Mix Plus extension, makes them just that much better and easier to use. There is also another extension called Tabbrowser Preferences. Both of them do mostly the same thing, use whichever one suits you best.
Finally for those of you who equate performance and quality with speed, grab FasterFox, a simple tool designed to make your Fox sleeker and quicker.
Of course there are hundreds more extensions than the few mentioned here. So head over to the Extensions page and indulge!.

Extend Firefox into a Superfox: Part 3

Now that Email and RSS have been wrapped up, let’s move on to two more important aspects of a netizen’s life, namely blogging and IM.

Blogging
Unless you run your blog the old fashioned way, that is, off a server by manually editing HTML, then you probably use a blog host that provides you with blogging tools to manage and post to your blog. But sometimes the whole go-to-blog/ login/ go-to-edit-page routine can be tiring. And your blog tool might lack a comfortable WYSIWYG editor, though that’s rare. As an alternative to using your host’s interface you can use an external client such as w.bloggar for Windows or BloGTK for Linux. But why go to all that trouble when you can use a Firefox extension instead? There are in fact not one, but two extensions that add a bloggin client to Firefox: Performancing and Deepest Sender. Both are capable of handling multiple accounts and blogs and have full featured WYSIWYG editors along with source editing. Deepest Sender opens in it’s own window by default, though you can open it in the sidebar. Performancing gives you the choice of opening in a new window or in a tab inside Firefox. Though both are quite usable, I prefer Performancing as it seems to have a more professional interface and more polish. But I encourage you to try out both and take your pick.

Instant Messaging
Like Email, there are no complete IM extensions out there. There is ChatZilla, but that is only for IRC. But don’t despair. You can still have IM in your browser!. Check out Meebo. It’s a web service, using AJAX technology that allows you to connect to multiple networks and works just like a normal client. Sure it takes some getting used to and lacks “power features” like video or voice, but hey, it’s a start and is pretty good at what it does. Check it out.

Tomorrow we wrap this series with some general extensions that the community finds useful.

Extend Firefox into a Superfox: Part 2

Enough history and related boring stuff. Let’s get to the interesting stuff:

E-mail
    After browsing, e-mail is probably the most important use of the internet for most people. For some people like my dad, email is more important than browsing. So, where does Firefox come in? Well, there is no extension that turns Firefox into a full-fledged mail client. If you want a mail client you’re going to have to use somethine else. Mozilla Thunderbird is a good choice. But if you want to manage your mail through Firefox, as I do, the most obvious choice is to use Webmail. If you use your ISP’s email account, then your ISP probably gives you a webmail service. If not there are numerous free mail providers. Personally I recommend Gmail. Not only does it give over 2.5GB of storage, which is enough to keep anyone happy for a long time, it is also the fastest mail interface that I have ever seen. Once you’ve chosen your mail service, you can go looking for extensions. Once again GMail has a large number of extensions, but Yahoo also has a fair number. i personally use GMail Manager and GMail skins.

RSS Feeds
A growing number of people are using RSS feeds, to keep track of everything from news to blogs. While Firefox uses Live Bookmarks to fetch RSS headlines, you might want something like a complete RSS Reader. In that case you might want to try out Wizz RSS Reader. This does a very good jub of keeping track of and presenting your feeds in a clean and easy interface. There is also a large amount of documentation easily available. It’s a must have on the road to turn Firefox into Superfox.

Enough for today. Tomorrow we cover two more important net activities: blogging and IM. As always, comments welcome.

Firefox, Opera, Gmail, RSS

Extend the Firefox into a Superfox

Ever since Firefox started making waves, one of the major questions peopled asked and continue ask are “What makes Firefox so popular?”. Many people have many answers. Personally I think one of Firefox’s strengths is the community behind it. Many people who use the browser everyday contribute various add-ons and improvements, thereby making it a prime example of open source at work. The community doesn’t contribute just by adding source code to the final release, but more importantly by contributing small tools called Extensions which extend Firefox beyond just a simple web browser.

A few months ago the Mozilla Foundation announced the winners of the Extend Firefox contest, i.e. the best Firefox extensions available on the web. If you use Firefox, and you should be, then this is one things that you should probably check out. Now Firefox extensions are one of Firefox’s major features and the main reason why non-open source browser like Internet Explorer or even Opera will have a hard time winning over Firefox users. Extensions add extra functionality to the Firefox. With the right combination of Extensions it is possible to make Firefox into something much more than just a simple browser.
In the old days before Firefox, when Internet Explorer was unquestionably the King of the Hill, one of the premier open source browsers was Mozilla. But Mozilla was much more than just a browser. It had an integrated email client, an HTML editor and an IRC chat client all wrapped together. In fact, it was not unlike the old Netscape suite. Of course now, the Mozilla suite has been officially shelved and its parts have been divided up. The browser became Firefox, the mail client became Thunderbird and the HTML editor is now Nvu (all these after numerous changes and improvements though). For most people having these applications separated makes sense. After all less people use email clients than they do browsers and even fewer use an HTML editor. But what if you do want to combine your internet activities into one program? Going back to the old Mozilla is not recommended, especially since there is a far better option: use Extensions.
The following posts will show you how to use the correct extensions, and a few online services to turn simple Firefox into a powerful internet utility: A Superfox! Stay tuned folks.

Tags: Firefox, Opera

Why India’s IT success depresses me

 India is the world’s next IT superpower. Bangalore == Silicon Valley. India’s computer engineers are the best in the world, etc. etc. And yes, it depresses me. The reason goes something like this: Our so-called success in the IT world has left most Indians with a very skewed perspective of what computer technology really is all about and what the computer industry really means. Despite the fact that ther are so many IT professionals coming from and working in this country, it has done little to benefit our society. But wait a minute, doesn’t the IT industry bring in millions of dollars of foreign revenue each year? Yes, it does. Isn’t that a good thing? Yes, it is. So why are you saying it hasn’t helped our economy? That’s not what I’m saying at all. The economy might be booming, but there’s more to a nation and national pride than the economy. Go back a few lines and read what I said: it doesn’t benefit our society.
    The IT industry has done little to benefit our society because for the last few years, it has been developing in an economically viable, but socially demoralising way. The reason is outsourcing. Yes this an outsourcing rant, not anti-, just a rant. And it’s from the perspective of those who are supposed to be benefiting from the whole thing. IT sourcing has not benefitted the society because the proliferation of the IT industry has not been geared towards the best interests of our nation or our people. Instead of building software that common people around the world, or even in our own country use everyday, the industry has been and is building software especially for American and European companies. The result is that though we know that our IT industry is a multi-billion dollar affair, most Indians, even those that use computers at home or work everyday, have little idea as to what they actually do that’s raking in the dollars. A small example, everyone aroud the world knows that Microsoft makes Windows, Apple makes Macs, Sun Microsystems makes Java, Google does search engines. But how many Indians know what Infosys makes? I don’t.
    Instead of building software for ourselves and our people, we’re making software for others and becoming dependant on what they want us to do and what tools they want us to use. The IT boom in our country has served to help only the ones who make money out of selling their services, and the Government who collects the taxes. The common Indian benefits in no way whatsoever, not even an increased sense of national pride, because India is the world’s back office. The Americans started the whole computer thing decades ago and it has helped them no end. Not only are American companies like Google and Microsoft household names, but Americans like Alan Turing and Steve Jobs are respected by computer scientists the world over. Money is one thing, respect and recognition is quite another. The US and Europe managed to get where they are because the top computer scientists either do research at national universities or do R&D at companies that are leading the industry in terms of innovation. But the best Indian students graduating from the IITs are encouraged to get a job or an MBA and spend the rest of their life taking orders from other people (or giving orders to people to do things that they don’t really want to). Instead of leading the world in terms of innovation, our computer engineers are being compared to Chinese sweat shop workers, producing cheap goods. This whole orientation towards doing what will get us money from the outside is harming our own nation. There is very little software in Indian languages and what there is, is below acceptable standards. We do not even have keyboards in most native languages, or even standardized character sets for the common languages of our country. That is something that the Chinese and Japanese do have. The whole effect is that though our people may know better English, our own languages and with them our sense of being Indian gets devalued day by day. So much for national pride.
    Now to outsourcing proper. Once again outsourcing helps our economy, but hits our society. Call-centre workers have nearly non-existent social lives and more importantly, outsourcing draws our talented workers from where they’re needed most: writing software to help our own people. If all the programming and design talent could be diverted to writing software for the common Indian user, it would not be too unreasonable to create a independent operating system, available in all major Indian languages, with Indian language equivalents of office software, email programs and browsers. We would no longer have to pay a ransom to Microsoft or resort to pirated software. We could also create specialised data standards to better exchange Indian langauge information and in the end, combine with Chinese hardware to build PCs that even the lower middle class citizen can afford. Of course this will never happen. The government would have to spend insanely high amounts to lure away the needed talent from the IT industry (IT workers may be paid a pittance compared to Western counterparts, but it’s still more than most Indians) and build the data infrastructure and would have to work with minimal investment returns for a number of years. Why would the government spend so much money when they can earn lots more by encouraging outsourcing? The Indian outsourcing boom might be dentrimental to our society, but doing away with it would be economic suicide. Once again Indians in general lose, just as they have been losing out through the centuries. One tends to get the feeling that Indians are happiest when they’re doing what others tell them to do.

How I learn to program: The tools of the trade

This is a continuation of the last post. I’m going into what are the actual tools you need to start on the way to becoming a programmer, where you can get them and how to put them to use.A Brief Introduction
Before I start on what tools to actually use, let me give you some background on computer languages and programming. If you already know all about that, move on. The basics are pretty simple: The only thing that computers really understand is a string of 1’s and 0’s, that is, on and offs for the processors many transistors. However writing instructions in this binary language is enough to drive anyone mad after some time. Over the fifty years or so that computers have been around, many alternatives have been developed to allow people to program by using a language closer to everyday English. This process started off with assembly language, hexadecimal codes and continues upto today’s languages of C++, Java, Python etc. But all the same computers still understand only binary. So you need something that will take your close-to-English program and turn it into computerese binary. This task is done either by a compiler or an interpreter.
Now, both a compiler and an interpreter do essentially the same task of translating your program to binary. But they do it in slightly different ways. A compiler ploughs through the whole program, checks for grammatical (syntax) errors and then spits out a binary equivalent. You can then run this binary equivalent whenever you like. Though this method generates fast and efficient binary code, the problem is that if you’ve made a non-grammatical error (like told the program to say “no” when it should have said “yes”), you have to wait for the whole thing to compile before finding out what the error was, and once you’ve fixed it, you have to compile it again. As you can well imagine, this process can be time consuming.
Interpreters sidestep this whole program altogether. An interpreter reads a line of program code at a time, translates it to binary, and executes it then and there. The good news is that this makes error checking a lot faster. But on the down side, program execution can be somewhat slower as the interpreter does a lot more work than just execution. There is also the added hassle of needing an interpreter installed anywhere that you want to run the program.
However, some languages, most notably Java, use a combination of the two. First your source is compiled into an intermediate language called a bytecode. At this stage you get to correct your grammatical errors. This bytecode is then interpreted into binary and executed by a Virtual Machine. The advantage this has over normal interpreted code is that you don’t have to move around the source code, only the bytecodes, and you just need a virtual machine instead of a full-fledged interpreter.

The Tools
    Now that you know all the theory about computer languages, time for some practical work. So what do you need to get started programming? Firstly a computer; secondly, an operating system. You probably use Windows, but Linux is much better for programming. If you’re reading this you probably have both. Then to really start programming, you need just two things: a text editor and a compiler/interpreter for your language. A text editor is where you type in your program. After you’ve finished typing, save the file with the appropriate main and extension and then hand it over to you compiler.
Compilers can generally be run from the command line. Each compiler has to be called in a slightly different way, but in general you just have to type in the name of the compiler followed by your program’s file name. That’s all. For C++, you can’t go wrong with the open source GCC compiler. It’s been around for years and has proven its worth many times over. If you feel like a cup of Java, it’s probably best to go in for Sun’s own free SDK. There is an open source Java compiler called the GCJ, but it’s still quite new and you might want to wait a while before starting on it. However if you’re new to programming, I do recommend starting off with Python. You can get all the things you need from Python.org. If you’re on Linux, the C++ compiler and Python interpreter will probably be preinstalled. If you’re on Windows, you’ll have to download and install them separately.
It’s another story for text editors though. Text editors are a dime a dozen. Some are very basic, some are very advanced. It’s up to you to find the one with the features to match your preferences. If you’re on Windows, you might want to try out the ConText editor. It’s simple, easy to use and highly customizable (and my first real editor). On Linux Kate and Gedit are extremely good. Of course, if you want to feel a bit more sophisticated, you might want to check out Vim or Emacs. Don’t let them scare you though.
Of course, the whole command line thing might get very tiring after a little while. Though it is the best way to start off and many will argue that it’s all that you’ll ever need for the job (which is true), it can be more aesthetic to use an IDE to automate some things. But be warned: Most IDE’s are incredibly complex and feature packed gadgets. Like any tool, their use has to be learned carefully and they can be quite intimidating to people who don’t know what they’re doing. You probably shouldn’t go near them until you get around to writing reasonably big programs. That being said, there are some IDE’s which even relatively new programmers can use without getting overwhelmed. For C++ on Windows, Bloodshed Dev is very clean and streamlined and is forgiving for new users. On Linux you could take Anjuta for a spin. KDevelop is also a big favourite, but you won’t be using most of it’s features unless you’re writing big, multiple source file projects. There are a number of Python IDE’s available on both Windows and Linux. The IDE that Python comes with is IDLE, and it is very clean. Just type your code and press a button to run it. Simple. Once you get bored with that, you could try out others like Eric3 or SPE. I personally use SPE because I find Eric3 too cluttered. For Java, Eclipse is a really great IDE, but it’s a memory hog and if you don’t have the resources, you’ll soon be screaming “Give me back my RAM and clock-cycles”. I personally find BlueJ very nice. It was my first IDE ever and I think that it achieves its purpose of letting you “learn the language without learning the IDE”.

That should give you enough information to get out there and do some coding. The reason that I’ve focussed on C++, Java and Python is that most people that I know started programming on C++ or Java and that Python really is a very good starter’s language. It’s simple to use, easy to run, unlike C++ and Java there are few set rules which allow you to proceed at your own pace and develop your style of programming. Have fun coding and remember that most of the tools I’ve listed are Open Source and all are free. So once you do become a master coder, please give back to the community that helped you on your way.

Tags: , , C++, Java