[Haifux] My "Stop Using (and Teaching) C-Shell and Tcsh" Page

Shlomi Fish shlomif at iglu.org.il
Fri Oct 19 18:19:12 MSD 2007


Hi Orr!

For some reason, I'm receiving the emails that you send to me, but not the 
emails you send to the mailing list. It's a bit annoying. And I do receive 
emails that get sent to the mailing list.

On Thursday 18 October 2007, Orr Dunkelman wrote:
> On 10/18/07, Shlomi Fish <shlomif at iglu.org.il> wrote:
> > Indeed. I always find it a curious fact when Matam/Mamat students were
> > instructed to solve exercises without using sed or awk, or in one line of
> > C-shell. This may indicate that they want to design clever exercises, but
> > not
> > to really teach the beauty of shell scripting.
>
> Exactly. The point is not to teach the beauty of shell scripting.
>

Then what is the point? To teach a crippled programming language, not unlike 
many others?

> I suggest you'll approach the lecturers in charge to get a better
> understanding why they teach this shell rather than that shell (like Eyal
> did).

Maybe I will. But I still think my Anti-csh page was a good idea for 
concentrating all the arguments in one place.

>
> As for the "beauty" thing - beauty is in the eye of the beholder.
>

True, but I think we all can agree that shell scripting without sed, awk, 
find, and much less Perl or whatever, is much less beautiful than shell 
scripting with them. And I don't see a point in teaching it this way.

> > Well, from what I understood, up to a point TX still carried a Perl that
> > was
> > 9-years-old or so (Nadav can fill the details). But even if it didn't
> > carry
> > bash, then bash was easily installable there.
>
> Yes and no.
>
> Unlike what many people think, installing software on a server with
> multiple users is not as simple as running yum/rpm/whatever your distro is
> using.
>
> It is an obligation by the staff to support, update (to some extent),
> insure backward competability (in the case of updates), etc. The claim that
> "It's easy to install" is wrong for systems which you do not own, nor
> understand all the technical (or political) aspects related to.
>

Well, you can always install bash under some obscure path 
(like /usr/local/DO-NOT-USE/gnu/bin). That way it would be useful for the 
people doing the exercises, but people will know not to rely on it. And from 
what is said here:

http://tech.groups.yahoo.com/group/hackers-il/message/4881

Maintaining tcsh is quite an headache in itself. This is while bash tends to 
be pretty straightforward to maintain.

> > > Seeing as C and shell-scripting are used for inherently different
> >
> > purposes,
> >
> > > I do not see why this is an advantage; furthermore, I think that in the
> > > exercises which are being taught, far too much stress is being put on
> >
> > loops
> >
> > > and "if" statemenets; Too little on effective usage of "&&" and "||"
> > > operators. Also, extremely useful unix commands such as sed and find
> > > are not taught, and I have actually seen an exercise given in the
> > > course
> >
> > where
> >
> > > the students implement a crippled version of "find". More relevant uses
> >
> > for
> >
> > > shell scripts are never brought as an example - students are not shown,
> >
> > for
> >
> > > example, how to use them in conjunction with "make" in order to create
> > > a test suite for their programs. If you want to teach scripting - use a
> > > scripting language (preferably something more organized than perl, like
> > > Python). If you want to teach SHELL scripting, the exercises must be
> > > relevant to that style of programming.
> >
> > Right.
>
> Please note that the idea is not to teach UNIX, but to teach on the
> existance of a tool called shell scripting.

Correct.

> For us it is very easy to say "yeah, this can be solved by find". But these
> students need to learn how to implement find in a crippled scripting
> language, because when they'll leave the academy and go to the dark side,
> a.k.a., industry, they will have to work on machines which are not even
> POSIX complaint!

And I expect these machines to have an equivalent to a find command. Or you 
can compile GNU find there.

But back to our point - yes, students should know how to implement something 
like find. But it's not a good practice to use it in one's shell script, not 
the right way to do it, and that's what find (which will take some time to 
implement properly by hand) is meant for.

An exercise of implementing a find-like command without using find may be a 
good one, but find should also be taught.

>
> People, please remember we are talking on a degree in computer science (or
> EE), i.e., you do not learn JAVA, you learn OOP methodology (for example,
> by using JAVA). These two things are completely different.

First of all, it's not "JAVA" it's "Java". Secondly, I agree, but if you learn 
shell scripting, then find is part of shell scripting.

>
> > > * One-liners are not possible - blocks have to start on separate lines.
> > > This makes tcsh very uncomfortable to use in interactive mode.
> >
> > I know and I've explicitly mentioned it in my original article:
> >
> > <<<<<<
> > Entire Bash mini-programs can be written, tested and debugged in one
> > line. This is impossible to do in csh which forces loops to be on
> > separate lines.
>
> oh, these kids who never worked on COBOL... ;)

Let me know when you'll be ready to have COBOL as your shell. ;-)

Regards,

	Shlomi Fish

---------------------------------------------------------------------
Shlomi Fish      shlomif at iglu.org.il
Homepage:        http://www.shlomifish.org/

If it's not in my E-mail it doesn't happen. And if my E-mail is saying
one thing, and everything else says something else - E-mail will conquer.
    -- An Israeli Linuxer



More information about the Haifux mailing list