ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
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.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
I'm not a programmer but now find myself needing to code a pretty complicated database driven app. Basically, the application will need to manage suppliers and customers that I have in a database and generate requests for quotation, orders, etc.
Is there some language that is powerful, and yet simple enough for me to tackle this in? Preferably something that would give good UI response time (so not web based), and have good documentation/forum support.
Cross-platform in not necessary but it would be nice. Otherwise as long as it runs on linux it would be great. I'd also like the app to be stable enough to support somebody upgrading their desktop. That is, it shouldn't break after an apt-get dist-upgrade changes a gcc version or gtk version or perl verison or whatever.
I would go with Perl and MySQL (although Postgresql and others are just as good or better). Your database may be simple enough for flat files. However, relational databases provide much more room for groth and maintainance. I'm not sure about your experience but You'll need to learn some basics about databases design and SQL. As far as the interface goes, you can make it in anything capable of interfacing your database (C, C++, Perl, PHP, etc.)
I'd like to stick with one language (I'm not a programmer and so the less syntax the better) for both the interface and underpinnings. I had really thought Perl was only a scripting language.. <<braces for impact>> but so I'm intrigued by all the recommendations. My intial thought was to go with Python.
How do things like GTK2+ compare with this? Can they be used to code as well? Are they complementary or would they replace something like Perl/Python.
Perl or Phython, take your pick. Yes, they are scripting languages. I would normally code it in a language such as C or C++ (because I am more comfortable with them). GTK2+ is not a language it is a graphical toolkit (just as Qt, Athena, etc..) So if you actually want to make "Windows" you should complement your language with a solution like GTK for your GUI. And back to the database, you can use flat files or a database solution such as MySQL, PostgreSQL, or even an embedded db like sqlite. I would choose to use an existing DB as it will take ALOT of the work out for you.
I don't have much perl experience, that's why I am not sure if it is good for "a pretty complicated database driven app" "that would give good UI response time". To me this sounds more like something Java is better for, since crossplatform is also a plus.
For application development, I'd stick with an Object Oriented language rather than a script language. With good design, you will have an easier time developing and maintaining your application.
Here is what I have that might help you get started with Java, and there are GUI builders for Java apps you can find.
Java would be good. However one requirement is "that [it] would give good UI response time." I don't know if you've ever run Java on a Windows machine, but the VM is very slow. Especially while processing the gui.
Actually, the app I want to write is currently written in java. The UI is ok but whenever there's a lot of dbase activity (if I'm pulling up a GUI screen that requires lots of data) the response is really really slow. I'm not sure if that could be fixed by a better dbase design (using mysql) or what. Like I said, I'm no expert. In fact I'm happy just to know how to spell java...
Speaking of being a newbie, here are some stupid questions.. What's a toolkit? Can one use GTK with any language (java, perl, python)? Would I have to 'learn' GTK like I would learn to use bluefish (i.e. it's a tool that I need to learn how to use) or would I have to 'learn' it like I would python or java (in which case it may just be easier to not use it.)
Actually, the app I want to write is currently written in java. The UI is ok but whenever there's a lot of dbase activity (if I'm pulling up a GUI screen that requires lots of data) the response is really really slow. I'm not sure if that could be fixed by a better dbase design (using mysql) or what.
When working with lots of data does take time, for example a search on LinuxQuestions.org would take a while. To find out if it is java that's slow or the way you are getting data from the database, try to run the exact SQL commands you are using in your Java application and see how long those take. Sometime you can improve the performance with smarter SQL commands.
Actually, the app I want to write is currently written in java. The UI is ok but whenever there's a lot of dbase activity (if I'm pulling up a GUI screen that requires lots of data) the response is really really slow.
You've got to figure out where your bottleneck is. If it's the database access that's slowing you down, it doesn't matter *what* language you write your app in, it's still going to be slowed down by that db access.
Incidentally, Java apps are pretty fast once they've had time to load up (Java GUI apps tend to take a while to load and also use up a lot of memory though).
Speaking of being a newbie, here are some stupid questions.. What's a toolkit?
A library of code that someone else has already written -- all you need to do is make use of it (call the functions that the other person already wrote for you).
Can one use GTK with any language (java, perl, python)?
Yes, if someone else has already come along and written "bindings" for you (which, in this case, they have). GTK+ is written in C. There is a sort of "glue code" that makes it so you can call those C functions from your [insert preferred language] code.
Would I have to 'learn' GTK like I would learn to use bluefish (i.e. it's a tool that I need to learn how to use) or would I have to 'learn' it like I would python or java (in which case it may just be easier to not use it.)
Neither. You'd need to learn GTK+ in the sense that you'd need to learn about the GTK+ functions (eg. why you'd call them, what they do, which args to pass to pass to them) available in the GTK+ toolkit. It's not as bad as it sounds though -- you only need to learn about the ones that you need. ;)
BTW, if your existing Java code is written well, the database logic will be nicely compartmentalized away from the Java GUI code. It should be pretty easy for you to learn enough Java to chop out the GUI code (leaving just a command line program behind) and see how fast your existing app runs when it doesn't have to draw the GUI. It would probably be a very good learning experience for you anyway. Java's not hard to learn. C is somewhat difficult. C++ is complex and very difficult to learn; and harder to master. Perl is easy to get started with with but I didn't like its TMTOWTDI philosophy. Python in one sweet ride. :)