Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

C

  • 09-07-2008 10:47am
    #1
    Closed Accounts Posts: 63 ✭✭


    I have a C for Dummies and was thinking of starting it and learning C. My only problem is I don't know what C is used for. Is it a language used to make programs with GUIs or what?
    I have tried to learn a few languages but did not make a good enough effort to learn them and am hoping I can stick with this.
    Thanks


Comments

  • Closed Accounts Posts: 17,208 ✭✭✭✭aidan_walsh


    C, like pretty much any other language, can be used to create any application you like.


  • Registered Users, Registered Users 2 Posts: 26,584 ✭✭✭✭Creamy Goodness


    C can be used to make GUI's but java is preferred by most for GUI's do to it being easier.

    C is used for a wide variety of things, mainly programs where time is of the essence


  • Closed Accounts Posts: 63 ✭✭Stamen


    Well, I am probably going to do computer science in college and I have the rest of the summer to do something, I might learn C.

    Thanks for the input


  • Registered Users, Registered Users 2 Posts: 413 ✭✭ianhobo


    ??

    Making GUI's with C is quite difficult and time consuming. C++ is far better, better still the likes of C#/Java are even quicker and easier - click and drag!

    What does C do? hmmmm

    On the home pc, and while learning - C programs generally tend to "do" very little. They are concerned with demonstrating how data is used and stored in your computer, and to explain programming concepts - algorithms, data structures.

    In industry, C is the language of choice for writing operating systems, and control code. Most electronic devices that have a processor are comtrolled by C code underneath everything. Your phone, mp3 player, dvd player, washing machine, the java virtual machine on your phone,

    What would you like to get out of programming?

    Internet stuff and GUI's, C# or java is your man

    Control software - home electronics projects, 3d graphics, then C or C++


  • Closed Accounts Posts: 63 ✭✭Stamen


    ianhobo wrote: »
    ??

    Making GUI's with C is quite difficult and time consuming. C++ is far better, better still the likes of C#/Java are even quicker and easier - click and drag!

    What does C do? hmmmm

    On the home pc, and while learning - C programs generally tend to "do" very little. They are concerned with demonstrating how data is used and stored in your computer, and to explain programming concepts - algorithms, data structures.

    In industry, C is the language of choice for writing operating systems, and control code. Most electronic devices that have a processor are comtrolled by C code underneath everything. Your phone, mp3 player, dvd player, washing machine, the java virtual machine on your phone,

    What would you like to get out of programming?

    Internet stuff and GUI's, C# or java is your man

    Control software - home electronics projects, 3d graphics, then C or C++

    Thanks, that was helpful. I might start with C. Thanks.

    Did I say thanks?
    Thanks


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 9,579 ✭✭✭Webmonkey


    If you want to do GUI stuff with C check out GTK but thats a long way off as you have so much more to learn first - ensure firm understanding of pointers


  • Registered Users, Registered Users 2 Posts: 6,240 ✭✭✭hussey


    Webmonkey wrote: »
    ensure firm understanding of pointers

    and oh what fun they are :-)


  • Registered Users, Registered Users 2 Posts: 740 ✭✭✭junior_apollo


    C is a good 'get to know the basics' language... its easy enough to learn and pickup... I would however go down the route of C++ myself if its to learn how things work.

    I was never a big fan of Java when learning as it provided everything for you and I found it to be more helpful to have to do the work yourself with C++ and learn by doing.

    C is a little bit too basic IMO, C++ bridges the gap by letting you do the basic stuff but still allowing you to progress further into GUI's also when you want to, without changing language.
    Its also a lot easier to continue into Java (if thats what your aiming for) from C++ than from C as they are both object orientated.

    Sorry - Im starting to waffle...

    C = Very Basic << you can only go so far before losing interest
    C++ = C and OO and GUI << Very interesting and powerful
    Java = Hidden C++ and Lots of GUI << Can get very complex without providing much insight into how things work - BUT: if you come from C++ into Java then you understand the underlying code and its an extremely powerful language.

    I work in software myself and we use Java but I am glad I took the C++ route initially and progressed into Java (luckily thats the way we went in college)


  • Registered Users, Registered Users 2 Posts: 9,579 ✭✭✭Webmonkey


    (luckily thats the way we went in college)
    Similar - We went from C++ to C to Java in collage and I'm happy we went that way rather than starting with java at first. Big mistake imo


  • Registered Users, Registered Users 2 Posts: 740 ✭✭✭junior_apollo


    Webmonkey wrote: »
    Similar - We went from C++ to C to Java in collage and I'm happy we went that way rather than starting with java at first. Big mistake imo

    Wow :eek: ... someone agreed with me!... wohoooo! :cool: *pops collar*


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 413 ✭✭ianhobo


    I'd have to disagree however :)
    but thats neither here nor there
    C = Very Basic << you can only go so far before losing interest
    C is anything but "very basic", it could infact be argued that it is one of the most difficult languages

    and as for loosing interest? Thats a personal thing. Each of out interests lie in different places, for some people thats C, for others it ain't :) It just depends on what you want to do and where your programming interests are :)


  • Closed Accounts Posts: 2,267 ✭✭✭h57xiucj2z946q


    C = Very Basic << you can only go so far before losing interest


    I have to disagree with this. Many operating systems are coded in C. Look at Solaris. Thats not basic.

    As for GUI's, what about Visual C and others?


  • Registered Users, Registered Users 2 Posts: 740 ✭✭✭junior_apollo


    ianhobo wrote: »
    I'd have to disagree however :)
    but thats neither here nor there


    C is anything but "very basic", it could infact be argued that it is one of the most difficult languages

    and as for loosing interest? Thats a personal thing. Each of out interests lie in different places, for some people thats C, for others it ain't :) It just depends on what you want to do and where your programming interests are :)


    Apologies for the use of 'very basic'... what I meant is that its not an OO language and as such it is nowhere near as powerful as C++... and since C++ contains all of the functionality of C (slight differences cout->printf blah blah blah) it would make more sense to learn C++ as while doing this you are learning C also...
    C++ gives you all the OO programming aswell which is a sound base to eventually dive into Java if thats where your heading or remain in C++, or branch to C# .net wherever.. the options to progress are far greater from C++ while still starting out at a similar starting point as C.


  • Registered Users, Registered Users 2 Posts: 15,065 ✭✭✭✭Malice


    C is a little bit too basic IMO, C++ bridges the gap by letting you do the basic stuff but still allowing you to progress further into GUI's also when you want to, without changing language.
    C = Very Basic << you can only go so far before losing interest
    C++ = C and OO and GUI << Very interesting and powerful
    I work in software myself
    For someone who works in software you would want to get your facts correct before making statements like "C is basic". You do understand that the C++ provides no capability to do GUI-based projects? All that functionality is provided by third party libraries, which in some cases I am pretty sure have C equivalents.

    I'm also curious as to what you find keeps your interest in C++ and bored you with C?


  • Registered Users, Registered Users 2 Posts: 9,579 ✭✭✭Webmonkey


    C's far from that basic.

    Obviously it can do everything another language can do but it takes a lot more effort but the plus side of this is you have more control, down side again - more prone to making mistakes.


  • Registered Users, Registered Users 2 Posts: 740 ✭✭✭junior_apollo


    I have to disagree with this. Many operating systems are coded in C. Look at Solaris. Thats not basic.

    As for GUI's, what about Visual C and others?

    Again it was a misuse of words... I just meant that you can learn all of the C stuff you want while learning C++, and C++ will be more useful to you than learning C on its own as it allows for the meld into other languages aswell as all the OO functionality... C on its own is C, C++ is C with extras and bridges to other languages... just makes more sense to take on C++


  • Registered Users, Registered Users 2 Posts: 413 ✭✭ianhobo


    Apologies for the use of 'very basic'... what I meant is that its not an OO language and as such it is nowhere near as powerful as C++... and since C++ contains all of the functionality of C (slight differences cout->printf blah blah blah) it would make more sense to learn C++ as while doing this you are learning C also...
    C++ gives you all the OO programming aswell which is a sound base to eventually dive into Java if thats where your heading or remain in C++, or branch to C# .net wherever.. the options to progress are far greater from C++ while still starting out at a similar starting point as C.

    Thats fine, but of course your assuming that OO is the be all and end all of programming? Just because your choosen language is OO doesn't make you "all powerful". It's back to the "proper tool for the job" idea. You are not "learning C" as you go when you learn C++

    OO concepts and functionality comes at a hefty price - both the actual size of your binary, and the amount of memory required to now run your massive program.

    In the desktop computing world, this isn't really an issue as resources are almost endless, hence the heavy use of C++ for desktop application development, but in the microcontroller and embedded world, you have tight resources, limited memory, and slower cpu's. C++ isn't (usually isn't) appropiate.

    There are a wealth of reasons why one would choose C over C++, as damo2k said, look at solaris. Also Linux is written in C.


  • Registered Users, Registered Users 2 Posts: 740 ✭✭✭junior_apollo


    malice_ wrote: »
    For someone who works in software you would want to get your facts correct before making statements like "C is basic". You do understand that the C++ provides no capability to do GUI-based projects? All that functionality is provided by third party libraries, which in some cases I am pretty sure have C equivalents.

    I'm also curious as to what you find keeps your interest in C++ and bored you with C?

    Again ye are all jumping off the topic here on the word 'basic' ...

    I'm merely saying that you can learn all the C programming skills while learning C++ and still keep your further options more open... And hence C++ would be a better language to learn from that point of view...

    With all the languages they all have strong point and weak points.. im merely pointing out that you can cover one with the other without delving in too deep too early... as jumping straight into Java might prove for the OP...

    I never said C is useless or pointless.. i just mean u can still learn it through C++ and gain the extra...

    *hoping the repetitiveness in this comment will actually sink in* :P


  • Registered Users, Registered Users 2 Posts: 740 ✭✭✭junior_apollo


    ianhobo wrote: »
    Thats fine, but of course your assuming that OO is the be all and end all of programming? Just because your choosen language is OO doesn't make you "all powerful". It's back to the "proper tool for the job" idea. You are not "learning C" as you go when you learn C++

    OO concepts and functionality comes at a hefty price - both the actual size of your binary, and the amount of memory required to now run your massive program.

    In the desktop computing world, this isn't really an issue as resources are almost endless, hence the heavy use of C++ for desktop application development, but in the microcontroller and embedded world, you have tight resources, limited memory, and slower cpu's. C++ isn't (usually isn't) appropiate.

    There are a wealth of reasons why one would choose C over C++, as damo2k said, look at solaris. Also Linux is written in C.

    Come on will you.. your getting a little bit hung up here... the original post was with regards learning C to move towards GUI eventually... the suggestion was that C++ would be more suitable to learn and move towards GUI eventually while maintaining a similar route...

    For your argument why dont you just have the OP learn assembly and cut right to the chase... jesus lads get some perspective on the situation not just looking for an argument... :rolleyes:


  • Registered Users, Registered Users 2 Posts: 413 ✭✭ianhobo


    Stamen wrote: »
    I have a C for Dummies and was thinking of starting it and learning C. My only problem is I don't know what C is used for. Is it a language used to make programs with GUIs or what?
    I have tried to learn a few languages but did not make a good enough effort to learn them and am hoping I can stick with this.
    Thanks

    Perspective?

    Here is the orignal post. The OP did not say he wanted to learn how to program GUI's. It was merely asked was that what you used C for, and if not, what is C for. He didn't say he wanted a language a make GUI's with.

    To be honest, I think you missed a lot when you learnt about C and C++.
    They are two very different beasts. You cannot learn one by learning the other


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 740 ✭✭✭junior_apollo


    ianhobo wrote: »
    Perspective?

    Here is the orignal post. The OP did not say he wanted to learn how to program GUI's. It was merely asked was that what you used C for, and if not, what is C for. He didn't say he wanted a language a make GUI's with.

    To be honest, I think you missed a lot when you learnt about C and C++.
    They are two very different beasts. You cannot learn one by learning the other

    Ok apologies then, i misread the original... but nevertheless... your trying argue that learning C will be more useful for the OP than C++...
    I have to totally disagree... of course you can learn most if not all of the C coding techniques while learning C++... the similarities in what you can do cannot be denied surely!.. of course they are different beasts, that was never in question, and of course C is more tightly knitted than C++ that also was never in question, BUT was was said was that C++ opens a lot more doors for the OP as a base language than C does, there is more options to further progress into more powerful and robust languages from C++ than C... its undeniable...


  • Closed Accounts Posts: 63 ✭✭Stamen


    Well, thanks for the argument (:D)

    C++ or C??? That is the question...

    I just want to learn something that will be useful in computer life and getting a job.

    If I learn the two languages, i can put down C & C++ instead of one, can't I?

    How long does it take to get up to the basics with C if you read and code for about 2 hours a day?


  • Registered Users, Registered Users 2 Posts: 740 ✭✭✭junior_apollo


    Stamen wrote: »
    Well, thanks for the argument (:D)

    C++ or C??? That is the question...

    I just want to learn something that will be useful in computer life and getting a job.

    If I learn the two languages, i can put down C & C++ instead of one, can't I?

    How long does it take to get up to the basics with C if you read and code for about 2 hours a day?

    How long is a piece of string?! :p

    If you enjoy coding and have some prior experience with other languages then you should have no problems picking up C. At the start you shouldnt have any troubles with variables, simple loops, switch/case statements and all that jazz...
    Then the fun begins when you move onto arrays, pointers, dynamic alloc., but i think the first biggest step will be with regards pointers to be honest..

    Its impossible to give a timeframe for when you could claim to be 'proficient' - it comes down to the individual... but I suppose you could compare the times you are talking about to classes... in which case a college course which would cover the book in 1-2 years would be 2/3 classes a week at an hour each... maybe one of my friends above could write a program to work it out for you in Fortran.. :rolleyes:


  • Closed Accounts Posts: 63 ✭✭Stamen


    :p

    I might start with that as I have the book now


  • Registered Users, Registered Users 2 Posts: 740 ✭✭✭junior_apollo


    You might also find some helpful info at...

    http://www.cprogramming.com/tutorial.html

    And they have code snippets, examples and forums for help also - lot of handy info there... and they also cover C++ aswell

    Best of luck and hope you stick with this one! ;)


  • Closed Accounts Posts: 63 ✭✭Stamen


    I was just thinking, if C programs are run in command prompt, you could make a text based game played from command prompt?

    New Challenge!!!


  • Registered Users, Registered Users 2 Posts: 740 ✭✭✭junior_apollo


    Stamen wrote: »
    I was just thinking, if C programs are run in command prompt, you could make a text based game played from command prompt?

    New Challenge!!!

    Well ya gotta remember that most of the big named games all came from C programming... Quake was a revolutionary game and thats all C im pretty sure..


  • Registered Users, Registered Users 2 Posts: 7,468 ✭✭✭Evil Phil


    I thought quake was C++, or was that Q2?


  • Closed Accounts Posts: 63 ✭✭Stamen


    Never played it. :(


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 740 ✭✭✭junior_apollo


    Evil Phil wrote: »
    I thought quake was C++, or was that Q2?

    Nope C... (dont ya just love google?)...

    http://inertia.curvedspaces.com/Articles/C_Game_Programming/C_Game_Programming.html

    Quake 2 was C++ though i think your right... (too lazy to run another google)

    Brilliant games... all those ones that came around that time were awesome.. Doom, DukeNukem etc etc..


  • Registered Users, Registered Users 2 Posts: 413 ✭✭ianhobo


    Quake was C i think

    The source is here, for Quake I and II and III.

    http://www.idsoftware.com/business/techdownloads/

    Looking at the Quake source, it seems to be all C files


  • Closed Accounts Posts: 71 ✭✭Mach


    C is great for the basics (but I wouldn't use it for GUIs unless I have an IDE like lab view) once you know the basic you can program in almost any language, except maybe a functional language like LISP


  • Closed Accounts Posts: 25,848 ✭✭✭✭Zombrex


    Stamen wrote: »
    I was just thinking, if C programs are run in command prompt, you could make a text based game played from command prompt?

    New Challenge!!!

    I think two issues are getting confused here, a programming language and the GUI

    C is an old(ish) programming language, it was invent the late 60s.

    It follows the principles of structured programming, which was all the rave back then (still is, good ideas don't go out of fashion) which means it is designed to over come the "spaghetti code" that older programming languages allowed a (bad) programmer to write.

    It is a procedural language, you have data which you pass around to different "functions" that do something with the data and return some data, which you then you pass to other functions. This is how you get things done. The structural programming aspect comes in because functions are declared as distinct units of code. In the bad old days your program could jump all over the place from one point of the code to another, if you were a bad or inexperienced programmer. Tracking down bugs was difficult because you could be jumping around a 10,000 line piece of code.

    In a structured programming language the work is divided up into smaller units (functions) that do something and then return. Your program becomes a collections of specific functions, with data being passed around between them. This makes it easier to code and debug as you know that function A should be doing this, function B should be doing that.

    Because of its influence a lot of programming languages since, such as C++, Java, PHP have similar syntax and some functionality to C, even if they have moved away from procedural programming to object orientated programming (which most people still don't understand).

    C is often taught as a starter language because it is generally considered a good idea to get used to procedural programming before you move to something like object orientated programming. I can see the logic behind that, though some argue that this leads to people doing procedural programming with objects, rather than proper object orientated programming, because they are so used to procedural programming. So this is something to bare in mind. Object Orientated programming is more different that what most people think when they move to it.

    I would recommend looking at C, getting used to variables, pointers and functions, and then moving relatively quickly on to the OO functionality of C++

    As for GUIs, they are just programs themselves. To make a program do something with a graphical user interface you simply include a GUI library (collection of functions or objects that you can use in your own code) in your program, and make calls to the GUI functions. From the point of view of the program there isn't a huge amount of difference between talking to the GUI and talking to a database, or a file system, or the internet. It is all done with function calls to external libraries of code.

    So it would be wrong to view command line programs as being vastly different to GUI programs. GUI programs simply have extra code libraries add to them allowing them to send and receive messages from the GUI (create me a new window, draw this to the window, where is the mouse pointer now, did the user click that button etc etc)

    If you want to do something like a game you will need to talk to the GUI to draw your game, or the easier option is to use a library that already does that like SDL or DirectX. But that is quite complicated for just learning a programming language, as there is a lot of work involved in setting all this up.

    For just learning how to program you are better off staying, for the time being at least, away from complicated libraries such as a GUI library.


  • Registered Users, Registered Users 2 Posts: 740 ✭✭✭junior_apollo


    Wicknight wrote: »
    I think two issues are getting confused here, a programming language and the GUI

    C is an old(ish) programming language, it was invent the late 60s.

    It follows the principles of structured programming, which was all the rave back then (still is, good ideas don't go out of fashion) which means it is designed to over come the "spaghetti code" that older programming languages allowed a (bad) programmer to write.

    It is a procedural language, you have data which you pass around to different "functions" that do something with the data and return some data, which you then you pass to other functions. This is how you get things done. The structural programming aspect comes in because functions are declared as distinct units of code. In the bad old days your program could jump all over the place from one point of the code to another, if you were a bad or inexperienced programmer. Tracking down bugs was difficult because you could be jumping around a 10,000 line piece of code.

    In a structured programming language the work is divided up into smaller units (functions) that do something and then return. Your program becomes a collections of specific functions, with data being passed around between them. This makes it easier to code and debug as you know that function A should be doing this, function B should be doing that.

    Because of its influence a lot of programming languages since, such as C++, Java, PHP have similar syntax and some functionality to C, even if they have moved away from procedural programming to object orientated programming (which most people still don't understand).

    C is often taught as a starter language because it is generally considered a good idea to get used to procedural programming before you move to something like object orientated programming. I can see the logic behind that, though some argue that this leads to people doing procedural programming with objects, rather than proper object orientated programming, because they are so used to procedural programming. So this is something to bare in mind. Object Orientated programming is more different that what most people think when they move to it.

    I would recommend looking at C, getting used to variables, pointers and functions, and then moving relatively quickly on to the OO functionality of C++

    As for GUIs, they are just programs themselves. To make a program do something with a graphical user interface you simply include a GUI library (collection of functions or objects that you can use in your own code) in your program, and make calls to the GUI functions. From the point of view of the program there isn't a huge amount of difference between talking to the GUI and talking to a database, or a file system, or the internet. It is all done with function calls to external libraries of code.

    So it would be wrong to view command line programs as being vastly different to GUI programs. GUI programs simply have extra code libraries add to them allowing them to send and receive messages from the GUI (create me a new window, draw this to the window, where is the mouse pointer now, did the user click that button etc etc)

    If you want to do something like a game you will need to talk to the GUI to draw your game, or the easier option is to use a library that already does that like SDL or DirectX. But that is quite complicated for just learning a programming language, as there is a lot of work involved in setting all this up.

    For just learning how to program you are better off staying, for the time being at least, away from complicated libraries such as a GUI library.

    +1 - Very good post


  • Closed Accounts Posts: 63 ✭✭Stamen


    hmmm, informative. :D

    When I'm finished C for dummies what should I do? Mr Dan Gookin (C guy) recommends another one of his books, C All in one desk reference, is it worth it or is the hinternet good enough.


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 3,568 ✭✭✭ethernet


    Stamen wrote: »
    hmmm, informative. :D

    When I'm finished C for dummies what should I do? Mr Dan Gookin (C guy) recommends another one of his books, C All in one desk reference, is it worth it or is the hinternet good enough.
    Did C in first year B. Sc. IT. Have both books. Read the smaller one first and then the all-in-one and found it very useful. Covers a lot, including more difficult/obscure things.


  • Closed Accounts Posts: 63 ✭✭Stamen


    Just ordered it. Thanks


  • Registered Users, Registered Users 2 Posts: 26,584 ✭✭✭✭Creamy Goodness


    every C programmer should have this book.

    http://www.amazon.co.uk/C-Programming-Language-2nd/dp/0131103628/ref=sr_1_1?ie=UTF8&s=books&qid=1216075317&sr=8-1

    it's not great to learn from, but as a reference guide it is pretty much your bible to all things C.


  • Closed Accounts Posts: 25,848 ✭✭✭✭Zombrex


    Cremo wrote: »
    every C programmer should have this book.

    http://www.amazon.co.uk/C-Programming-Language-2nd/dp/0131103628/ref=sr_1_1?ie=UTF8&s=books&qid=1216075317&sr=8-1

    it's not great to learn from, but as a reference guide it is pretty much your bible to all things C.

    Agreed, it literally is the C book (Dennis Richie invented C)


Advertisement