February 4th, 2003, 04:50 AM
C in Linux and C in Windows/Borland
I have the opportunity to attend a Programming in C course at my local community college, and want to take advantage of this opportunity. The difficulty is however is that they teach using Windows (using Borland) and I use Linux Red Hat 8.0. I don't see much point in trouncing my OS to learn C on Windows when I have C on my trusty Linux box and would prefer to elarn in that environment.
My question is - to what extent will there be incompatabilities between the teaching and my own OS use/practice? Are these insurmountable? What would I need to do in order to overcome any caveats? Any other info/tips would also be useful, such as references, etc.
I have spoken about this to the instructor who claims that Linux uses ANSCII (?) C. I wouldn't know, never having used it before. Is this true that RH8.0 uses ANSCII C? What kind of IDE would I use if any?
As you can tell, I have a load of questions about this, and would like to try and answer these as quickly as I can because the course is due to start on Feb 25th, so any input from this forum would be a step in the right direction.
February 4th, 2003, 07:59 AM
Well, it all rather depends on the way the class is taught.. If you're unfortunate, it'll actually be more like a "how to program in Windows using Microsoft Visual C".
ANSI C (or ISO C, for purists) is a standard that most of today's compilers (including GCC on Linux, and MSVC on Windows) are compliant with. The C language itself is rather bare-boned. It doesn't have any intrinsic features that facilitate, say, easy graphics programming. It can be done, but you'd have to do some direct hardware programming, which is downright hard, and leads to code that's practically unportable. What you do have, is the standard C library, which can be used for things like file i/o, and a few standard utility functions for doing math and dealing with strings.
So, as long as you stick to the standard C library, your code will be fairly portable. But if you want anything beyond that, you'll have to use other libraries. And that's where it matters what platform you're on. If you're on Linux/UNIX, you'll probably use something like Gtk+, Xaw, or maybe even the X library itself to build your GUI application. In Windows, you'll use the Windows library to create your GUI application.
In short, if the focus is actually on the language itself (which is hard enough to master by and of itself), and not so much on how to do Windows programming in C, then you're OK.
Well, there are quite a few actually. I don't bother with any of them myself, though; vim suits me just fine. kdevelop is pretty nifty from what I've seen, but I'm sure other members here can point you to other IDEs on Linux.
If you're looking for a decent and free IDE on Windows, then check out Dev-C++ .
One final note: C and C++ are not one and the same language. C++ is mostly backward-compatible with C, but when used right, C and C++ turn out to be two very different languages.
"A poor programmer is he who blames his tools."
February 4th, 2003, 08:22 AM
Thanx Analyser - that was useful: helps me frame some of the questions that I need to put to the instructor. I do recall from my prior conversation with him, that he said that using the ANSCI/ISO C would make gui/graphics work pretty difficult. However, be that as it may - I'm more interested in learning the basics of the language itself rather than on how to create GUIs and dialog boxes, etc. I suspect that that is stuff I could pick up later, since my focus is really on the structure and process involved in programming.
February 11th, 2003, 09:06 PM
there is none higher
You couldn't pick a better language with which to learn the basisc by.
February 11th, 2003, 09:50 PM
I think Analyser covered it pretty well. This will mainly depend on what kind of class is taught. An introduction to the language should be easily portable between operating systems with only possibly a few minor catches here or there between different libraries. If the class takes on GUI programming (which isn't as common anymore with C, but done more with C++ now) then you would be much better off using the same setup as the class is using.
The thing about IDEs is that if you don't start using them in the beginning, you will learn the compiler aspect of the language much quicker and easier IMHO. Once you know how to use the options for the compiler well, then move into using an IDE. But for console applications the IDE isn't much help anyway.
So, if it is just a beginners class and the instructor isn't going to get into GUI (I would ask to be sure) then I would just stick with vim amd gcc.
Just my 2 cents.
February 12th, 2003, 02:23 PM
Thanx guys for your input. I will be looking at starting a computer systems engineer certificate course come Sept, and both C and java are the languages. It looks like I am going to have to invest in a second box - only basic mind you - and load win98 onto it so that I can follow the process of the class. Oh well, the experience of doing the class will be worth the downgrade from a Linux box ( )!!!!
I take your advice Onslaught about IDEs - if I have a choice it would be preferred to forego one until I'm more knowlegable about the language rather than set up a kind of dependency upon the IDE. There may not b the choice.
The language that I am teaching myself through books, practice and email/lists/webtuts is Python - really decent language for a newbie and is, I understand, pretty powerful too. Come Sept I'll be further along with Python and will hopefully be in a position to understand the basic constructs of programming. I am also doing some reading (e.g. 'How To Design Programs' based on (Dr)Scheme as well as 'The Structure and Interpretation of Computer Programs'. SICP is a bit heavy going, despite the authors being good writers, whereas the HTDP is easier to read and follow. I'll get there and will be sure to screech for help when (not if!!) I need it.
All the best