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.
You prolly saw the title and are wanted to bitch at me cuz you've prolly seen this exact title before, not to mention the question! Well i'm asking just like everybody else because i'm not a n00b to programming at all... just a n00b to programming in a language the can work with a Linux distribution.
Here are the languages i know.
1. Visual Basic (i started w/ this as most people do, it got me started but i have no use for it)
2. Java (i know this language very well, but i cant say i love the API.... not good enough for GUI's which i AM big on *wink* *wink*)
3. C++ (read a 400 page book on it but stopped due to small things i didn't like, such as no standard one way to do something simple as reading in an integer, but i'm willing to give it another try if it sounds promising)
4. C# (ahh my VERY favorite! I work in this all the time on windows and i love the API. It just made it's way to linux through Mono... primarily. The reason i haven't just jumped to this is cuz of the MAJOR trouble i had getting the IDE for it... there are like 50 dependencies which all have 50 of their own dependencies and so on :-P. I figure even if i dont end up using C# for Open-Source programming... i might as well learn how to get plain dependencies from a download manager... SO TELL ME HOW TO IN UR RESPONSE!!! THANKS!)
I basically just want a suggestion and a REASON (dont forget the reason or i'll think ur just biased cuz its the only one u know :-P) and please dig me outta a hole by telling me how to get dependencies the easy way (i use apt cuz i'm on debian, but tell me for yum too since i might go get it in a few). FYI I program ALL the time and am very determined and if it doesn't sound too braggy... pretty darn skilled and a fast learner. Dont let how hard the language is affect what u suggest. Also, dont hesitate to give multiple suggestions for your own reasons. Thanks again.
By the way.. EVERYBODY RESPOND even if its been answered, everybody has their own oppinion and i cant go with only 1. Hopefully this post will be referenced to many times and will be a great resource for newcomers to linux programming!
As far as graphics programming for Linux goes, the two major languages used tend to be C (with the gtk library), and C++ (with Qt or KDE).
The best integrated development environment I can recommend is kdevelop; originally designed for programming with the KDE libraries, it now supports most of the languages you mention.
In terms of getting dependencies, look first to your distro's install disks. If you install anything with your distro's setup tool, then it should install the dependencies for you as well.
Personally, for GUI programming I tend to either use Java in a simple text editor or C++ with Qt in KDevelop. The reason for this is just because I like their APIs. I messed around with Tcl/Tk for a while but I found it's really too intricate to learn for the occasional small task; it doesn't scale well to applications with a big non-graphical part.
For text processing, try Perl (which can be embedded into C or C++ if you're so inclined).
By the way, I don't mean to sound like I'm nagging, but if you want a post to be replied to a lot, then try not using block capitals unnecessarily (it makes people think you're yelling), and a little spelling might not go amiss either.
So C++ with QT for GUI's is what ur recommending? Another thing im wondering is QT something people are going to have to download or do ALL linux distributions have it, or does it have to do with wether they have KDE or Gnome. How would a Windows user run my program? Also how do i handle makefiles etc... or is that just something i ought to look up when i learn it. Thanks.
btw i used the capitals cuz i typed a LOT and there are certain things that must stand out to people who are just skimming through that load of text :-P. Sorry if i sounded like an angry built bald guy.
Guis with KDE look rather like the KDE desktop, I guess.
As to which goes best with the window manager, it depends on the Window manager. If you're running KDM (the default window manager for KDE), the a KDE app will probably look best. If you're running enlightenment (a window manager for Gnome), then try a Gtk+ app. For Afterstep, FvWM etc. there are other toolkits again.
A fair amount of the look and feel of a window is actually controlled by the window manager, so to a point all windows should blend in fairly well, regardless of which toolkit you use. (For example, the frame around the window is handled by the window manager).
When you say “windows” I assume you mean “Microsoft Windows”? If not, I'm not sure I follow your meaning; you can't really have a graphical application not in a window (even something like a screensaver draws in the root window).
A KDE app won't run on Windows (might do under Cygwin, I'm not sure). A Qt app can be compiled for Windows, and will look pretty much the same as on Linux. If cross-platform behaviour is a requirement, then your options are more limited — as a general rule, most Linux developers are interested in creating apps that they can use, not apps for an operating system they're not developing in, and having to add layers of complexity just so that one's code can run on a different system can be wasteful.
In C++, Qt is good for cross-platform work. Obviously, Java and (I think) C# should also work on Linux/Windows/Mac OS X. Also, most variations of BASIC (not including Microsoft Visual Basic!) as well as Perl and Tcl/Tk can be ported across platforms quite easily. There's bound to be a C library as well, I just can't think of one off the top of my head.
If you're interested in running arbitrary Linux code on Windows then you might look at Cygwin (http://www.cygwin.com/). To run Windows code on Linux, look at Wine (http://www.winehq.com/).
You might take a look at C++ with wxWidgets. You might also take a look at Python with wxPython, or perhaps any other language that has wxWidgets bindings.
I like Qt, but I like it better on Linux than I do on Windows. There isn't currently a GPL version of Qt available for Windows, so your option is to download the trial version from trolltech.com. It's been a while since I fooled with it, but if memory serves me correctly there was a pop up that'd appear everytime the application was run, not too mention it was only a 30 day trial. I've been toying around with wxPython some recently. I like it because wxWidgets actually is cross platform compatible, so long as your application doesn't utilize operating specific features. I chose wxPython, because I really don't have a lot of programming experience. I've toyed with C++ some, but for my uses thus far, it just feels like things are unnecessarily over complicated. This was a major turn off for me, and is the reason why I investigated Python, and have since taken it up as my programming language of choice. Another note about wxWidgets is that it can be used in commercial products, is comptable with Linux, Microsoft Windows, and Mac. My biggest beef with it is that I don't like that it binds to GTK in Linux. I'd be happier if there were Qt bindings for it. To my understanding that has been brainstormed before, but I do not currently know the state of any such discussions. Also, it is a matter of opinion, because although I prefer the look of Qt, I'm sure there are just as many people who think it's hideous and would rather have the look of GTK.
If you want to use C++ check out Qt and GTKmm. I personally prefer the look and feel of GTK apps, I think they feel more "native". Qt in particular is a commercial toolkit designed to a large extent for Windows and it shows: the default file open dialog is an exact duplicate of the Windows 95 (!) file picker.
Using the KDE classes can help with that, but writing a KDE app restricts your userbase quite a lot. Outside of KDE itself KDE apps perform poorly especially with respect to startup time.
GTK+ is written in C and exposes a C API however it's been designed to be easy to bind to other languages, and so it can be used with a great API from almost every language out there. That includes C# and Python, which are very productive languages to work in.
The *window manager* you use makes no difference, that's just the program that manages your windows The *desktop* you use may, as the GNOME desktop is written purely using the GTK toolkit, and the KDE desktop is written purely using the KDE toolkit which heavily extends and replaces parts of Qt.
I, personally, would use GTK either with GTKmm or the Python bindings for large apps, and GTK in plain C for small apps where the overhead of the bindings probably isn't worth it.
On IDEs and dependencies: MonoDevelop is a nice piece of work but still rather young and, as you discovered, a total bitch to set up if it's not packaged for your distro.
Most Linux developers do not use IDEs at all. This may be surprising to somebody who has only ever worked on Windows, but IDEs aren't necessary at all on Linux. We rely far less on wizards and code generation.
Instead most developers use powerful editing environments like vim or emacs. I use emacs, even on Windows these days, and find it more productive than any IDE.
Both emacs and vim have fairly sharp learning curves. You have to "unlearn" a lot of habits. The upside is, you will work faster and easier once you have learned them.
If you really, really want an IDE some good ones are Eclipse (for Java/C/C++), KDevelop, Anjuta for gnome stuff though not many people really use it.
However, not many developers use these sorts of IDEs and unfortunately it shows. There is nothing which can match Visual Studio.NET on Linux, we focus on other types of tools.
Oh I forgot to mention, if you want to use C# GTK is the way to go. There are no good Qt .NET bindings that I know of. Check out, eg, Muine to see how this is done.
Distribution: Debian testing 64bit at home, EL5 32/64bit at work.
Posts: 196
Rep:
Mandrake Linux
I suggest that you give Mandrake Linux a try .... installing up to date rpms and all of their dependencies is a piece of cake with a little program called urpmi.
If I wanted to install mono (which is what I did a few months ago) all I'd need to do is become root user and type:
Code:
urpmi mono
... then boom .... all of the rpms required to install mono is installed in the correct order .. piece of cake ;-)
I have just recently installed another distribution called Gentoo. The difference is that gentoo downloads all the source files and compiles all the needed packages on your system. Rather than binaries, it will compile the source with flags that match the optimizations of your specific system. The command is:
Code:
emerge mono
RedHat/Fedora has a program that you may need to install yourself called yum. The same way to install things for RedHat:
Code:
yum install mono
The command for Debian systems (I'm guessing at the command, but I believe it's true):
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.