[LUGSB] Why is static analysis bad for beginners?

Harlan Crystal harlan at sdf1.cc
Fri Dec 12 01:17:31 EST 2003


I was trying to avoid posting to this thread, but...this one sucked me
in.

In the list of reasons bash would be good for beginners:

> [...]
> Bash doesn't have forced data types, 
> [...]

I never really understood this sort of argument:  Why would static
analysis be _BAD_ for a beginner?

Yes yes yes, it sucks for them to have to deal with lots of constraints
to get their code to compile, but at least once they get it compiling it
rules out a HUGE class of problems -- problems that are MUCH MUCH more 
difficult to debug at runtime if you're new to programming.

--harlan
"big fan of static analysis"
"also a big fan of OCaml, but would suggest learning SML first"
>From mgraffam at mathlab.sunysb.edu Fri Dec 12 13:14:57 2003
Received: from SunRa.mathlab.sunysb.edu (SunRa.mathlab.sunysb.edu
	[129.49.17.48])hBCIEvU7031477
	for <lugsb at fsl.cs.sunysb.edu>; Fri, 12 Dec 2003 13:14:57 -0500
Received: from SunRa.mathlab.sunysb.edu (localhost [127.0.0.1])
	hBCIFMWO002334
	for <lugsb at fsl.cs.sunysb.edu>; Fri, 12 Dec 2003 13:15:22 -0500 (EST)
Received: from localhost (mgraffam at localhost)hBCIFLpC002331
	for <lugsb at fsl.cs.sunysb.edu>; Fri, 12 Dec 2003 13:15:21 -0500 (EST)
X-Authentication-Warning: SunRa.mathlab.sunysb.edu: mgraffam owned process
	doing -bs
Date: Fri, 12 Dec 2003 13:15:21 -0500 (EST)
From: Michael Graffam <mgraffam at mathlab.sunysb.edu>
To: Linux Users Group at Stony Brook <lugsb at fsl.cs.sunysb.edu>
Subject: Re: [LUGSB] Why is static analysis bad for beginners?
In-Reply-To: <20031212061729.GA18769 at sdf1.cc>
Message-ID: <Pine.GSO.4.44.0312121256370.1394-100000 at SunRa.mathlab.sunysb.edu>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
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: Fri, 12 Dec 2003 18:14:57 -0000



On Fri, 12 Dec 2003, Harlan Crystal wrote:

> In the list of reasons bash would be good for beginners:
>
> > [...]
> > Bash doesn't have forced data types,
> > [...]
>
> I never really understood this sort of argument:  Why would static
> analysis be _BAD_ for a beginner?

One of the big reasons: atol and other conversion routines.

> Yes yes yes, it sucks for them to have to deal with lots of constraints
> to get their code to compile, but at least once they get it compiling it
> rules out a HUGE class of problems -- problems that are MUCH MUCH more
> difficult to debug at runtime if you're new to programming.

Hogwash. When you're new to programming the difficult things are trying
to find out why the stupid machine won't add 3 to "6", or where the ;
is supposed to go, and where it isn't.

And thats one good thing about Bash -- it uses shell syntax, so if the
user is familiar with creating complex one-line Bash commands, much of
the syntax rules must already have been internalized.

I've taught real users to code -- not geeks, not mathematicians or
engineers -- but ordinary users who want to program to make their
computing lives easier. These people don't need to know the difference
between a string and a float, or a float and an int. They don't need to
know that there are long ints as well as short ints.

Sure, for major software engineering, Bash might not be the right tool.

But Java sure as hell isn't the right tool to convert space in your MP3
filenames to underscore.

Bash is a good first language because it is geared to solve the sort of
problems that people have. You don't have to invent reasons to code in
Bash, which is the best reason for a newbie to learn it, I think.



More information about the lugsb mailing list