c as a beginner language

M

mitchellpal

Hi guys, am learning c as a beginner language and am finding it rough
especially with pointers and data files. What do you think, am i being
too pessimistic or thats how it happens for a beginner? Are there
better languages than c for a beginner? For instance visual basic or i
should just keep the confidence of improving?
 
A

andyburgess

Hi,

Yes I'd agree C is a difficult language for a beginner as regards
pointers - I didn't find data files or the rest particularly difficult.
It's more techie that VB (or even classic BASIC), but it's power is
great. Maybe you should start with C++ - string handling is easier? If
you can program in C, though, you should be able to switch to other
languages easily. You cannot say the same of VB - and in my opinion
that takes up far too much disc space!

However if you do struggle though comprehending pointers (and files in
your case) - you should appreciate the power of the language - it does
pretty much anything! I've just reacquanted myself with pointers and
pointer arithmetic - something I never really got the hang of a few
years back when I first learnt C. Now I feel confident with pointers,
and can make some use of the powerful features of pointer arithmetic
etc. C also has the power to be platform independent - you can use it
on a PC, a Unix machine (or Linux), or Apple Mac (I believe), plus
other less well known systems with relatively little changes to your
program.

I like the language, and am glad I struggled with learning it - I can
now do some wonderful things with it. My advice - get a nice friendly
book, which you are happy with the writing style of, and study it in
depth in your weaker areas.

Online resources I've found useful are:

www.cplusplus.com
typing "man <c command>" - eg "man open()" at a google window - to see
the manual page for the command
http://www.codeproject.com/ - mainly PC (and Microsoft) languages.
Tutorial @ "www.physics.drexel.edu/courses/
Comp_Phys/General/C_basics/c_tutorial.html" (unfortunately the page had
disappeared today)
http://www.lysator.liu.se/c/bwk-tutor.html - online copy of Brian
Kernighan's "Programming in C: A Tutorial"

when looking up things online - search for "C language" - otherwise
you get lots of useless info - the letter c appears in loads of stuff!

If you want: email me off this newsgroup and I'll see if I can help!

Cheers
Andy Burgess
 
X

Xiaodong Xu

keep on using c. btw, visual basic is not a language, it's an IDE.
c is simple. c is difficult. just feel it by learning.
 
N

Nick Keighley

Hi guys, am learning c as a beginner language and am finding it rough
especially with pointers and data files.

pointers are hard and I found the syntax of C pointers
counter-intuitive
(this was when I was learning-it seems quite obvious now :) )

data files I don't understand. I've used a variety of languages and
generally found files not a problem (well, ok, they were a bit of a pig
in
FORTAN IV...). C's file handling has always seemed fine to me.
Perhaps you are using some of the less easy to use C functions
(fscanf()?). Rather than fgets(). Could you post some code (working
or not!) so we can try and work out what your problem is.
What do you think, am i being
too pessimistic or thats how it happens for a beginner?

your first language is going to be hard.
Are there better languages than c for a beginner?

I don't have a good answer to this one. I used to recomend Pascal
but that's really dropped off the charts. Python maybe? But there are
worse things than C. C is fairly small. And well defined.
For instance visual basic

I wouldn't recomend locking yourself into microsoft right at the
beginning...
or i should just keep the confidence of improving?

what book are you learning from?
 
M

Marc Boyer

Le 25-01-2006 said:
Hi guys, am learning c as a beginner language and am finding it rough

Yes, it is.
especially with pointers and data files.

Pointers are rough in every langage. The problem with
C is that you can not do a lot of things without pointers.
What do you think, am i being
too pessimistic or thats how it happens for a beginner? Are there
better languages than c for a beginner?

Yes, Pascal, a subset of Ada, a subset of C++, caml.
You can also try Python, Ruby...

Marc Boyer
 
A

August Karlstrom

Hi guys, am learning c as a beginner language and am finding it rough
especially with pointers and data files. What do you think, am i being
too pessimistic or thats how it happens for a beginner? Are there
better languages than c for a beginner? For instance visual basic or i
should just keep the confidence of improving?

There are definitely better languages for a beginner (and for just about
anyone) than C. Have a look at Oberon for instance. It's a successor to
Pascal and Modula, but unlike Pascal it's not limited in any way. An
entire operating system (with the same name) was constructed with Oberon.

Here are some links:

http://www.oberon.ethz.ch/ (Home of the Oberon)
http://www.zel.org/aos/o2report.htm (Language Report)
http://www.modulaware.com/mdlt49.htm (Comparison to C++)

Freestanding Compilers:
http://sourceforge.net/projects/ooc
http://www.excelsior-usa.com/home.html
 
R

Richard Bos

August Karlstrom said:
There are definitely better languages for a beginner (and for just about
anyone) than C. Have a look at Oberon for instance. It's a successor to
Pascal and Modula, but unlike Pascal it's not limited in any way.

Then it's not suited for beginners. One of Pascal's great strengths in
teaching is that it does not just suggest, but downright enforces,
strict style. _First_ one needs to learn to work within safe limits, and
_then_ one can start justifying why one needs to step over them. Any
language without limits is too likely to give a student bad habits.

And yes, that very much does go for C as well.

Richard
 
A

August Karlstrom

Richard said:
Then it's not suited for beginners.

Well, you're wrong. The "unsafe" low-level features are only available
if the pseudo module SYSTEM is imported. Without SYSTEM as a client a
module is completely type safe.
One of Pascal's great strengths in
teaching is that it does not just suggest, but downright enforces,
strict style. _First_ one needs to learn to work within safe limits, and
_then_ one can start justifying why one needs to step over them. Any
language without limits is too likely to give a student bad habits.

Not so with Oberon. The language is so clean and well structured that
good style comes almost naturally; it's a language that, opposed to C,
discourages obscurity and encourages clarity. Moreover it's simpler than
Pascal in the sense that it has fewer language elements.

Why not have a look at the language before you jump into false conclusions?


August
 
C

CBFalconer

Richard said:
.... snip ...

Then it's not suited for beginners. One of Pascal's great
strengths in teaching is that it does not just suggest, but
downright enforces, strict style. _First_ one needs to learn to
work within safe limits, and _then_ one can start justifying
why one needs to step over them. Any language without limits is
too likely to give a student bad habits.

And yes, that very much does go for C as well.

Actually Pascal has very few limits, but in general there is only
one way to attain a particular desire. I used it succesfully for
many years in embedded processing, and needed a very few
extensions. putport and getport were primary. Others were largely
for efficiency, such as mask and lor for bit banging. The benefits
of proper typing and range checking are immense, especially in
critical medical software.

--
"If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers." - Keith Thompson
More details at: <http://cfaj.freeshell.org/google/>
 
J

John Bode

Hi guys, am learning c as a beginner language and am finding it rough
especially with pointers and data files. What do you think, am i being
too pessimistic or thats how it happens for a beginner? Are there
better languages than c for a beginner? For instance visual basic or i
should just keep the confidence of improving?

First of all, programming is a skill, and like any other skill it
requires non-trivial amounts of time and effort to learn; you're not
going to figure everything out all at once. Usually, you have to take
some things on faith and hope that they'll make sense in the future.
Eventually, things start to click, but it can be weeks or even months
before some concepts will be clear.

C is terrible as a teaching language, and pointers are just the tip of
the iceberg. It was designed for people who were already expert
programmers and wanted something a bit more flexible than what was
available at the time. There are a ton of subtle little gotchas that
you just have to learn about over time, and the syntax can be less than
intuitive now and then.

*Any* language is going to be tough for a beginning programmer, since
you're having to learn how to program in addition to the language
itself. Some languages are tougher than others, though, and C falls
well into the "tougher" category. Unfortunately, my experience with
other languages isn't all that broad. I've heard from others that
Python or Ruby make good teaching languages. I think languages like
Java and C# would work pretty well as teaching languages, provided
you're willing to learn OO concepts on top of everything else.

Another thing to consider: C is a product of the early 1970s, and it
shows. It provides no high-level support for networking, or file
system management, or graphics, or sound, or any of a number of other
features that more modern languages like Java and C# do. If you want
to start writing Windows apps, you might be better served starting with
something like C# and the .Net framework.

Then again, switching gears at this point might be even more
counterproductive than just plugging along in C.
 
B

Benry

I taught C Programming to engineering and science majors in college.
It was a Freshman level course, and while I was teaching it, I
remembered struggling through it as well. At the same time, though,
the things the students were learning we very basic and intuitive to me
by that point. I taught it kids who were in their first every
programming class, and we got into recursion, pointers, memory
allocation, bitwise and array stuff, and even linked lists (with
structs). I don't know one person in my classes that didn't struggle
through it at one point or another.

I'm now working as a consultant and writing in C++ and doing things
that are talked about lacking in C in the other replies. Basically, if
you want to be a great programmer, you have to understand C very well.
You'll learn all about how computers work (OS, compiliers, etc), which
will help with Object Oriented languages. I consider C the easy
language in my portfolio because I know it so well...this is good for
me!

When I graduated college, I took up VB and Visual C++ in a matter of a
month or two. C took me a few years to master. I don't have problems
learning any language now because I had to struggle so much in the
beginning.

Keep sticking to it, because you will be further than you think once
you start to understand the basics.

-ben
 
A

aldrin

I'm struggling with C but at the same time I'm also enjoying the
challenge. It is a powerful little language with some mind numbing
little intricacies but the flexibility and control you have makes up
for it.From my own experience I found that reading from various
sources(books, web, forums etc) helps to clarify diffcult concepts.
Stephen Kochan's book on C programming does a great job of explaining
pointers.
http://www.amazon.com/gp/product/06...f=pd_bbs_5/102-8109474-6902511?_encoding=UTF8
 
B

ballpointpenthief

I'm another beginner programmer who has started with C. (Well apart
from some BBC BASIC game programming when I was a kid)
I'm finding concepts are starting to click, and having a butchers at
the other languages about I am pleased to see that loads of the syntax
is based on C.
My reasoning for starting on C was that it is important to understand
what goes on at a lower level (however Assembly seems a little bit too
hardcore to jump straight into).

On learning pointers: I put this off for a bit, but when I was feeling
particularly eager, I spent 2 long nights getting everything to work.
It fried my brain but forcing myself to use functions that I didn't
really get proved very helpful.

I recommend this URL: http://cslibrary.stanford.edu/103/

I'm now looking at learning Java, C++, Perl and Assembly.
 
R

Richard Bos

August Karlstrom said:
Well, you're wrong. The "unsafe" low-level features are only available
if the pseudo module SYSTEM is imported. Without SYSTEM as a client a
module is completely type safe.

That's theory. Practice is that if there is a reasonably obvious bypass
of a security measure, a learner _will_ find it, use it, and learn bad
habits in the process.
Why not have a look at the language before you jump into false conclusions?

It's not about this particular language. It's about languages that are
good for advanced programming by necessity not being good for learning.
They have opposite requirements.

Richard
 
M

mimi001

Hi guys, am learning c as a beginner language and am finding it rough
especially with pointers and data files. What do you think, am i being
too pessimistic or thats how it happens for a beginner? Are there
better languages than c for a beginner? For instance visual basic or i
should just keep the confidence of improving?

My advice is, like the other people who have posted, get a good
tuitorial and copy out every example and run it, right through the
book.

Once you have done that, think up something that you would like to code
and just start! Having trouble knowing where to start? Start with
something basic, like defining the functions that you will need, or
something like that. Don't know a bit of code? Google is your best
friend.

C isn't an extremely hard language to learn, it's just some aspects of
it are not as friendly as someothers.
 
A

Arctic Fidelity

My advice is, like the other people who have posted, get a good
tuitorial and copy out every example and run it, right through the
book.

Once you have done that, think up something that you would like to code
and just start! Having trouble knowing where to start? Start with
something basic, like defining the functions that you will need, or
something like that. Don't know a bit of code? Google is your best
friend.

I find that having a general overall understanding of how programming
works in this situation, as you understand what you need to do, and then
can find the correct functions, operators, etc. to do your work.
C isn't an extremely hard language to learn, it's just some aspects of
it are not as friendly as someothers.

I'd say most of it is just paying attention to the details. :)

- Arctic
 
M

mimi001

I find that having a general overall understanding of how programming
works in this situation, as you understand what you need to do, and then
can find the correct functions, operators, etc. to do your work.

That's basically what I ment, read, learn, understand. A little bit of
culture/history wouldn't go astray either.
 
I

Ian Malone

August said:
Well, you're wrong. The "unsafe" low-level features are only available
if the pseudo module SYSTEM is imported. Without SYSTEM as a client a
module is completely type safe.

Considering in C beginners often do things like cast malloc or which
are along the lines of:
void function(char *ptr) {
printf(ptr);
return;
}
I wouldn't be amazingly surprised if beginners to Oberon learnt to
import system as the first thing they did (although the C++
using namespace std; example may be closer). Not a critique of
Oberon (I've never seen it), simply that most beginners (reasonably)
want to take the simplest approach.
 
A

August Karlstrom

Ian said:
Considering in C beginners often do things like cast malloc or which
are along the lines of:
void function(char *ptr) {
printf(ptr);
return;
}
I wouldn't be amazingly surprised if beginners to Oberon learnt to
import system as the first thing they did (although the C++
using namespace std; example may be closer). Not a critique of
Oberon (I've never seen it), simply that most beginners (reasonably)
want to take the simplest approach.

Well, the instructor can prohibit the use of the system module in
assignments. Moreover, the low-level aspects of a language is typically
not the first thing you learn, so a beginner will probably not know
about the existence of a system module until the instructor has
introduced it.


August
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
474,175
Messages
2,570,942
Members
47,489
Latest member
BrigidaD91

Latest Threads

Top