home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.amiga.programmer
- Path: sparky!uunet!gatech!concert!samba!usenet
- From: Todd_Lewis@unc.edu (Todd M. Lewis)
- Subject: Re: How should I learn C?
- Message-ID: <1992Dec28.222652.11431@samba.oit.unc.edu>
- Sender: usenet@samba.oit.unc.edu
- Nntp-Posting-Host: guitar.oit.unc.edu
- Organization: UNC Office of Information Technology
- References: <78849@hydra.gatech.EDU>
- Date: Mon, 28 Dec 1992 22:26:52 GMT
- Lines: 68
-
- In article <78849@hydra.gatech.EDU> gt6758b@prism.gatech.EDU (Michael Maverick
- Kopack) writes:
- >Could somebody please tell me how I should go about trying to learn C?
-
- A lot of it is attitude. Hang in there and try to enjoy it. :-)
-
- >...solid understanding of C.... I don't care about being able to do all
- >the wiz-bang graphics and such yet, I just want to be able to write a few
- >useful programs in C for my Amiga!
-
- Good attitude. That's half the battle.
-
- >There are a lot of things about C that I find very frustrating after comming
- >from a decent course in Pascal. For one is the way that Arrays are handled.
- >I like being able to do stuff like array [6..26] of int whereas in C you
- >get forced into calling the indeces 0-19. I also HATE that there are no true
- >pass by reference parameters!
-
- Oops. Attitude problem. There are ways work with these things and keep
- a good design. This is an attitude problem. C will never be Pascal.
- That wrench just doesn't drive screws very well. Get over it. (I went
- through the same phase, by the way.)
-
- >It seems that C pretty much took Pascal and threw all the rules out the
- window!
-
- It's more that Pascal took C and threw in a bunch of rules. Either way,
- it's a different tool with lots of sharp edges. Be careful and try to
- get into a C mind-set. If you don't you will never enjoy programming C.
-
- >I can't imbed functions so other procedures can't see them (scoping rules),
-
- Static functions with file scope will do it. Well-chosen function names
- eliminate the problem pretty much anyway. Most of those local functions
- you wrote in Pascal could have been global and nothing would have changed.
-
- >I have to use global variables a lot (taught as a no-no at GT)
-
- That's what static variables with file scope are far. It works a little
- differently, but you can get the same effect. You just have to think a
- little differently about it, that's all. Attitude.
-
- > and it just
- >seems like C is TOO flexible! How do you guys get anything done when there are
- >about 500 different ways to do it?
-
- There are usually only a few _good_ ways, though. That's where skill
- and experience come in. Getting to make those choices is part of what
- makes C programming fun.
-
- >Please, open my mind to C! I'd hate to have to try to do everything for my
- >Amiga in Pascal, considering how much of the Amiga software is written in
- >and documented for C......
-
- I started my Amiga programming in Modula-2. This was a good thing, because
- I had to really understand every line of every example program I studied to
- be able to translate it to M2. I came away with a much better understanding
- of the Amiga and C because of it. I use C these days, but now I know _why_ I
- use C.
-
- >Thanks a million,
- >Mike Kopack
-
- Looking forward to some great programs from you! Hang in there.
- --
- _/_/_/ _/ Todd_Lewis@unc.edu You can lead a horse to
- _/ _/ utoddl@guitar.oit.unc.edu Mohammad, but you can't make
- _/ _/_/_/ a mountain drink a mole hill.
-