RSS
 

Geany – A basic programming IDE for Linoobs

09 Jun

While learning Programming we do need tools to make our work simpler. One such tool is Geany which is basically a text editor with IDE like features, and focuses on simplicity rather than features. It supports a variety of languages which include (but not limited to) C, Java, JavaScript, PHP, HTML, CSS, Python, Perl, Ruby, Pascal and Haskell.

Installing Geany

Geany is in Ubuntu repos and can be easily installed via Synaptic, Software Center, and obviously through terminal.

sudo apt-get install geany

The Interface

As it can be seen from the screen shot, Geany has a pretty basic interface and new users won’t really be lost as it is like any other text editor in terms of simplicity.

How it works

Geany works on the file extension principle. When you save a text file of a program code with an extension, Geany corresponds to the appropriate compiler and interpreter and thus serves multiple languages. For example for .c extension it corresponds to gcc, .py for Python, .rb for Ruby, .pl for Perl, etc.
It does not have the advanced features of IDEs like Eclipse or Code::Blocks, but it serves perfectly for learning programming.
Also note that it’s only an IDE and does not have the corresponding compiler or interpreter. For that you need to download and set that separately. For instance you can install C/C++ compiler by:

sudo apt-get install build-essential

Geany having a very simple interface can be easily used for practicing programming or creating basic programs. For instance, you can create a C program like this:

#include<stdio.h>
int main()
{
    printf("Hello, World!");
    return 0;
}

Now you have to save the file with a .c extension, and compile the code by going to Build->Compile or simply pressing F8. To link the code you have to go to Build->Build or press F9. If your program has been compiled and linked correctly, you can simply execute it as Build->Execute or pressing F5.

And in case of Python:

#!/usr/bin/env python
print "Hello, World!"
#

Now in case of Python you simply execute the code by pressing F5, since Python is an interpreted language. You can also “compile” which basically checks for few syntax errors.

Similarly Geany works in plenty of languages and saves a lot of time particularly for beginner programmers since they don’t really have to change to a particular directory and invoke compiler by terminal.

Happy Programming.

 
Author :  

Tags: , , , , , , ,

  • http://www.thebestday.info Brit Chanco

    Thank you for great article!

  • http://www.linoob.com Gaurav aka GeekG

    Nice :)

  • Tonie Jandris

    I really appreciate the kind of topics you post here. Thanks for sharing us a great information that is actually helpful. Good day!

  • http://dobox.com/ Monica S.

    Hi, I’m very interested in Linux but Im a Super Newbie and I’m having trouble deciding on the right distribution for me (Havent you heard this a million times?) anyway here is my problem, I need a distribution that can switch between reading and writing in English and Japanese (Japanese Language Support) with out restarting the operating system.

  • http://www.linoob.com Gaurav aka GeekG

    All Ubuntu Versions Support Changing Language While Running The OS
    Else U can alwayz do that using Terminal in Realtime
    Wat U’ll just require is a logout and login that u can easily do

  • http://www.homesaleguide.com aion

    Hey admin, very informative blog post! Pleasee continue this awesome work..

  • C. Brow

    I want to do the “Teach Yourself C++ in 21 days” So, instead of putting .c to compile, build, and execute what would I put for this:
    1: #include
    2:
    3: int main()
    4: {
    5: cout << "Hello World!n";
    6: return 0;
    7: }

  • http://www.linoob.com Gaurav aka GeekG

    Save the file as .cpp instead of .c rest remains the same.
    Also you might find that you need to include different header files (as told in your book) to use certain functions.
    Here take a look http://i55.tinypic.com/2whjoe1.jpg

  • c.Brow

    Wow. Fast reply. Thank you. What am I missing. Sometimes it is the obvious that we can’t see.
    Step 1. I put in exactly like what example you linked me to
    Step 2. Saved file as hello.cpp
    Step 3. Clicked Compile
    Step 4. Clicked Build
    Step 5. Clicked Execute
    Hello not found
    program exited with code: 127

    Geany works when I use your tutorial for Hello World on this site page. I just want to use the How to…21 days but nothing I try seems to work. It must be too obvious for me to see!

  • http://www.linoob.com Gaurav aka GeekG

    Please refer the screenshot …I’ve personally tested it..If you are facing some problem please start a new thread at forum.
    Do add a screenshot …!!!

    If you are referring this link http://newdata.box.sk/bx/c/htm/ch01.htm then remember that compliers vary in their few syntax of implementing C++
    You have to use make few changes to make the code work .You just can’t just copy paste it.

  • abdullah

    how 2 compile?

  • Anonymous

    Goto build and there is an option to compile

  • Newbie
  • Rhizomio

    Subscribed!

    I’m running Lucid Puppy, and am having a problem with Geany. It’s not compiling when I execute. Do I need to set a Path?? How do I check whether I have the compiler installed? I found a .pet for Python 3.2 as I’m using Invent Your Own Games For Python, and when I use the Bash console it returns Python 3.2, so my syntax must be ok (it works on IDLE in Windoze, the first line is an import command, but then it won’t compile a print command either so…). 

    I’ll look into build essential, but phewee! I just want to get on learning Python on my fav OS.

  • http://www.linoob.com Linoob.com’s Admin

    Python can be used from Terminal itself..No need to go for geany if u want to learn it :)

    For geany this might be helpful for you

    http://www.youtube.com/watch?v=85RxqGRtDoA
    http://www.geany.org/Download/Extras

    And I’ll rather recommend you Eclipse for python due to its wide use

  • KrofGninut

    File extensions? That explains why I haven’t had any luck with it. Thanks!