Beginner programming language for writing a cross-platform Graphical app?
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Beginner programming language for writing a cross-platform Graphical app?
Hello,
I've been using linux for awhile and am fairly proficient at bash scripting, and would like to move on to something more advanced. I have the summer pretty much free, so I thought it would be a good time to learn to do actual coding.
I have an idea for the program I want to make. I am majoring in Classical Greek Philology (language), and I want to create a program that works in such a way that a student in type in a word, it's definition, dictionary forms, the line it appeared it, etc. and then it creates an index of words for review, kind of like a personal dictionary, which the program can then format and export in a printable format (.pdf, .txt, .doc, etc.)
The language I need would have to be
1) Cross platform, so that I can distribute it to all the windows users.
2) Have a GUI
3) Have the ability to incorperate beta code, i.e. a way to type in Greek using an English keyboard. So that a = alpha, b = beta, q = theta, you can see it in action at typegreek.com The program that website uses is written in javascript, under a creative-commons license. So if either the program could be written in javascript, or incorporate it, it would be really helpful.
Java seems a fairly reasonable choice. It can easily do a cross-platform GUI application, and a lot of people recommend it as a first language now anyway (my understanding is that most computer science courses now focus on Java for beginners now as well).
I would suggest that you look at the database component of open office (open base). Whilst this is not a programming language as such your requirement appear to be more towards a database than a programming language. I have to admit that I've not looked at it for quite some time but they were working on a front end similar to MS Access how well that has developed I'm not sure.
I would suggest that this approach will help you to develop an understanding of databases and the structure that your program will require, along with the ability to fairly quickly solve points 1) and 2). Your third point I'm not so certain how easy it will be to achieve but I think that can be done within the open base framework (it supports a version of BASIC)
You may want to have a look at Qt (www.qtsoftware.com). While not actually a language, it provides many of the features you're requesting to several languages (C++ natively; Ruby, Python, Java and others via bindings):
* It's cross-platform (Linux, Windows, Mac OS and others).
* Makes building modern GUIs pretty easy (either by hand-writing code or by using the graphical ui designer).
* Fully Unicode-enabled, so incorporating greek text is easy. Translating latin to greek letters should be feasible by intercepting key events.
* Includes a JavaScript interpreter (more precisely: it has its own ECMA script derivative called Qt Script). If you really want to try re-using code from typegreek.com (which may not be the easiest solution), there should be a way; if not via Qt Script, then probably by using the built-in web browser component Webkit (which supports JavaScript and can be used for building a WYSIWYG style editor, there's a demo for that somewhere).
* Include support for export to PDF (TXT should be easy in any case). If you really need DOC export, you probably want to figure out a way of reusing the functionality of OpenOffice or KOffice (no matter what language/framework you end up choosing).
Also features very good documentation, many demos and lots of (open source) applications using it.
It's worth noting that the above should also be possible with Java/Swing/additional libraries or C/Gtk/related libraries. I'll leave it to people more familiar with those to advertise them.
As for the language, while C++ is certainly not the worst choice as a first language for "actual coding", it has a few gotchas (memory management, different string handling (char*/std::string/QString) in different libraries, compilation and linking to libraries on different platforms). For a self-contained application, using an IDE can mitigate those problems; but if you intend to use libraries (other than Qt, wich has its own IDE and glue code for others), you may want to look for a scripting language (Ruby, Python, Perl, Falcon, Lua...) which has either a native library or bindings to a library with the extra functions you need.
Hope that helps you with the decision, and good look for your application.
I also would suggest JAVA. It has everything you need and is backed by the biggest IT firms in the business (IBM, Oracle, Google, Sun, Amazon). This way you know that what you learn will be arround for a long while.
Since you say you want something light, I would suggest you to use Python with cross-platform widget toolkit like GTK+ or QT, which will make your app. cross-platform. Also scripting is a bit easier to learn than to learn a compiled language like C or Java. If you are fine with C with GTK+ or QT then go ahead, it will sure be the fastest next to Assembly For a desktop application, I would surely advice against using Java due to it's performance.
You can check out Artha ~ An English thesaurus, which is written in C using GTK+ widgets and see how it performs.
Last edited by legends2k; 06-29-2009 at 06:40 AM.
Reason: Added additional info
You can also try Python, it's easier than C++, and you write less code than in Java.
For GUI I recommend QT. There is an excellent book that explains almost everything you need to know about python+QT, and it's also for beginners. Here is the link to it's web page: http://www.qtrac.eu/pyqtbook.html. It has examples and exercises for each chapter(with solutions).
3) Have the ability ... to type in Greek using an English keyboard.
At least some Linux distributions have this capability already.
I am using an (old) version of SuSE Linux, and have set up my
system so that there is an icon on the taskbar that shows what
the current input language is. Each time I click on it, the input
language cycles through all the input languages that I have
enabled (French, German, Russian, etc.). I have not looked at
Greek, since I don't know it, but I would be highly surprised
if it were not among the available input languages.
So, I would suggest dropping this requirement from your search
for a programming language and handle that requirement on the
operating system level. Look in your system's configuration
system, which may be called "control center", or something
like that. The appropriate settings may be in a section having
to do with the keyboard or in a separate section concerning
"international settings", or something like that.
The only other thing you have to be sure of is that whatever
system you use to store your data have the ability to handle
Greek. I would strongly advise storing everything in Unicode,
if possible.
The only special requirement on the programming language that
I can see is that it be able to handle Unicode data. This can
be an issue with languages like C/C++, where you might need
to use the right datatype declaration, however my impression
is that today many higher-level programming/scripting languages
have this capability built in.
P.S. You should consider just using web forms with a web browser
for everything except the database. I think that they can easily
do everything you want.
Good luck,
Tom
Distribution: Ubuntu, Ubuntu Server, Linux From Scratch, Fedora, Mac OSX, and Windows sometimes.
Posts: 20
Rep:
As professional programmer, with several programming languages, not to mention dialects floating around in my head, I would suggest Python to learn first. You can try stuff out immediately with the interpreter, which accelerates learning the language. Skills in python will carry over to other languages as well.
There are a number of cross platform GUI libraries for Python, my personal favourite being wxPython, which is a binding to the C++ wxWidgets. Handy if you move on to C++. There are plenty of other cross platform GUI libraries to choose from too, including GTK and QT.
Also Python 2.6 and onwards handle unicode strings very well, so characters with accents and other things can be handled easily.
There is a wealth of modules for python, and no doubt there will be one to write pdf files or whatever you want files, and also any database you might want to use. I would look at Sqlite. It should fit with what you want to do. That or just save all your definitions etc, as text files, in some format (XML?).
If you decide to use C/C++ as Language, then I recommend wxWidgets as base Library.
wxWidgest provides you with a multiplattform GUI, Basic Classes for handling Documents and text. Basic Html decoders for easy, fast aproaches. All sorts of datatypes like hashes, Lists and other STLs.
I have another cool Framework for Java in mind you could use. You write your Application, and the Framework handles the GUI. Really cool stuff just forgot the name. Ill post it when I found the article in my paper archive.
Of Course you can also use python (very easy to learn Object Orientated Language) or perl (perl will give you fast results, and it is quite mighty on text operations by nature). I personally would again prefer wxWigets bindings over QT. But thats more personal taste I guess. (that would be wxpython or wxperl.)
IMHO it doesnt matter much what Language you start in. The Concepts are always similar. Only focus on one Language if you really want to enter deep into that Language. I.E. if you want a job within Java then go java. Else look what you think is most convenient or easy to grasp to you.
I would recommend Python also. As a starter language it offers much, being easy to write more than just 'hello world' style programs, while also offering great potential in terms of power (it's used a lot by google for in-house stuff).
I would also recommend looking at Java, particularly if you are interested in a career as a programmer... but try Python first... for your own sake.
Thanks for the suggestions, I've heard a lot about python in the past, and have always wanted to try it. My only concern is that I want to be able to package the entire app in a zip archive or something so that my friends in Windows will be able to use it. As in, I don't want to have to provide an 12 step installation guide to all my friends who don't use linux. Would I be able to have my classmates simply unzip the program + files and begin using the app?
psisquare, Would Qt just be the graphical front-end, then? Or could, theoretically, the entire app be written in Qt? And would I be able to hand my friends an easily installable application or exe?
psisquare, Would Qt just be the graphical front-end, then? Or could, theoretically, the entire app be written in Qt? And would I be able to hand my friends an easily installable application or exe?
Again, Qt is not a language, so your app wouldn't be written "in" Qt but "using" Qt. However, it can be used for more than just the front-end, since it provides container classes, portable filesystem access, configuration management, XML read/write, a build system and more. I think this is best expressed by saying that Qt is an application development framework. While an application technically isn't written "in" Qt, it's entirely conceivable to write a complex application which uses no other libraries besides Qt's.
The answer to your last question depends on the language you choose. For C++, you'll have to compile your application on a Windows system. The result is an .exe, which you'll have to pass on together with the (Qt) libs it uses. You can simply zip those files, which means your friends will have to extract the archive somewhere and run the application from there. It's also not hard to produce a setup routine, for instance using the Nullsoft system (http://nsis.sourceforge.net). That's the solution I'm most familiar with.
For Python, I vaguely remember that there's a tool for wrapping the interpreter, an application and all of its dependencies into one executable. Unfortunately, I've forgotten what it's called. Maybe someone else here knows.
Other scripting languages will most likely require all users of your applications to install the complete runtime environment (including GUI libs and their bindings). This can be automated by a setup routine, but will probably be more complicated than distributing binaries (i.e., .exe plus libraries).
Java applications can be bundled into .jar files containing the application and libraries it uses. However, users will need to install a Java runtime environment. Again, this could be wrapped by a custom setup routine which also puts the .jar somewhere and creates a menu entry.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.