-   Linux - Newbie (
-   -   Opinions Please!!! (

mongrel666 05-02-2011 05:56 AM

Opinions Please!!!
HI all!
Ok I know I am probably opening a can of worms here but, it should be fun...
I am a lapsed C programmer, (its been 15 years...) and I am wanting to get back into it again. I have never programmed a GUI before and if I am going to be getting into it again, I may as well do the whole hog and go GUI.

So I need all of your collective experiences to help me filter the bucketloads of stuff out there.
Do I stick with C, or go to C++
Any documentation for the transition?

Programming in GUI, I guess X windows, seeing as how I am using Linux at the moment. Books? Docs? Tutorials?

Your favourite IDE? Never used one before, programming for me was VI or maybe JED if I was feeling lazy... and associated documentation?

I am really only aiming at some simple front ends for a few of my research projects which, as you all know will no doubt turn into something else entirely! :)

So, people, LET 'ER RIP...please...

tronayne 05-02-2011 08:06 AM

I would think that the C - C++ choice is a six-of-one, half-dozen-of-the-other (I prefer C, but I'm old and crotchety so there you are). C++ is all about "objects" and, if you can wrap your head around objects and try your best to create objects that are actually useful across applications, well, then you're ahead of the game; problem is, if you create C libraries that are useful across applications you've pretty much done the same thing without all the fooling around. Now, that's a little harsh (and probably just waves a wand over the surface) but my experience with C++ is a whole lot more typing that I want to do just to get "Hello, world" to compile and run.

A potential bonus for learning C++? Java is just C++ without structures and pointers (ooh, that'll raise some hackles!), so if you learn C++ and you're halfway there with Java.

Either way, the QT libraries are quite handy for creating GUI user interfaces -- QT tutorials? Well, I dunno which (if any) are good, bad or indifferent. The X libraries have been around for a long, long time and X is effective but is thus limited to X; QT is kidna-sorta cross-platform and worth a look. You may want to consider front-ending with HTML and PHP if you want a universal user interface (and it's a lot easier than actually "programming" a GUI); everybody's got a browser, not everybody's got X or QT, eh?

IDE. The only one I've used is NetBeans and, frankly, I found the learning curve far steeper than I wanted to deal with (I write code a whole lot faster with vi than I've ever been able to do in an IDE). The IDEs are large beasts, complicated to learn and use and really don't fit my way of working; best to download one or two, see if there's a fit with your head and go from there. This is not to say there's anything wrong with an IDE, on the contrary they can be quite useful in development shop where there are different skill levels and assignments across a group of folks working on an application or group of applications. It's a different way of thinking.

You could, if you're old-fashioned enough, use curses (ncurses). Simple, been around forever, works just fine with any terminal emulator.

As for tutorials I'd take a look at any of the books written by Steven Kochan and Patrick Wood -- they're oldies but goodies, well-written with working examples that shed a great deal of light on otherwise potentially confusing means and methods. Your local library, Amazon, E-Bay, etc.

Hope this helps some.

Snark1994 05-02-2011 08:24 AM

I agree wholeheartedly with what tronayne said (though I'm rather young and non-crotchety, so I fall on the C++ side of the fence - just).

If you're going with IDEs, the only one I could really recommend is Code::Blocks, but vi + makefiles + gdb has always worked well for me. I find IDEs a bit too... I dunno, pushy. Trying to make me do things their way, rather than my way. But I guess it's just a matter of playing around until you find one that works for you :)

I also would repeat the recommendation of using ncurses, especially if you're prototyping your displays. I tend to find if I go straight to GUI I get sidetracked ("OOH! Sliders! Menus! Pretty things!") and forget that at the end of the day I'm making an application with is meant to work. So nowadays I write a simple curses frontend (this also means you separate the functional side of your code from the graphics side of your code) with lots of weird and wonderful key combinations to get it to do everything, and then port that into a more flashy and "intuitive" interface if I feel that it requires it.

Just my thoughts on the subject :) Hope they help

johnsfine 05-02-2011 08:33 AM


Originally Posted by mongrel666 (Post 4343722)
Do I stick with C, or go to C++

In my opinion, C++ is a much better choice.


Any documentation for the transition?
There are many online tutorials.


Programming in GUI, I guess X windows,
You probably should select either Qt or Gtk.


You should have no trouble finding a Qt or Gtk tutorial for your choice of C or C++, maybe even for your choice of IDE as well (or maybe the tutorial you find will influence your choice of IDE).


Your favourite IDE?
Visual Studio 6. That is far better than newer Visual Studio versions and better than open source IDEs.

If I read the icons right on your post, you are posting from a Windows system. So maybe Visual Studio is a valid choice.

When I tried to teach my sons programming, I used Code::Blocks. It is an OK IDE with the big advantage of very similar behavior on both Windows and Linux.

winning 05-02-2011 08:42 AM


Originally Posted by mongrel666 (Post 4343722)
I am wanting to get back into it again

What is it? If it is "C programming", then I guess that answers the C or C++ question.

MTK358 05-02-2011 11:37 AM

If you want to make GUI apps with buttons, menus, etc., do not use X11 directly. It has no such concepts, it's just a way to draw on the screen. Use Qt or GTK+ instead.

Personally I recommand Qt over GTK+. And even thought I'm not a big fan of C++, in my opinion it's still a far better choice than C for GUI programming because it has objects. GUIs are so inherently object-based that GTK+ actually had to create its own complicated way to retrofit objects into C, and in my opinion this is unnecessary complication that could have been avoided by simply using C++ (like Qt does).

mongrel666 05-02-2011 06:20 PM

Thanks guys, this is great! It is really easy to get overwhelmed by the sheer quantity of info out "there" nowadays. Back in the day if you typed LINUX or PROGRAMMING into a search engine it seemed all you got back were more calls for help from other people. (I had a 28.8 modem back then, recently upgraded from a 14.4 with my $2500 pentium 120...mmmmmmmm homer-esque drooling noises...) Now, well its just unbelievable.
Its pretty gratifying to hear a few things that I had already heard of/ looked at come up. I have NCURSES on my TOPRINT/TOREAD/TODO list and I had grazed speculatively over GTK+ with sounds of GUI longing in my voice. But a real look at what I want to do brings me back to NCURSES and C. I dont want to spend my very limited programming time learning an IDE or a whole lot of widgets that I'll likely never use. Having said that I know that I'll probably end up dabbling with something like GTK+. BTW what does Qt stand for? Cutie? Lests assume that its not QuickTime. Lol...

Many thanks again to you all,

Jason Butler

MTK358 05-02-2011 07:13 PM


Originally Posted by mongrel666 (Post 4344467)
BTW what does Qt stand for? Cutie? Lests assume that its not QuickTime. Lol...


Originally Posted by
The toolkit was called Qt because the letter Q looked appealing in Haavard's Emacs font, and "t" was inspired by Xt, the X toolkit.


All times are GMT -5. The time now is 09:59 PM.