11

I only know C and Java. And I really don't want to learn another language when I can work with what I already know. I haven't ever written a GTK+ application, but I am planning to start with an experimental project. So, are there any advantages of writing in Python over Java (with respect to GTK+)?

2

5 Answers 5

12

Python is a much more expressive language than Java. I used to be a very enthusiastic Java developer, but after I started using Python, I'll never go back. Python is quite simply a wonderful language for all kinds of different tasks.

I haven't actually programmed much GTK with Java, but there is at least some support for GObject Introspection, which will make many libraries available even if you use Java. Also, interfaces made in Glade will be usable from Java. Using Python is mostly a matter of comfort and not necessity.

5

I'm not 100% sure about this (only 99% :P) but I think it's because Python is preinstalled on Ubuntu while Java is not. Also Python integrates GTK+ really well (http://www.pygtk.org/). At least that's the reason why I prefer Python over Java although I can't say something about Java integration. And I like Python's syntax, documentation and community more.

But as sagarchalise already said, why don't you use C if you know it? You can create your GUIs with Glade and use it in C and Python and maybe other languages.

Besides: "I really don't want to learn another language when I can work with what I already know." is a rather ... suboptimal ... attitude. You should always try to expand your horizons and look how others do things. Python is a object-oriented imperative language too and as I always say: if you know one you know them all. Sure there are some things that differ but "learning" Python is easy peasy if you know Java. I'd say give it a try.

2
  • Java (for OpenOffice) is standard in Ubuntu, however there have been more bugs in it than other frameworks (Swing applications with goofy fonts/graphical glitches, for example.)
    – NoBugs
    Apr 15, 2014 at 1:34
  • 1
    @NoBugs correct me if I'm wrong but it is only the JRE that comes preinstalled, not the JDK. So you can't really start developing.
    – dAnjou
    Apr 27, 2014 at 13:47
1

I'm learning Python, as my first programming language (other than pascal in high school) I have tried learning C++ about 10 years ago and failed, never did anything with it, and I have a bunch of books on Java that I did'nt buy. And I am glad that Python is popular because it sure is a lot simpler to use than what I remember from my earlier programming days.

I don't know much about Python but if you know other languages you'll pick up Python quickly I guarantee it

0

But Canonical accepts in their repos apps made with Java, look at this:

Clic at: Programming Languajes

0

People choose different languages for different reasons, an important one being their familiarity with the particular language.

As for creating Gtk applications, if you know Java, you might consider Vala. It is a lot like Java but very well integrated into the Gnome/Gtk environment.

Not the answer you're looking for? Browse other questions tagged .