Every Flavour Beans

“The time has come…to talk of many [technologies].” –Lewis Carroll(’The Walrus and the Carpenter’)
Development Tools. Web Frameworks. GNU/Linux. Nokia N800. Video Encoding.

July 30, 2006

Different Ways Of Taking Screenshots In GNU/Linux

Filed under: GNU/Linux, General — tabrez @ 1:57 pm

The ‘Print Screen’ Way

The simplest way to take a screenshot, whether in the GNOME desktop environment or in KDE, is to press the “Print Screen(PrtScr)” key on the keyboard. Most probably a small window(Dialog Box) will popup prompting to save the screenshot under a filename. This is what you will most likely see under GNOME when you press the “Print Screen” key:

Print Screen Dialog in GNOME

And a similar dialog box is presented by KSnapshot, a screen capturing utility, in KDE:

Print Screen Dialog in KDE

Just enter a name for the screenshot and click the ‘Save’ button. This is a very easy way to take screenshots in GNU/Linux when compared to the Microsoft Windows way of capturing the screen, where you need to open MS Paint or a similar program, copy the screenshot and then save it. In some distributions, a screen capturing utility might not be bound to the ‘PrtScr’ key on the keyboard; in that case, the mapping can be done manually(see this for more info) or a utility can be invoked from the system menu or command line to take the screenshots(which may not be as convenient as pressing a key on the keyboard, if you take a lot of screenshots).

Using a Screen Capturing Utility:

In GNOME:

From the GNOME panel, go to Desktop->Take a screenshot…

Run screen capturing utility from the GNOME menu

You can add this menu item to the main panel by right clicking on the panel, clicking on “Add to panel” and then selecting “Take Screenshot…” from the dialog box.

Add screen capturing utility to the GNOME panel

Or, run it from the shell:

sh# gnome-screenshot

In KDE:
K->Utilities->Take Screenshot
Access KSnapshot from the KDE menu
Or, run it from the shell:

sh# ksnapshot

The GIMP Way:

But if you are looking for more flexibility while taking the screenshots, then the screen capturing functionality provided by GIMP is what you are looking for, especially for GNOME as the basic screen capturing utility in it doesn’t allow delayed screen capturing(which is needed to capture mouse held over a menu item, for example). If GIMP is installed on your system, then load the program from Applications->Graphics->The GIMP(or something similar) and go to File->Acquire->Screenshot… to bring the dialog box similar to that of KSnapshot.

Take screenshots using GIMP

Here you can specify things like whether you want to take a screenshot of the entire screen or the active window only; whether you want to take the screenshot immediately or after a delay(in which time you can arrange the screen in the way you want to capture it). Once you take the screenshot from GIMP in this way, it will open the acquired screenshot in a window where you can view it and, if you want, you can also edit it(cropping, scaling etc). Then save the screenshot by going to File->Save.

GIMP shows the preview of the screenshot taken

Some of this flexibility(delaying screen capture etc) is available in KDE through the simple “Print Screen” approach too, but only GIMP shows a preview of the screenshot taken and allows you to edit it before saving.

The command-line Way

If you are not too fond of the graphical tools, then its equally simple to take the screenshots from a command-line.
Infact, some of these tools can be used irrespective of the desktop environment you are using(so works for fluxbox, enlightenment etc). My favourite way is to use the ‘import’ tool available in the ImageMagick package(you need to install this if its already not available on your system). Run the following command in a shell:

sh# import screenshot.png

and select the window you want to capture or select a region by pressing the left mouse button and dragging.

‘import’ is a actually a very powerful command which can be used in many ways to capture the screen. For example, to capture the entire screen and after some delay and resizing it, use the following command:

sh# import -window root -resize 400×300 -delay 200 screenshot.png

To see all the options available with import command, go to ImageMagick’s website.

End Note

There are a lot of options when it comes to capturing screen under GNU/Linux. While the import command is all about power, “Print Screen” is all about convenience. Use GIMP to further operate on the captured screenshot before posting it on a blog/website. It doesn’t end here: ’setterm -dump N’ command can be used to dump the contents of the terminal number N in a file named ’screen.dump’ if you are working in console mode; khtml2png is a software hosted at Sourceforge website that can be used to take screenshots of HTML websites. GNU/Linux has it all that is needed to post screenshots on the blogs and websites.


If you want to receive future posts by email, enter your email address here:

Related Posts:

  • MH Shot Tool Can Now Take Delayed Screenshots of Nokia N800
  • Different Ways of Taking Screenshots in Nokia N800
  • My Favourite Note-Taking Applications
  • About
  • Another system rescue story, using Ubuntu LiveCD
  • Setting Up Rails Development Environment on Fedora GNU/Linux
  • Killer Looks of KDE in Kubuntu Entices a Long Time GNOME User!

  • Readers who viewed this page, also viewed:


    July 22, 2006

    Create ASP.NET 1.0 & 2.0 Applications On GNU/Linux and Windows Using Mono XSP

    Filed under: GNU/Linux, Gentoo, Mono, Web — tabrez @ 12:39 pm

    This post assumes that Mono is installed on your system. The following links should help if it is not installed.

    Installing Mono on Gentoo and Ubuntu 5.10
    Installing Mono and XSP on Ubuntu 6.06
    Installing Mono and XSP on Fedora

    Installing Mono XSP on Gentoo

    #emerge xsp xsp2

    Installing Mono XSP on Debian/(K)Ubuntu

    #sudo apt-get install xsp xsp2

    Installing Complete Mono Environment(Mono, GTK#, XSP) on MS Windows

    1. Download the Mono installation file for MS Windows from the Mono website.
    2. Run the installer and follow the installation wizard.

    Go to the Mono menu in the Start menu(Start->All Programs->Mono[version]) to access all the applications installed as part of Mono.

    Your First ASP.NET 1.0 Application Using Mono XSP

    1. First create a directory to store the ASP.NET files and change to that directory. You can create the directory in your home directory.
      sh# mkdir aspnet && cd aspnet
    2. Create a sample ASP.NET page. Copy and paste the following code in two separate files(hello.aspx and hello.aspx.cs).
      hello.aspx
      HTML:
      1. <%@ Page language="c#" src="hello.aspx.cs"
      2.                     Inherits="HelloApp.HelloPage" AutoEventWireup="true" %>
      3.     <title>First Mono ASP.NET 1.0 Application</title>
      4.   </head>
      5.     <H1>Welcome to my page!</H1>
      6.     <form  runat="server">
      7.       Enter your name: <asp:TextBox id="name" runat="server" />
      8.       <asp:Button id="greet" Text="Greet" onClick="OnGreetClick" runat="server"/>
      9.     </form>
      10.     <br /><strong><asp:Label id="message" runat="server">Hello, World!
      11.             </asp:Label></strong>
      12.   </body>

      hello.aspx.cs
      C#:
      1. using System;
      2. using System.Web.UI.WebControls;
      3.  
      4. namespace HelloApp
      5. {
      6.    public class HelloPage : System.Web.UI.Page
      7.    {
      8.       protected Label message;
      9.       protected Button greet;
      10.       protected TextBox name;
      11.  
      12.       public void OnGreetClick(Object sender, EventArgs e)
      13.       {
      14.           message.Text = "Hello, " + name.Text;
      15.       }
      16.    }
      17. }

    3. From the same directory('aspnet'), start the XSP server:
      sh# xsp

      (you can press ENTER to terminate the XSP server process)

    4. Open a web browser, type the url http://localhost:8080/hello.aspx and press ENTER. You should see a web page with a text box and a message. Enter a name in the text box and click the "Greet" button to see the personalised greeting displayed.

    On MS Windows, go to the Mono menu in the Start menu(Start->All Programs->Mono[version]), select "Mono[version] Command Prompt" menu item. Create a directory(say 'c:\programs\aspnet'), change to that directory and copy the above two files in that directory. From the same directory, run 'xsp' commad to start the XSP webserver. Open a web browser and access the url http://localhost:8080/hello.aspx.

    Your First ASP.NET 2.0 Application Using Mono XSP

    To develop ASP.NET 2.0 applications using Mono XSP server, start 'xsp2' webserver instead of 'xsp'. Create a test ASP.NET 2.0 page(say 'hello2.aspx') and copy it in a folder. Run the following command from the same folder:

    sh# xsp2

    Go to http://localhost:8080/hello2.aspx to test the ASP.NET 2.0 page.


    If you want to receive future posts by email, enter your email address here:

    Related Posts:

  • Installing C#, Mono(.NET) & MonoDevelop in Ubuntu Dapper Drake 6.06
  • Installing C#/Mono(.NET)/MonoDevelop/XSP in Ubuntu Gutsy Gibbon(7.10)
  • C# & MonoDevelop (.NET) on Gentoo and Ubuntu
  • Writing Your First Program With Mono And MonoDevelop
  • Setting Up Rails Development Environment on Fedora GNU/Linux
  • “Hello, World” Web Application in Ruby on Rails using console
  • My Favourite Note-Taking Applications

  • Readers who viewed this page, also viewed:


    July 19, 2006

    Installing Ruby on GNU/Linux(Gentoo, (K)Ubuntu, Fedora, SUSE) And MS Windows

    Filed under: GNU/Linux, Gentoo, Ruby/Rails, Ubuntu — tabrez @ 12:05 pm

    Installing Ruby on Gentoo:

    To install Ruby on Gentoo, run the following command(as root) in a shell:

    sh# emerge ruby ruby-mode

    You can add a few 'USE' keywords if you want to install additional Ruby support(like database integration, CGI support etc). Add the following line to the /etc/portage/package.use file(keywords that are already present in 'USE' flag of /etc/make.conf file need not be added):

    dev-lang/ruby docs examples fastcgi mysql

    'ruby-mode' adds the ruby mode to the Emacs editor while editing .rb files. Use 'ruby-modes' to add similar support to XEmacs. You need to add some text to .emacs file from your home directory; see this to know how to do it.

    Installing Ruby on (K)Ubuntu:

    Preparation:

    A little note before you start installing Ruby on (K)Ubuntu:
    There are two versions of Ruby available in the Ubuntu repositories:

    • Ruby 1.8.4
    • Ruby 1.9.0

    1.8.4 version can be installed by appending 1.8(Eg. ruby1.8, irb1.8 etc) to the respective package names. Similarly, 1.9 version can be installed by appending 1.9(Eg. ruby1.9, irb1.9 etc) to the respective package names. If nothing is appended(Eg. ruby, irb etc), what debian considers as default version of ruby(currently 1.8.4) will be installed.

    Once Ruby is installed, the command to invoke the Ruby interpreter would depend on which version of it is installed. Like, if ruby1.8 is installed, ruby can be invoked using 'ruby' or 'ruby1.8' commands('ruby' will be a symbolic link to 'ruby1.8'):

    sh# ruby1.8 first.rb
    sh# ruby first.rb
    sh# ls -l `which ruby`
    lrwxrwxrwx 1 root root 7 2006-07-18 18:47 /usr/bin/ruby -> ruby1.8

    (the quotes in the third command are inverted quotes and not single quotes)

    Use 'ruby1.9' if 1.9 version is installed.

    If all this sounds confusing, just follow my recommended way of installing Ruby and skip the 'Optional' part.

    My recommended way of installing Ruby on (K)Ubuntu:

    To install Ruby on Ubuntu family of operating systems, type the following command in a shell:

    sh# sudo apt-get install ruby ruby1.8 libruby1.8 irb irb1.8 rdoc rdoc1.8 ri ri1.8 ruby1.8-examples ruby1.8-elisp ruby-manual rubybook

    (Or search and install these packages using Synaptic(on Ubuntu) or Adept(on Kubuntu) Package Manager.)

    Running commands like 'ruby', 'irb' etc will invoke the latest stable versions:

    sh# ruby -v
    ruby 1.8.4 (2005-12-24) [i486-linux]
    Optional

    To install the 1.9 version(which is not stable as of now), use the following command:

    sh# sudo apt-get install ruby ruby1.9 libruby1.9 irb irb1.9 rdoc rdoc1.9 ri ri1.9 ruby1.9-examples ruby1.8-elisp ruby-manual rubybook
    sh# ruby -v
    ruby 1.9.0 (2006-04-21) [i486-linux]

    Of course you can also have both 1.8.4 and 1.9 versions installed on the system at the same time. Run the following command to do so:

    sh# sudo apt-get install ruby ruby1.8 ruby1.9 libruby1.8 libruby1.9 irb irb1.8 irb1.9 rdoc rdoc1.8 rdoc1.9 ri ri1.8 ri1.9 ruby1.8-examples ruby1.9-examples ruby1.8-elisp ruby-manual rubybook

    In this case, use 'ruby' to execute the 1.8.4 version of the interpreter and use 'ruby1.9' to run the 1.9 version.

    sh# ruby -v
    ruby 1.8.4 (2005-12-24) [i486-linux]
    sh# ruby1.9 -v
    ruby 1.9.0 (2006-04-21) [i486-linux]

    What about ruby-gems?

    I don't recommend installing additional Ruby packages using the 'rubygems' utility if you use a distribution specific package manager(apt, emerge etc) to manage the software on your system. Debain community strongly discourages its use to install the ruby packages(rightly so), as it doesn't follow the package management conventions of Debian's package manager(and hence can mess up with it and stop it from working properly). Same goes for Gentoo OS too. Go here to read more information on this. But if Ruby is (one of) the most important software for you, then 'rubygems' can make it very easy to install the latest versions of Ruby related software, long before they are added to the Debian or Gentoo repositories. In that case, follow the documentation on how to install 'rubygems' and how to install Ruby packages using it from this page.

    In Gentoo, you can do this:

    sh# emerge rubygems

    Installing Ruby on Fedora/SUSE/Mandriva etc:

    Use RPMs! Hunt them down using google.com or rpmfind.net and then install them one by one in the order.
    Or use the package manager of each distribution('yum', 'yast' and 'urpmi' respectively) and hope for the best. I have tested with yum and yast and at least they did not create too many issues for me:

    Ruby on Fedora using yum:

    If the yum configuration files(fedora.repo etc) are properly setup, you can install Ruby using the following command:

    sh# yum install ruby.i386 ri.i386 ruby-mode.i386
    sh# ruby -v
    ruby 1.8.4 (2005-12-24) [i386-linux]

    Above command will install ruby, irb, ri, rdoc commands and Ruby mode for Emacs. You need to add the following line to '.emacs' file present in your home directory(create it otherwise) to enable Ruby mode in Emacs editor:

    (require 'ruby-mode)

    On SUSE, use YaST to install 'ruby', 'ruby-doc-ri' and 'rubygems' packages by searching for them from the YaST interface(YaST->Software Management->Search).

    sh# ruby -v
    ruby 1.8.2 (2004-12-25) [i586-linux]

    'ruby' and 'rubygems' are available on the SUSE 10.1 DVD itself; you can add repositories from the Internet to install the other Ruby packages(ruby-docs-ri etc), or use 'rubygems' to install them.
    Add the following in the YaST configuration (YaST->Installation Source) if you want to install 'ruby-docs-ri' from the Internet:

    Protocol: FTP
    Server Name: ftp.mirrorservice.org
    Directory on Server: /distribution/SL-10.0-OSS/inst-source/
    Authentication: Anonymous

    Another way would be to simply download all the needed RPM files by manually searching for them on the web and installing them directly without bothering with yast. Same can be done for Mandriva and other RPM based distributions.

    Installing Ruby on Microsoft Windows:

    Download the Ruby Windows installer file from the following url: Ruby 1.8.4
    (blog entries become outdated very soon; this is version 1.8.4, currently the latest stable version. Always Google for the latest stable version to check if this url still useful to compensate my laziness in updating the above link once a new version is released. 40+ words waster for the lack of Package Manager in Microsoft Windows.)

    Click on the installer file and follow the wizard. Once finished, you have three ways to run your Ruby programs(assuming its Windows XP):

    All the menu items are available at: Start->All Programs->Ruby-184-19, so first go there.
    Menu for Ruby Programs
    Then,

    1. Select fxri-Interactive Ruby Help & Console menu item to load the interactive Ruby interpreter. Run your Ruby programs at the 'irb' prompt.

      Interactive Ruby Shell(irb) And Help

    2. Select FreeRIDE menu item, which will open a minimal IDE to write, debug and run Ruby programs.

      FreeRIDE IDE For Ruby

    3. (Recommended)Use SciTE editor.
      Select SciTE menu item. This will open the excellent editor called SciTE that supports many programming languages other than Ruby, and is also available for many other operating systems(including GNU/Linux). Its one of the best programming editors available today.

      Programmable Editor SciTE for Ruby

    After finishing editing and saving the program with SciTE, go to the command prompt(Start->All Programs->Accessories->Command Prompt), change to the directory where you have saved the program and run it using the 'ruby' command.

    C:\myprogs>ruby first.rb

    End Note:

    This article describes the installation of basic Ruby software. There are many related packages that can be installed to get additional functionality, like database bindings for popular database software(mysql, postgre), email support, gui programming(gtk, qt), rails, soap etc. Hopefully, I will cover installation of these packages in a future article(also planning to post an article on using various popular IDEs(Eclipse, Komodo) to create Ruby programs in Windows and GNU/Linux OS), so check back if you are interested.


    If you want to receive future posts by email, enter your email address here:

    Related Posts:

  • Installing C++ Boost on SuSE and Fedora
  • Installing Ubuntu & Kubuntu Dapper(6.06 LTS) For NVidia GeForce Cards
  • Killer Looks of KDE in Kubuntu Entices a Long Time GNOME User!
  • Setting Up Rails Development Environment on Fedora GNU/Linux
  • Develop Ruby Applications Using JEdit Editor
  • Get Free GNU/Linux(Fedora, SUSE etc) CDs Delivered Anywhere Around The World
  • Installing amazon-ecs/hpricot RubyGem on Windows Operating System

  • Readers who viewed this page, also viewed:


    July 16, 2006

    Get Free GNU/Linux(Fedora, SUSE etc) CDs Delivered Anywhere Around The World

    Filed under: GNU/Linux, General — tabrez @ 2:45 pm

    Following the example set by Canonical Ltd in shipping Ubuntu family of distribution CD/DVDs free of cost to anywhere around the world, Ryab Cloke has taken the initiative of doing the same for non-Ubuntu GNU/Linux distributions. Ryab Cloke is the owner of the popular commercial store that sells GNU/Linux CD/DVDs for one of the cheapest prices among similar online stores. Through 'Free Linux Disks' project, he hopes to extend his dream of doing more for the community. It remains to be seen how successful this initiative will be as there is no big financial company to back the project, but Ryab Cloke is hopeful that, apart from their own investment towards the project, donations from the other quarters will keep the project going.

    There are other questions regarding the necessity of such a project when the GNU/Linux CDs are available for such cheap rates from so many online/local stores. The question being asked is if someone is not willing to pay $5 + shipping to buy a GNU/Linux CD, how reasonable is it to expect the same people to invest time and effort to install the GNU/Linux and get over the initial learning curve. From what I can see, though, the free shipping of the CDs will help tremendously in making GNU/Linux popular in third-world countries like India, as

    1. there are no/few local stores in such countries
    2. the shipping cost becomes a significant factor in such countries even if someone can afford the negligible $5 to buy the CDs.

    There were many requests for Ubuntu/Kubuntu CDs from such countries but the popularity, and hence demand, for Fedora and SUSE CDs is considerably more(according to my estimations). If the current project can hold the initial storm of requests and can get on its feet, then I am sure it will do a lot of good to popularising GNU/Linux in atleast the third-world countries. Another concern is that the abuse from some quarters (that is bound to be there) might get absorbed by a giant company like Canonical Ltd but the same may not hold true for the current project where every single donation seems to matter so much. Unless it finds solid support from the community.

    For those who are interested in requesting the the CD of their favourite GNU/Linux distribution, the procedure is very simple(even registeration is not needed!) and the interface very straighforward to follow. The following screenshots should provide a visual tour through the request process.

    Go to the home page of the website and scroll down to see the options available for selecting a GNU/Linux distribution of your choice.
    Select the GNU/Linux Distribution(Eg: Fedora)
    Once you select your favourite distribution, you need to fill out the shipping address where the CD/DVD needs to be delivered. You will get a confirmation email at the email address you specify in this form once you complete the request order successfully.
    Fill Your Address Details
    Just a confirmation to check if you have entered everything correctly. Click "Submit Request" button if everything is OK.
    Confirm Your Address Details

    After this, you are shown your confirmation code which you can later use to check the status of your request order. This confirmation code is also sent to the email address that you have provided while filling out the address form. Here is the status request form. (Use the 'Status' link at the top-right corner of the page to get here).
    Check Status of Your Order

    The current status of the request order is shown.
    Status of Your Order

    Do note that you can order only one distribution at a time and you won't be allowed to order another CD/DVD for 14 days. So select your choice of distribution carefully.
    You can't order another CD in the next 14 days

    You can also buy the GNU/Linux CD/DVDs for very cheap prices from the commercial store of the same website. A better option in my opinion if the shipping costs are not prohibitive.
    Buy cheap GNU/Linux CD/DVDs from commercial store

    Apart from donating towards the project(or becoming a sponsor), you can also support the project by adding a link to its website from your blog/website(lookout for a cool button on the home page of the website). And ofcourse, by spreading the good word about it.


    If you want to receive future posts by email, enter your email address here:

    Related Posts:

  • Linux Bible 2007 Edition: Install/Run 10+ GNU/Linux Distributions(Ubuntu, Fedora, Gentoo etc)
  • Installing C++ Boost on SuSE and Fedora
  • PC World’s Humorous Piece On Microsoft, Google, Yahoo’s Beta Services
  • What do you plan to do on the Software Freedom Day(Sep 15th)?
  • 7-Zip Compression Format Support on GNU/Linux Using p7zip
  • Burning a CD/DVD in GNU/Linux
  • Simple Way to Update Ubuntu Edgy With Slow/No Internet Connection

  • Readers who viewed this page, also viewed:


    July 12, 2006

    What Experts Say About The Java Language: Humorous Quotes

    Filed under: General, Java — tabrez @ 3:40 pm

    There has been so much hype and misinformation spread about the Java language and related technologies that it feels imperative to correct some of those myths associated with it. Far from attempting to put to rest many false acclamations about the language, here is just a small collection of my favourite quotes about the Java language and its 'killer features', some of them by the people who have a special interest in programming language design.

    "Ten years from now, Java will be taught in every university. Not in the engineering or computer science departments, but in the business and marketing courses. Java is one of the best examples of the triumph of marketing over technology." --Jim Turley

    Isn't it both true and funny? Or is it funny only because it is true? Just as one example, remind yourself about the hype created over the plarform indenpendence of the Java language. Write once, Run everywhere. How true this statement has turned out to be is no big secret today. The following extract from the book 'Inside Java Virtual Machines' is NOT a humorous quote. Well, read it on your
    own and find out if it sounds funny or not regarding the BIG promise of Java about the platform independence.

    Seven Steps to Platform Independence

    1. Choose a set of host computers and devices that you will claim your program runs on (your "target hosts").
    2. Choose an edition and version of the Java Platform that you feel is well enough distributed among your target hosts. Write your program to run on this version of the Java Platform.
    3. For each target host, choose a set of Java Platform implementations that you will claim your program runs on (your "target runtimes").
    4. Write your program so that it accesses the host computer only through the standard runtime libraries of the Java API. (Don't invoke native methods, or use vendor-specific libraries that invoke native methods.)
    5. Write your program so that it doesn't depend for correctness on timely finalization by the garbage collector or on thread prioritization.
    6. Strive to design a user interface that works well on all of your target hosts.
    7. Test your program on all of your target runtimes and all of your target hosts.
    8. If you follow the seven steps outlined above, your Java program will definitely run on all your target hosts.
      --Bill Venners[Chapter 2 of Inside the Java Virtual Machine]

    After criticising all the features of C++ that were not included in Java to be 'unncessary sources of complexities in the programs', generics(and enums etc) were added to the language eventually(perhaps too late in the day). After referring to C++ as a legacy/obsolete language right since the first release of the Java language, C++ language support is now being included in even a popular Java IDE like NetBeans.

    Sun announces C/C++ support for NetBeans IDE
    March 23, 2006

    Why support an old, legacy, complex and idiotic language in 2006??
    --Unknown Source


    Alexander Stepanov
    is the creator of STL. He claims that he has not found his ideal language in any of the existent ones and would love to create one if he is funded by someone. Let's hear what he has to say about Java language:

    "I spent several months programming in Java. Contrary to its author's prediction, it did not grow on me. I did not find any new insights - for the first time in my life programming in a new language did not bring me new insights. It keeps all the stuff that I never use in C++ - inheritance, virtuals - OO gook - and removes the stuff that I find useful. It might be successful... but it has no intellectual value whatsoever"
    --Alexander Stepanov

    It was refreshing to hear similar sentiments expressed about the Java language by someone else too. Though Java has been useful in solving many a problems more easily than some of the other languages, 'no intellectual value whatsoever' quality of it has exactly been my own opinion about the language. It fails to teach anything new to someone who already knows a few other languages.

    Alex Stepanov continues:

    "It[Java] might be successful - after all, MS DOS was - and it might be a profitable thing for all your readers to learn Java, but it has no intellectual value whatsoever. Look at their implementation of hash tables. Look at the sorting routines that come with their "cool" sorting applet. Try to use AWT. The best way to judge a language is to look at the code written by its proponents. "Radix enim omnium malorum est cupiditas" - and Java is clearly an example of a money oriented programming (MOP). As the chief proponent of Java at SGI told me: "Alex, you have to go where the money is." But I do not particularly want to go where the money is - it usually does not smell nice there."

    Answering another question about the difference between Generic programming and OO programming, Alex replies:

    "My approach[Generic Programming] works, theirs[OO Programming] does not work. Try to implement a simple thing in the object oriented way, say, max. I do not know how it can be done. Using generic programming I can write:
    [Example Generic Code for max routine]
    Try doing it in Java. You can't write a generic max() in Java that takes two arguments of some type and has a return value of that same type. Inheritance and interfaces don't help. And if they cannot implement max or swap or linear search, what chances do they have to implement really complex stuff? These are my litmus tests: if a language allows me to implement max and swap and linear search generically - then it has some potential."

    Here is what Alex feels about Object Oriented paradigm:

    "And I had many false starts. For example, I spent years trying to find some use for inheritance and virtuals, before I understood why that mechanism was fundamentally flawed and should not be used."

    More on Object Oriented paradigm by Alex:

    "I think that object orientedness is almost as much of a hoax as Artificial Intelligence. I have yet to see an interesting piece of code that comes from these OO people. In a sense, I am unfair to AI: I learned a lot of stuff from the MIT AI Lab crowd, they have done some really fundamental work: Bill Gosper's Hakmem is one of the best things for a programmer to read. AI might not have had a serious foundation, but it produced Gosper and Stallman (Emacs), Moses (Macsyma) and Sussman (Scheme, together with Guy Steele). I find OOP technically unsound. It attempts to decompose the world in terms of interfaces that vary on a single type. To deal with the real problems you need multisorted algebras - families of interfaces that span multiple types. I find OOP philosophically unsound. It claims that everything is an object. Even if it is true it is not very interesting - saying that everything is an object is saying nothing at all. I find OOP methodologically wrong. It starts with classes. It is as if mathematicians would start with axioms. You do not start with axioms - you start with proofs. Only when you have found a bunch of related proofs, can you come up with axioms. You end with axioms. The same thing is true in programming: you have to start with interesting algorithms. Only when you understand them well, can you come up with an interface that will let them work. "
    Java is termed to be a superior language for the simple reason that it is (claimed to be) a purely object oriented language. Even if we buy this contrived claim by Sun and those who trust their word,

    The entire interview is very educative and insightful: Alex Stepanov's Interview

    Bjarne Stroustrup
    has always been guarded when making statements about the programming languages other than his own. He plainly refused to compare any language with C++ for obvious reasons. A few words that he did speak about Java/C# were very interesting and devoid of any bias.

    Much of the relative simplicity of Java is - like for most new languages - partly an illusion and partly a function of its incompleteness. As time passes, Java will grow significantly in size and complexity. It will double or triple in size and grow implementation-dependent extensions or libraries. That is the way every commercially successful language has developed. Just look at any language you consider successful on a large scale. I know of no exceptions, and there are good reasons for this phenomenon. [I wrote this before 2000; now see a preview of Java 1.5.]

    Bjarne Stroustrup hitting the bull's eye:


    "Java isn't platform independent; it is a platform. Like Windows, it is a proprietary commercial platform. That is, you can write programs for Windows/Intel or Java/JVM, and in each case you are writing code for a platform owned by a single corporation and tweaked for the commercial benefit of that corporation. It has been pointed out that you can write programs in any language for the JVM and associated operating systems facilities. However, the JVM, etc., are heavily biased in favor of Java. It is nowhere near being a general reasonably language-neutral VM/OS. "

    This is from the FAQ on Bjarne Stroustrup's home page:

    Q: How can a legacy language like C++ compete with modern, advanced languages?

    A: Naturally, calling C++ a legacy language shows a bias (see legacy code). That aside, people are usually thinking of Java or C# when they ask such a question. I will not compare C++ to those languages, but I can point out that "modern" doesn't necessarily mean "better", and that both Java and C# are rooted in 1980s style OOP to an even greater extent than early C++ was.

    There are many more but these are some of my favourites about Java. What are your favourite quotes about the programming languages?


    If you want to receive future posts by email, enter your email address here:

    Related Posts:

  • Is C++ really a bigger language than Java?
  • PC World’s Humorous Piece On Microsoft, Google, Yahoo’s Beta Services
  • Should I Be Developing Ajax Applications using Google Web Toolkit(GWT)?
  • Features I Would Like to See Added to the GMail Service
  • Java on Gentoo
  • Setting the Stage for C++ Boost
  • Develop Ruby Applications Using SciTE Editor

  • Readers who viewed this page, also viewed:


    Next Page »

    Copyright (c) 2006, 2007 Tabrez Iqbal.
    Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. Verbatim copying and distribution of this entire article is permitted in any medium without royalty provided this notice is preserved. A copy of the license is included in the section entitled "GNU Free Documentation License".


    Powered by WordPress
    This website is hosted by Dreamhost