Thread: What is there out there to be explored?

  1. #16
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    Location
    segmentation fault
    Posts
    8,300
    Quote Originally Posted by Mario F. View Post
    - GUI programming is naturally Object Oriented. The GUI structure is more easily understood, described and used in a object oriented programming language. While this doesn't mean at all C isn't usable, unless you have a very specific reason to use it (which apparently you don't. You just seem not to be wanting to learn it), C will slow down your development of GUI applications. In contrast C++ will offer you all the tools for Object Oriented Programming. And beyond...
    This is more than a bit BS, based on someone's personal preferences. Glib, on which gtk is based, is indeed fairly "object oriented". However, "object orientation" in this sense does not require class paraphernalia, nor do you need to study or reflect much on the paradigm -- it is just a matter of logic and common sense, the API provides the structure (you do not have to impose more structure on it). I have done GUI OO programming in perl, IMO it is no big advantage*. It would be just as easy to say that using C++ here will slow you down because you now need to learn a lot of bloated and arcane syntax. Like, truth be told, you will do all this WAY FASTER in a language like perl or python than you will do it in C++ or C, altho that is only in small part due to the "object oriented paradigm".

    Also, I would not try and learn C++ and GUI programming at the same time. If you want to learn C++, start that. If you want to learn GUI stuff, just start now with the WinAPI.

    Like I said before, you are not closing the door on anything (that's Mario's job ).

    *I'm sure this perspective comes from people who have not spent any serious time doing anything but OO, so they are flabbergasted at the idea that doing without has it's own advantages and techniques.

    Quote Originally Posted by JOZZY& Wakko View Post
    So if I get it right on this one using C++ would allow me to design and code a GUI faster then I would be able to do it in GTK+?
    In short, not likely (unless you are already very fluent with C++, and never do much pure C programming). Also -- I have never tried this, but I know people who have to good effect -- you can use a system called "glade" which allows for XML scripting (XML, like HTML, is very simple) with gtk+ design. That will save you way more time than the use of C++ wrappers. However, I really think you are best off using WinAPI for now, if that is the platform you use most.
    Last edited by MK27; 12-03-2009 at 12:57 PM.
    C programming resources:
    GNU C Function and Macro Index -- glibc reference manual
    The C Book -- nice online learner guide
    Current ISO draft standard
    CCAN -- new CPAN like open source library repository
    3 (different) GNU debugger tutorials: #1 -- #2 -- #3
    cpwiki -- our wiki on sourceforge

  2. #17
    Learning C. JOZZY& Wakko's Avatar
    Join Date
    Nov 2009
    Posts
    59
    If I search for WinAPI on wikipedia I get a ........load of text that at this moment just reads the same to me a Arabic (and I do not understand Arabic at all, I actually think it is weird to hear). The page on wikipedia referred me to Microsoft Windows SDK. Opening tat did not really helped me any further.

    What does the WinAPI actually mean and how is it used and what is the difference between the WinAPI and if I would go for GTK+?

    Next to that I choose to learn C because it was more flexible as I understood then languages like Python (and I must say also more fun to learn). The amount of time it would cost to program a GUI would not be a problem if it turned out to take more time in C then in C++ as long as we are not talking about a weeks work then that is.

  3. #18
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    Location
    segmentation fault
    Posts
    8,300
    Quote Originally Posted by JOZZY& Wakko View Post
    If I search for WinAPI on wikipedia I get a ........load of text that at this moment just reads the same to me a Arabic (and I do not understand Arabic at all, I actually think it is weird to hear). The page on wikipedia referred me to Microsoft Windows SDK. Opening tat did not really helped me any further.
    Well, here's the "rub": No matter how you cut it, you are going to have to deal with documentation. A lot of people who prepare documentation do not demonstrate much skill as technical writers, unfortunately. However, it is still much better to have the docs written by programmers than hiring professional writers who do not program. What this means is, it is sort of a genre, and the only way you will get comfortable with it is by trying. I very clearly remember being consumed by AGONY and RAGE dealing with documentation that IMO failed to point out the obvious, once I had figured it out. That is almost "the norm" with API docs. I will tell you right now gtk is no exception, either. Very often with official documentation, the entire thing is "sketched in" and sometimes it is clear nobody ever got around to fleshing some things out.

    But you are going to spend a long long time with those docs anyway. It will seem very awkward at first. After a while, you will have looked thru them so many times, you will intuitively know where to look and how to connect information together. You can always post a paragraph here if you want someone to give you an interpretation (in fact, that is a good idea). You will get used to it. Learning to use a particular library and it's particular docs is exactly like learning to use a new and complex piece of software: initially frustrating and awkward, until you "absorb" the inner logic of it.

    I don't program on windows, it is just my impression that the native API is a good idea (eg, most or all of the applications you already use are done that way). I looked at the wikipedia article and yes, it is the SDK you want:

    User Interface:
    Provides the functionality to create and manage screen windows and most basic controls, such as buttons and scrollbars, receive mouse and keyboard input, and other functionality associated with the GUI part of Windows. This functional unit resides in user.exe on 16-bit Windows, and user32.dll on 32-bit Windows. Since Windows XP versions, the basic controls reside in comctl32.dll, together with the common controls (Common Control Library).
    Here's a tutorial I found:
    theForger's Win32 API Tutorial
    it looks fairly good and is in C! There are also lots of books on the topic, you can take your pick and get one used from Amazon for <$15. A good book will probably help a lot.

    Just remember, the hardest part about learning a library is starting. It will get easier, but like I said a few posts ago, there are usually more complications than you would have expected, so be patient.
    Last edited by MK27; 12-03-2009 at 02:22 PM.
    C programming resources:
    GNU C Function and Macro Index -- glibc reference manual
    The C Book -- nice online learner guide
    Current ISO draft standard
    CCAN -- new CPAN like open source library repository
    3 (different) GNU debugger tutorials: #1 -- #2 -- #3
    cpwiki -- our wiki on sourceforge

  4. #19
    Learning C. JOZZY& Wakko's Avatar
    Join Date
    Nov 2009
    Posts
    59
    I would enjoy a good challenge but I just wonder if it would not be more smart to learn GTK+ for the fact that it can be used on more then one platform. If I ever decide to make a step over to an Unix system I will not have to learn it all over again. The Windows "looks" and "feel" of a program does not really concern me as long as a user is able to understand the GUI and I presume that that would be the case with all of them.

    What is the "big" advantage of using the Win32API over GTK+? are there any options that are not possible when you are using GTK+, there must be one reason at least otherwise no one would use the WinAPI?

  5. #20
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Ireland
    Posts
    8,446
    Use GTK+. Have a ball.

    There's nothing like hitting with your face against a brick wall to finally understand. I'm tired talking.
    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  6. #21
    Learning C. JOZZY& Wakko's Avatar
    Join Date
    Nov 2009
    Posts
    59
    Quote Originally Posted by Mario F. View Post
    Use GTK+. Have a ball.

    There's nothing like hitting with your face against a brick wall to finally understand. I'm tired talking.
    I think I will try GTK+ to me it seems the most clear when I look at the examples and easy to learn. I just want to make sure I am not making the wrong choice.

  7. #22
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Ireland
    Posts
    8,446
    Quote Originally Posted by JOZZY& Wakko View Post
    I just want to make sure I am not making the wrong choice.
    You are. But don't let that detract you. I learned the same way and consequentely I'm biased into thinking that's the best way to learn -- to fall flat on your face.
    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  8. #23
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    Location
    segmentation fault
    Posts
    8,300
    Quote Originally Posted by JOZZY& Wakko View Post
    I think I will try GTK+ to me it seems the most clear when I look at the examples and easy to learn. I just want to make sure I am not making the wrong choice.
    Hey, well, I think gtk+ is great, I'm just trying not to force my choices on you. And I think it will be a little more awkward on windows, since most of the tutorials, etc, are aimed at *nix.

    GTK+ 2.0 Tutorial

    Remember, you want to install gtk+ 2.0 (or better). 1.0 has almost disappeared anyway, just don't mix that up. Make sure it actually works before you try developing with it!

    There is a forum with daily regulars:
    GTK+ Programming

    And of course, me.
    C programming resources:
    GNU C Function and Macro Index -- glibc reference manual
    The C Book -- nice online learner guide
    Current ISO draft standard
    CCAN -- new CPAN like open source library repository
    3 (different) GNU debugger tutorials: #1 -- #2 -- #3
    cpwiki -- our wiki on sourceforge

  9. #24
    Learning C. JOZZY& Wakko's Avatar
    Join Date
    Nov 2009
    Posts
    59
    Quote Originally Posted by MK27 View Post
    Hey, well, I think gtk+ is great, I'm just trying not to force my choices on you. And I think it will be a little more awkward on windows, since most of the tutorials, etc, are aimed at *nix.

    GTK+ 2.0 Tutorial

    Remember, you want to install gtk+ 2.0 (or better). 1.0 has almost disappeared anyway, just don't mix that up. Make sure it actually works before you try developing with it!

    There is a forum with daily regulars:
    GTK+ Programming

    And of course, me.
    Hahaha, nice to know there are people on there that offer serious support at least. That is something I miss on a lot of other forums (and the reason this is the only forum I currently use).

    I do not mind to install Linux and learn to code there with GTK+ and then later transfer it to a Windows platform. I got Ubuntu installed here on a Flash memory stick so that thing will finally come to use.

  10. #25
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Ireland
    Posts
    8,446
    Quote Originally Posted by JOZZY& Wakko View Post
    I do not mind to install Linux and learn to code there with GTK+ and then later transfer it to a Windows platform.
    Now, that seems to me a much wiser option. GTK+ Windows port is best used that way. It's not a good option for Windows development. But a good choice if you happen to want to develop in Linux and later port to Windows.

    GTK+ is widely used under Linux and as such makes a natural framework choice if you are programming under GNOME. Then you may want to port to Windows and it would be silly to use anything else other than the GTK+ windows port.

    But if you are doing your main development branch under Windows, then GTK+ is not a good option

    It however needs to be said, for the sake of completion, that wxWidgets allows you to use GTK+ through wxGTK, making this an ideal choice for cross-platform development. But again, this is a C++ thing. Not C as you wish.
    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  11. #26
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    I was wondering what is out there concerning C to look at in the future.
    Since that was a very vague question I gave you a very vague answer.

    I know there is socket programming (what I presume is networking) and AI programming but what more is there and when is it used for example? Looking at AI programming I would presume it is used mostly in games...
    Ok now we are talking sockets, AI, and...games?

    Next to that is it possible to code a GUI in C or do I need to learn C++ or a different language next to C if I would like to code one?
    ...and now we are talking GUI?

    What I am trying to figure out is what I would need to learn to be able to code a GUI for a simple program. For example what is used to code a GUI for what you see on top of your desktop right now?
    Yet that is not what you asked.

    Of course you can code a GUI in C or C++ using whatever API you want. However it will take a bit of effort. I would recommend using C# but if you absolutely want to use C++ then take the advice of those who have posted and go try their suggestions.

    Whichever route you choose try some code out and when it fails you can come back and show us what you have and I guarantee you one or more of the many here will be able to assist you.

  12. #27
    Registered User jeffcobb's Avatar
    Join Date
    Dec 2009
    Location
    Henderson, NV
    Posts
    875
    I would second the use of wxWidgets; used it as a common platform to run on everything from Mac to Lin to Win to WinMobile. It is a fairly mature library with a strong community if you need help. I agree the book it worth the purchase price (or bit torrent download if you are poor).

    One area I am not seeing suggested here is embedded programming. That is an area where a lot of things are going as we get smart phones, smart TVs, etc. Embedded programming is something that takes a bit of discipline plus you need to know your platform well. Most embedded platforms these days are running some flavor or variant of Linux so learning the POSIX stuff would not be a huge waste of time....
    C/C++ Environment: GNU CC/Emacs
    Make system: CMake
    Debuggers: Valgrind/GDB

  13. #28
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    Please don't reply to month-old threads.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  14. #29
    Registered User jeffcobb's Avatar
    Join Date
    Dec 2009
    Location
    Henderson, NV
    Posts
    875
    Sorry. New.
    EDIT: Wait I just noticed this thread was started this month and its only the 14th....what is the problem here? If threads are expired maybe they should be closed?
    Last edited by jeffcobb; 12-14-2009 at 02:51 PM. Reason: noted thread only 2 weeks old...
    C/C++ Environment: GNU CC/Emacs
    Make system: CMake
    Debuggers: Valgrind/GDB

  15. #30
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Quote Originally Posted by jeffcobb
    EDIT: Wait I just noticed this thread was started this month and its only the 14th....what is the problem here? If threads are expired maybe they should be closed?
    Speaking without my moderator hat on, in some special cases, a re-visit of an old thread might result in a new contribution that is particularly useful, e.g., a correction of a serious misconception that all who posted in the thread shared.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

Popular pages Recent additions subscribe to a feed