[LUGSB] What do you think would be a good "first programming language", and why?

Adam David Alan Martin addmarti at ic.sunysb.edu
Thu Dec 11 14:10:23 EST 2003


Okay, I just have to comment on this....


On Thu, 11 Dec 2003, Charles P. Wright wrote:

> I agree with Vinay about learning C and learning C well.  In my mind,
> there three are very important reasons to learn C aside from the syntax:
> (1) C has pointers.  You need to learn how to treat memory as an array
> of bytes.  If you go from Java to C, you'll just have to learn this
> later and people get mightily confused.
> (2) C doesn't have garbage collection.  You should learn how to write a
> program while cleaning up after yourself.
> (3) C uses system calls.  If you want to learn about the system on a
> lower level you need to use system calls.
(I dunno Chip... I wouldn't call the C calls in man section 3 "system calls"...
Now if we're talking about section 2... that's another story.)

Some reasons to ALSO choose C:
	UNIX was written (the SECOND time around), in C.  C was created
with the writing of OS'es in mind.  C and UNIX grew up together, so these
days, using C on any UNIX, or Unix-like platform is... a no brainer.

	C doesn't give you ANY kind of cushy environment.  I would call it:
WYSIWYG, but then WIMP bigots will kill me.  C will NOT clean up after any
brain-dead things you do.  You write it; it does PRECISELY what you've written.
Seems simple, but this lends itself to much more intense debugging sessions;
as you must track down EVERY last detail.  It does train you well, at that.

	C also is VERY loose in it's treatment of how you address variables,
and memory.  If you know how your compiler will set things up, well enough,
you can go reference ANY variable, anywhere, in some VERY crazy ways.  This
kind of thing CAN be useful.

Those of course are reasons to NOT choose C, if you're worried about
difficulties.
>
> C++ is yucky.  If you want to learn an OOP language then Java is much
> cleaner.

Yeah... C++....   It's gone to hell these days.  The original intent of
C++, just providing a MINIMAL OOP framework to C had some INTERESTING
posibilities; but the OOP zealots have taken this one to the devil itself.

Still useful to have around, when you need to tack a tiny bit of OOP stuff onto
a C project.

> That being said.  The advantages of learning Java instead of C are:
> (1) Java has references instead of pointers.  You don't have to learn
> about pointer arithmetic.
> (2) Java has garbage collection.  This makes things easier.
> (3) Java is cross platform, so you don't need to learn system calls.
> (4) Java has a huge stock library.  If you need a hash table, there is
> already one there for you.  Same thing with trees, and even more.

	Do not discount the fact that C does have AVAILABLE libraries for
hash-tables, b-trees, and more; but are not necessarily platform-portable.  This
unfortunately lends itself to both library-wars; and the evil "rewrite"
syndrome.  All this because the standard lib's for C are VERY rudimentary.

	Java doesn't let you make certain kinds of mistakes that you can
make with more low-level languages.  Java is cross-platform in the compiled
code, but it's also VERY slow compared with other languages.

	Java will make the entry to programming easier; but it does so by
throwing out certain perils that are bound to occur elsewhere.  Java also
seems to have this mysterious effect upon CS dept's at all colleges....
It becomes the "Be-all, End-all" of programming languages, leading to such
time-wasters, as a compleat OS kernel in Java; or an EE dept that built a
physical JVM.  (Or a JM, then...)

> I wouldn't consider spending much time on anything else if you want to
> learn how to program.  Perl is useful for quick hacks, but the syntax is
> awfully complex and obtuse.  Lisp is only useful for CSE307 and editing
> your .emacs file.  Shell is only really useful if you want to glue
> existing programs together.

Perl and Python fall into that category that Larry Wall called: "Glue languages"
IMHO.  They're REALLY great for taking bits of shell-code, and some smaller C
programmes, and glueing it all together into a workable project.  Python has
saved the day for me many times; by being great at small quick-and-dirty hacks.

Perl would do the same for you too.  Either is just a matter of syntactic
and mental preference.


> On Thu, 2003-12-11 at 03:26, Vinay Pai wrote:
> > I would strongly recommend C. Many modern languages derive their syntax
> > from C, so you'll be learning a lot more than just one language.

	Ehh....  I know some old FORTRAN and COBOL boffins who'll flay you
alive for that statement.  That said; yes...  Java, C++, and lots of others
derive from C....  Course C came lineagewise from algol....  I'll spare
you all the history lesson; which i'll probably get partially wrong anyhow.

> > That said, I think its more important that you learn ONE language very
> > well, whatever that language may be. Ideas regarding how to structure
> > programs, how to accomplish common tasks etc. are far more important than
> > learning the syntax of a language. Those things only really come with
> > experience. Once you have those things straight you ought to be able to
> > pick up a book or tutorial and learn any new language in a matter of days
> > or weeks.

Quite.  I couldn't agree more.  Flailing about the programming language
landscape (Which was a very good book, btw, on this kind of stuff...) is the
easiest way to get discouraged.  Pick a language that you at least feel
comfortable working with

> > > I briefly brought up during the last meeting, a question of, what would
> > > be a "good" first programming language to learn? Yes, I know, this is
> > > subject to your opinion, but as a novice good advice is scarce -- with
> > > the exception of LILUG of-course. Any and all suggestions are greatly
> > > appreciated.
> > >
> > > Listed below is my previous programming experience:
> > >
> > > -- very little shell scripting (bash)

Have you gotten to conditionals and looping in bash?  This is important,
otherwise it's just basically laundry-listing programmes, not writing a new one.

> > > -- sadly, VB.Net (I can hack a small program)
> > >      + specifically, I have an understanding of subroutines, functions,
> > > and loops (if, while, case)
This is good to start with.  The hardest part will be learning the new syntax,
and environments.


However you decide to enter the realm of programming, don't get discouraged by
early failures.  Keep at it, and don't just switch to another
language/environment, because you can't get something to work.  No language
is perfect, and not all are right for the same job.  But for learning, and
beginner tasks, all will be fine.  Just keep trying various projects, and such,
to develop the skills necessary.  That's the important part.

Good luck.


If you've made it this far, congrats.  And yes; I am a C/assembly bigot...
I've never found any substitute for C when doing LARGE projects....  And
when speed counts... break out the ASM, I say!


--
Adam Martin
>From ezk at fsl.cs.sunysb.edu Thu Dec 11 14:52:09 2003
Received: from agora.fsl.cs.sunysb.edu
	(IDENT:mgBYtdtviGQADMwgr8OCHenpLy204fyk at agora.fsl.cs.sunysb.edu
	[130.245.126.12])hBBJq9U7001959
	for <lugsb at fsl.cs.sunysb.edu>; Thu, 11 Dec 2003 14:52:09 -0500
Received: from agora.fsl.cs.sunysb.edu
	(IDENT:+0YOvR5055GcgKS8JY1z7mRgvwlYUkaa at localhost.localdomain [127.0.0.1])
	hBBJqVh7011606
	for <lugsb at fsl.cs.sunysb.edu>; Thu, 11 Dec 2003 14:52:32 -0500
Received: (from ezk at localhost)
	by agora.fsl.cs.sunysb.edu (8.12.8/8.12.8/Submit) id hBBJqVbv011602;
	Thu, 11 Dec 2003 14:52:31 -0500
Date: Thu, 11 Dec 2003 14:52:31 -0500
Message-Id: <200312111952.hBBJqVbv011602 at agora.fsl.cs.sunysb.edu>
From: Erez Zadok <ezk at cs.sunysb.edu>
To: Linux Users Group at Stony Brook <lugsb at fsl.cs.sunysb.edu>
Subject: Re: [LUGSB] What do you think would be a good "first programming
	language", and why? 
In-reply-to: Your message of "Thu, 11 Dec 2003 14:10:23 EST."
             <Pine.SOL.4.58.0312111345400.20732 at sparky.ic.sunysb.edu> 
X-MailKey: Erez_Zadok
X-BeenThere: lugsb at fsl.cs.sunysb.edu
X-Mailman-Version: 2.1.1
Precedence: list
Reply-To: Linux Users Group at Stony Brook <lugsb at fsl.cs.sunysb.edu>
List-Id: Linux Users Group at Stony Brook <lugsb.fsl.cs.sunysb.edu>
List-Unsubscribe: <http://www.fsl.cs.sunysb.edu/mailman/listinfo/lugsb>,
	<mailto:lugsb-request at fsl.cs.sunysb.edu?subject=unsubscribe>
List-Archive: <http://lists.fsl.cs.sunysb.edu/pipermail/lugsb>
List-Post: <mailto:lugsb at fsl.cs.sunysb.edu>
List-Help: <mailto:lugsb-request at fsl.cs.sunysb.edu?subject=help>
List-Subscribe: <http://www.fsl.cs.sunysb.edu/mailman/listinfo/lugsb>,
	<mailto:lugsb-request at fsl.cs.sunysb.edu?subject=subscribe>
X-List-Received-Date: Thu, 11 Dec 2003 19:52:09 -0000

Currently, the best programming language to learn first is Java, hands down.
It's simple, elegant, illustrates many basic concepts well, and is strongly
typed; also lots of great books on it are available.

Many CS departments have changed their intro courses in the past decade to
Java (from Scheme, C, Pascal, or C++).

A lisp-like language is also good as a starting language, but I find
lisp-based languages too impractical for common use once you graduate.
They're great for teaching concepts such as dynamic scoping and data-is-code
and functional programming.  But you cannot do much w/ LISP once you
graduate.

C is a bad starting language to program in.  C is what people call a
"low-level high-level language": it's too close to the hardware and OS to
separate the programming principles from architectural oddities.  Learning a
programming language is a scary and daunting task to new students; they have
to worry about lots of stuff already in the code.  Adding pointers, weak
typing, and a separation of interfaces vs. implementations are very
confusing and frustrating.  (Trust me: I taught a "C Programming for
Non-Majors" at Columbia.)  There's no way to teach pointers properly without
covering some OS and compiler concepts -- exactly what I do in CSE-376, but
it's not intended for first/second year students.

C++ is a terrible starting language.  It is a hugely complex language, with
all of the baggage of C.

I cannot think of a single scripting language that's better than Java as a
first programming experience.

That said, the dept. will be offering a new course (CSE-130) next semester,
which is an intro to C for non-majors.  It'll be interesting to see how
it'll go.  For sure it'd be a challenge to teach such a course.

Finally, while I think Java is a great and very practical intro language, I
don't think anyone should graduate w/o also knowing a lot of C, and have
some exposure to C++, Lisp, and Perl/Shell.  C is clearly here to stay and
has a very useful "market" that won't switch to anything else for the
foreseeable future.

Erez.
>From scallana at ic.sunysb.edu Thu Dec 11 17:13:12 2003
Received: from mail.ic.sunysb.edu (mail.ic.sunysb.edu [129.49.1.4])
	hBBMDCU7009813
	for <lugsb at fsl.cs.sunysb.edu>; Thu, 11 Dec 2003 17:13:12 -0500
Received: from postal.ic.sunysb.edu (mail [129.49.1.4])
	by mail.ic.sunysb.edu (8.12.10/8.12.10) with SMTP id hBBMCJc5002429
	for <lugsb at fsl.cs.sunysb.edu>; Thu, 11 Dec 2003 17:13:35 -0500 (EST)
Received: from smtp.ic.sunysb.edu ([129.49.1.24])
 by postal.ic.sunysb.edu (SAVSMTP 3.1.1.32) with SMTP id M2003121117133432182
 for <lugsb at fsl.cs.sunysb.edu>; Thu, 11 Dec 2003 17:13:34 -0500
Received: from ic.sunysb.edu ([130.245.127.248])
	by smtp.ic.sunysb.edu (8.12.10/8.12.10) with ESMTP id hBBMDZ0h002439
	for <lugsb at fsl.cs.sunysb.edu>; Thu, 11 Dec 2003 17:13:35 -0500 (EST)
Message-ID: <3FD8EBC3.3050302 at ic.sunysb.edu>
Date: Thu, 11 Dec 2003 17:12:19 -0500
From: Sean Callanan <scallana at ic.sunysb.edu>
User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US;
	rv:1.5) Gecko/20031007
X-Accept-Language: en-us, en
MIME-Version: 1.0
To: Linux Users Group at Stony Brook <lugsb at fsl.cs.sunysb.edu>
Subject: Re: [LUGSB] What do you think would be a good "first programming
 language", and why?
References: <200312111952.hBBJqVbv011602 at agora.fsl.cs.sunysb.edu>
In-Reply-To: <200312111952.hBBJqVbv011602 at agora.fsl.cs.sunysb.edu>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-BeenThere: lugsb at fsl.cs.sunysb.edu
X-Mailman-Version: 2.1.1
Precedence: list
Reply-To: Linux Users Group at Stony Brook <lugsb at fsl.cs.sunysb.edu>
List-Id: Linux Users Group at Stony Brook <lugsb.fsl.cs.sunysb.edu>
List-Unsubscribe: <http://www.fsl.cs.sunysb.edu/mailman/listinfo/lugsb>,
	<mailto:lugsb-request at fsl.cs.sunysb.edu?subject=unsubscribe>
List-Archive: <http://lists.fsl.cs.sunysb.edu/pipermail/lugsb>
List-Post: <mailto:lugsb at fsl.cs.sunysb.edu>
List-Help: <mailto:lugsb-request at fsl.cs.sunysb.edu?subject=help>
List-Subscribe: <http://www.fsl.cs.sunysb.edu/mailman/listinfo/lugsb>,
	<mailto:lugsb-request at fsl.cs.sunysb.edu?subject=subscribe>
X-List-Received-Date: Thu, 11 Dec 2003 22:13:12 -0000

Erez Zadok wrote:

>Currently, the best programming language to learn first is Java, hands down. It's simple, elegant, illustrates many basic concepts well, and is strongly typed; also lots of great books on it are available.
>
Java also forces you to learn its standard library, and use a lot of 
object-oriented notation really early on. In all of the introductory 
Java books I've seen, there are a lot of "public" and "static" keywords 
floating around in the introductory programs that the learner has to 
simply take for granted. In addition, you end up having to use either 
(1) a custom library or (2) GUI code or (3) Java's horrendous console 
I/O framework to do I/O.

>C is a bad starting language to program in.  C is what people call a "low-level high-level language": it's too close to the hardware and OS to separate the programming principles from architectural oddities.  
>
And Java is tied to its library and its idea of OOP. I think the 
"oddities" of C could be removed by using something like a C 
interpreter, and moving to compiled code once you've got an idea about 
stdio, argc and argv.

>Learning a programming language is a scary and daunting task to new students; they have to worry about lots of stuff already in the code.  Adding pointers, weak typing, and a separation of interfaces vs. implementations are very confusing and frustrating.
>
Adding OO is, IMO, even more confusing. And separation of interface and 
implementation is not necessary in C.

>There's no way to teach pointers properly without covering some OS and compiler concepts -- exactly what I do in CSE-376, but
>it's not intended for first/second year students.
>
Again a C interpreter would be useful here. Start out with a concept of 
memory as a big array of 8-bit words, talk about variable sizes, memory 
allocation and deallocation... OK, it's not for everyone, but anyone 
who's not able to deal with this stuff probably ought to be looking at a 
pretty interpreted language like Scheme, not a huge OO language like Java.

>C++ is a terrible starting language.  It is a hugely complex language, with all of the baggage of C.
>
Fair enough. I will agree that C++ is worse than even Java.

I agree that it's good to practice concepts that are as general as 
possible without having to deal with the oddities of a particular 
system. But to have data structures without knowing about memory 
allocation and deallocation is not useful for systems programming, and 
if you don't care about systems programming another language is probably 
better anyway. Java is a bad choice whichever path you want to take.

Sincerely,
Sean Callanan



More information about the lugsb mailing list