I have no programming experience. Would you recommend C?

R

Richard Bos

Chris Hills said:
What is an ivy league university?

Things like Yale and Harvard. Law schools. If you want a _real_
scientific institution, try MIT or CalTech.

Richard
 
N

Nick Keighley

please don't do that

I don't know.
For instance in the bioinformatics course we taught people to program using
Java. The problem was that, for many, object-orientation was a step too far.
For instance I once told a girl to reverse an array, and she just looked at
me blankly. The idea of doing something in a unit hadn't sunk in.

Another important point is that the source code for my Basic is available,
and relatively short and readable. So it helps to demystify the tool.

In conventional Basic subroutines are pretty unusable because there are no
local variables, no way of passing parameters, and the line system means you
cannot cut and paste code between programs.

and hence SHOULD NOT be used to teach beginners. I thought BASIC
with line numbers had died decades ago...
 
C

Chris Hills

Richard Bos said:
Things like Yale and Harvard. Law schools. If you want a _real_
scientific institution, try MIT or CalTech.

Richard

I thought that they were more business orientated. So whoever thinks
they are the "best circles" for computing and Sw engineering is a
little suspect when it comes to computing.

No one uses Lisp for a first language in the best (computing) circles.
 
C

Charlton Wilbur

CH> I thought that they were more business orientated. So whoever
CH> thinks they are the "best circles" for computing and Sw
CH> engineering is a little suspect when it comes to computing.

Er, they are "business orientated" in the same way that Oxford and
Cambridge are -- it's possible to treat them as respectable finishing
schools for upper-class men and women, but there's a lot more to the
school than that.

But they're also centers of research and advanced studies. The
Harvard architecture lost out to the von Neumann architecture
(designed at Princeton) for a lot of reasons, but it was a contender.
ENIAC was designed and built at the University of Pennsylvania.
Einstein and John Nash did their work at Princeton.

Anyone who isn't aware of what the Ivy League is, and who harbors the
misconception that they're "business orientated" schools is in no
position to be passing judgment on what the best academic circles are.

Charlton
 
J

John Bode

Enteng said:
Hi I'm thinking about learning C as my first programming language.
Would you recommend it?

I do not recommend C as a teaching language. For someone who's never
written code before, some of C's conventions can be baffling and
counterintuitive. Its lack of support for basic graphics, sound,
networking, etc., makes any "interesting" applications non-trivial to
write.

C was designed for people who were already expert programmers and
wanted more flexibility than the other languages of the time allowed.
It's certainly a fun language to play with, and in the right hands is
an extremely powerful tool. But it's not an appropriate tool for
learning how to program.
Also how do you suggest that I learn it?What books/tutorials should I
read for someone like me?

Another problem with C as a teaching language is that 99% of all books
and Web-based tutorials on it are *crap*. Many do not teach the
language correctly and encourage bad programming habits (the first
edition of Herb Schildt's "C: The Complete Reference" is often held up
as an example of how *not* to write a book on C). Kernighan and
Ritchie's "The C Programming Language" is accurate (one would hope so,
as they're the ones who originally developed the language), but doesn't
offer that much in the way of tutorials.

I would seriously suggest looking elsewhere for an introductory
programming language. Although my experience with them is minimal,
I've heard good things about Python and Ruby. If you're interested in
object-oriented programming, you might want to look at Java or, if on
Windows, C# for .Net. C++ inherits most of C's weirdness and adds some
of its own; again, not the best tool for learning how to program from
the ground up.
 
M

Malcolm McLean

Flash Gordon said:
Well, since your implementation does even include subroutines the only
thing I would use it for is illustrating what a programming language
should NOT be.
Procedural decomposition aka "structured programming" is one programming
methodology. Some people are so used to it that they confuse it with "good
programming". Though the various methodologies have to be taught, it is not
obvious to me that an introductory language is the place to do it.
 
M

Malcolm McLean

Not really. C is a very programmer unfriendly language.
C is portable assembler. If you know a real assembly language you will
appreciate the value of it. Otherwise, learning it can be quite a baffling
experience.

For instance, when I started to learn C I didn't know what a pointer was. So
I looked it up and read "indirection operator". So I then understood
pointers. For a non-assembly programming person, it is much more difficult.
 
M

Malcolm McLean

Chris Hills said:
What is an ivy league university?


This pre-supposed that US universities are "the best circles" something
most outside the US would argue with.
Programming languages are not social affectations like "How do you do?"
versus "Pleased to meet you". Can't you see that if someone pretends that
they are, the post is not meant to be taken entirely seriously? It just
becomes embarrassing when people don't take the post in the spirit it was
intended.
 
S

Spiros Bousbouras

John said:
I would seriously suggest looking elsewhere for an introductory
programming language. Although my experience with them is minimal,
I've heard good things about Python and Ruby. If you're interested in
object-oriented programming, you might want to look at Java or, if on
Windows, C# for .Net.

This seems to suggest that Python and Ruby are
not suitable for OOP. This of course is not true.
Ruby was designed with the explicit purpose of
offering better support for OOP than Python.
 
M

Malcolm McLean

Roland Pibinger said:
You frequently see job ads for 'C/C++ programmers'. Those people are
supposed to be proficient in a programming style that can be
characterized as C with classes. The (to be maintained) program
usually is written in procedural C style enhanced with some C++
^^^^^^^
constructs, especially classes (sometimes with excessive inheritance
hierarchies), but without 'advanced' C++ features like exception
handling and templates. This programming style was created in the
early nineties and seems to be prevalent to this day. In that sense
the Deitels certainly deliver something that their customers want.
The word you are looking for is "beautified".
 
F

Flash Gordon

Malcolm McLean wrote, On 22/01/07 20:31:
Procedural decomposition aka "structured programming" is one programming
methodology. Some people are so used to it that they confuse it with "good
programming". Though the various methodologies have to be taught, it is not
obvious to me that an introductory language is the place to do it.

Unless you are talking about Visual Basic or some other bastardisation
then Basic does not have any support for OOP, functional programming or
any other method of breaking either the problem or program in to
manageable blocks other than through procedural composition. Since the
Basic in question does not have subroutines (or procedures or some
equivalent) I somehow doubt it has support for any other form of
programming other than the "one big mess" method which is a *very* bad
method. A programming language that only supports the "very big mess"
method should not be taught as anything other than an example of what
should not be.

If it does support some other method but not subroutines then I would
suggest it is something other than Basic that just happens to share some
of the same syntax and features. Just as Java is not C but some other
language that shares some of the syntax and features.
 
P

Paddy3118

Enteng said:
Hi I'm thinking about learning C as my first programming language.
Would you recommend it?
Also how do you suggest that I learn it?What books/tutorials should I
read for someone like me?

Thanks in advance!

-entengk
No, not as your first.
Learn Python first. http://wiki.python.org/moin/BeginnersGuide It is
simple and powerful. Built to get the most out of the programmer,
Python has a shallow learning curve meaning you can get a lot out of
Python early-on, whilst it scales very well to large,
enterprise-running applications.

With Python, you have easy access to procedural, object oriented or
functional styles of programming, and have access to a large,
high-quality, standard library that comes with the distribution that
ill allow you to solve problems in a wide range of fields.

C is a very important language however and you should also plan to
learn C later.

- Paddy.
 
R

Richard Bos

Malcolm McLean said:
C is portable assembler.

Nonsense. It's hardly the ideal beginners' language, but if you think
it's a portable assembler you know neither C nor assemblers very well.

Richard
 
R

Richard Heathfield

John Bode said:

Kernighan and
Ritchie's "The C Programming Language" is accurate (one would hope so,
as they're the ones who originally developed the language), but doesn't
offer that much in the way of tutorials.

Chapters 1 through 8 constitute a tutorial. They take up two-thirds of the
book. The rest of the book is a reference section.
 
I

Ido.Yehieli

Paddy3118 said:
C is a very important language however and you should also plan to
learn C later.

i agree - I myself started with basic, pascal & python, and moved on
(because of work & uni) to java, scheme & c++ - until finally coming to
c a couple of months ago. It is now my favorite language: although I am
still getting payed to program in java, when at home I program in c.

Nevertheless I have at the beginning found it quite difficult, even
though I was already familiar with programming. C should maybe be your
2nd or 3rd language, take it easy for the 1st one (e.g. with python or
pascal).

A great python tutorial: docs.python.org/tut/

Ido.
 
M

Malcolm McLean

Richard Bos said:
Nonsense. It's hardly the ideal beginners' language, but if you think
it's a portable assembler you know neither C nor assemblers very well.
Or in other words, "some people have described C as a 'portable assembler'
but personally I disagree with them".

Much nicer way of expressing yourself, don't you think?
 
M

Malcolm McLean

Flash Gordon said:
Malcolm McLean wrote, On 22/01/07 20:31:

Unless you are talking about Visual Basic or some other bastardisation
then Basic does not have any support for OOP, functional programming or
any other method of breaking either the problem or program in to
manageable blocks other than through procedural composition. Since the
Basic in question does not have subroutines (or procedures or some
equivalent) I somehow doubt it has support for any other form of
programming other than the "one big mess" method which is a *very* bad
method. A programming language that only supports the "very big mess"
method should not be taught as anything other than an example of what
should not be.

If it does support some other method but not subroutines then I would
suggest it is something other than Basic that just happens to share some
of the same syntax and features. Just as Java is not C but some other
language that shares some of the syntax and features.
The programming methodology, be that sturctureed programming, a state
machine, object-orientation, is not a characteristic of the language the
program happens to be written in.

MiniBasic doesn't provide support for any of these methodologies, that is,
constructs that make it particularly easy to use them. I did consider adding
subroutines. However they add complexity after complexity to both the
language speciifcation and the implementation, and the design goal was that
the interpreter should be simple enough for someone with no previous
experience in writing scripting aplications to understnad and modify, also
for the language to be simple enough for a non-programmer to write programs
in. I think I made the right call on it.

If you don't know what you are doing, you can create a much bigger mess with
subroutines than without. However obviously you wouldn't use MiniBasic for a
major project, unless completley crazed.

As for BASICdraw, it is basically a structured program, but it abstracts the
image processing logic.

If you want to play with BASICdraw, download it from

http://www.personal.leeds.ac.uk/~bgy1mm
 
F

Flash Gordon

Malcolm McLean wrote, On 23/01/07 23:52:
The programming methodology, be that sturctureed programming, a state
machine, object-orientation, is not a characteristic of the language the
program happens to be written in.

No, but using OO in Fortran77 is not easy and so would a lot of the
functional programming I was taught many years ago, I don't think
procedural programming is easy in LISP and so on. As described it would
be hard to use any of the methodologies used for any significant sized
(more than 20 line and often even under that) project in your Basic.
MiniBasic doesn't provide support for any of these methodologies, that is,
constructs that make it particularly easy to use them.

I find that without such constructs it normally getting painful by 20
lines where the 20 lines include comments and blank lines.
> I did consider adding
subroutines. However they add complexity after complexity to both the
language speciifcation and the implementation, and the design goal was that
the interpreter should be simple enough for someone with no previous
experience in writing scripting aplications to understnad and modify, also
for the language to be simple enough for a non-programmer to write programs
in. I think I made the right call on it.

As you may have noticed I disagree. Unless it is for "programs" under 20
lines long in which case you might as well stick to a subset of whatever
scripting language is installed by default.

Also some people *do* reach the point of needing
functions/subroutines/object/whatever to break down their programs
within a week of starting to program, and since this thread is about
someone wanting to learn, how is therefore probably motivated to put in
the effort to do this, your MiniBasic is not appropriate since the OP
could well have outgrown it within a week.
If you don't know what you are doing, you can create a much bigger mess with
subroutines than without. However obviously you wouldn't use MiniBasic for a
major project, unless completley crazed.

I would not even bother with it for a 10 line script. If it is worth the
effort of using something beyond what MSDOS 3 provides as in command.com
it is worth using something better than MiniBasic.
As for BASICdraw, it is basically a structured program, but it abstracts the
image processing logic.

If you want to play with BASICdraw, download it from

http://www.personal.leeds.ac.uk/~bgy1mm

I know that some versions of Basic are extremely good, My comments where
specifically about a version of Basic lacking even subroutines.

By the way, I would also recommend against a beginner starting with a
basic that did not at least have procedures and multi-line functions
since procedures and multi-line functions are easier to use than
subroutines and plenty of basic implementations provide them.

However, all of this has nothing to do with C and so does not belong
here. Feel free to have the last word if you want.
 
M

Malcolm McLean

Flash Gordon said:
Malcolm McLean wrote, On 23/01/07 23:52:

No, but using OO in Fortran77 is not easy and so would a lot of the
functional programming I was taught many years ago, I don't think
procedural programming is easy in LISP and so on. As described it would be
hard to use any of the methodologies used for any significant sized (more
than 20 line and often even under that) project in your Basic.
MiniBasic is designed for short programs, or rather functions. The
implementor of a program incorporating MiniBasic scripts will add everything
except the core logic.
If you go to my website
http://www.personal.leeds.ac.uk/~bgy1mm
and look up BASICDraw, user programs, you will see that the majority of
programs for it are indeed about twenty lines long. Not a single one is over
fifty lines.
I find that without such constructs it normally getting painful by 20
lines where the 20 lines include comments and blank lines.
You can read more than twenty lines of a book without any structure?
It depends what the program is doing. If it is carrying out tasks
sequentially, you gain little from decomposing them into subroutines.
However if there is a lot of looping and complex flow control, it can help
to limit the size of a jump.
As you may have noticed I disagree. Unless it is for "programs" under 20
lines long in which case you might as well stick to a subset of whatever
scripting language is installed by default.
Then modify BASICdraw to use DOS shell scripts for the image processing
logic.
Also some people *do* reach the point of needing
functions/subroutines/object/whatever to break down their programs within
a week of starting to program, and since this thread is about someone
wanting to learn, how is therefore probably motivated to put in the effort
to do this, your MiniBasic is not appropriate since the OP could well have
outgrown it within a week.
That's good news. He spends a week, and at the end of the week has mastered
a language. Now he can understnad every possible program for BASICdraw.
Of course he then has to move on, unless he is an artist just needing a
little bit of scripting from drawing programs. But he has an achievement
under his belt. AS opposed to a C++ programmer who sees a "real" C++ program
and can make neither head nor tail of it.
I would not even bother with it for a 10 line script. If it is worth the
effort of using something beyond what MSDOS 3 provides as in command.com
it is worth using something better than MiniBasic.
Modify BASICdraw to use MSDOS 3 command scripting for the image processing
logic.
I know that some versions of Basic are extremely good, My comments where
specifically about a version of Basic lacking even subroutines.

By the way, I would also recommend against a beginner starting with a
basic that did not at least have procedures and multi-line functions since
procedures and multi-line functions are easier to use than subroutines and
plenty of basic implementations provide them.
Exactly. Thats where endless complications creep in. Yu see now the wisdom
of the design decision not to include subroutines?
However, all of this has nothing to do with C and so does not belong here.
Feel free to have the last word if you want.
You obviously haven't downloaded BASICdraw and played with it. Yet you feel
qualified to criticise the language, because you know that a language
without subroutines can't be a good thing.
Here's a few programs for BASICdraw

fade, 25 lines, does a potrait style circular washout of an image
wash, 16 lines, does bilineqr interplolation
mirrortile, 20 lines, tile surface with mirroring
liner, 35 lines, reduces and image to black and white edges
piechart, 42 lines, draw pie charts
barchart, 21 lines, draws bar charts
randlife, 34 lines, version of Conway's Life with a twist
retint, 19 lines, tint colour correction
contrast, 23 lines, contrast correction
fadedbar, 28 lines, bar chart with randomised normal error indicators
perspective, 17 lines, perspective transform an image
dither, 25 lines, dither an image
randtile, 36 lines, random tiling of an image

On what basis do you say that the language is not highly effective for its
purpose?

However it is not obvious that a good language could not be made even better
by adding subroutines. If anyone has any constructive suggestions for doing
this I am certainly open to them.
 

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

Members online

Forum statistics

Threads
474,262
Messages
2,571,049
Members
48,769
Latest member
Clifft

Latest Threads

Top