For Programmers: Free Programming Magazines  


Home > Archive > Compilers > May 2007 > Re: choosing a teaching language, was Java compiler courses









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: choosing a teaching language, was Java compiler courses
Hans-Peter Diettrich

2007-05-13, 4:26 am

Marco van de Voort wrote:

> I somewhat wonder why people think that Java is easier to learn than
> C. In ome of my classes I found the opposite (which surprised me too),
> specially if the students had no prior IT knowledge (they were classes
> for graduated non IT bachelors).
>
> They consistently found C easier to handle. The reason was pretty
> simple, more transparant, less knowledge required for an initial
> program (of any kind).


Then you should choose Basic, if you expect that your audience will
immediately understand how to use a language for writing programs.

> We had them doing walking pointer trees in 5
> ws, while in the paralel Java class they were still struggling with
> inheritance, and explaining what was needed to make a minimal program.


In this case your audience has to understand too much at once:
- writing programs
- writing structured code
- using subroutines
- using pointers (or references)
- using OOP
- using powerful libraries
- designing event driven GUI's
and possibly more less obvious things.

Would people with a COBOL background have had less problems, to move to
C or Java?

> Now, I agree that this is partially due to the tools and
> libraries. (with all their form designing logic) But I don't assume
> people writing this here are using special educational versions of
> Java?


Doesn't writing compilers require, or at least profit, from using
appropriate languages? At least I cannot imagine to write n compiler
in Basic (without extensions), whereas Pascal is well suited for such
an task, without a need for using any additional library.

The use of libraries IMO is an important detail, when talking about
learning and mastering languages. C is a bare bone language without a
library, lacking such fundamental things like string handling and I/O.
The same for C++ or Java, these also are useless without additional
libraries, even if the languages have more features than e.g. C or
Basic. When people have to learn the fundamental library structures
and functions, in addition to a programming language itself, it IMO
doesn't make a difference whether the language is kind of assembly
language or C, honestly. Look at the interface or implementation of a
library - just the declaration syntax of C is better suited to hide
things before the reader, than to explain them. Add the C standard
header files, and their #defines, and try to count only the key
"words", which a person has to learn AND to remember, before she can
read or write useful C code. Then do the same for Java, certainly with
similar results, and then for Pascal...

DoDi

Chris Smith

2007-05-13, 7:18 pm

Hans-Peter Diettrich <DrDiettrich1@aol.com> wrote:
> [...] whereas Pascal is well suited for such
> an task, without a need for using any additional library.


> The same for C++ or Java, these also are useless without additional
> libraries, [...]


Huh? I'm trying to figure out where you're coming from here. Really,
really trying... and it's not coming to me. Did you really just claim
that Java has too FEW standard library routines, but Pascal is fine?

Again, I don't see a strong reason for making any particular choice in
the first place, when teaching compilers. There are lex/yacc-ish
products available for most popular languages, or students can implement
their own in any decent language. If students can't be bothered to
locate their own tools or translate algorithms to their own choice of
language, then they can ask an instructor what to use, and get some
advice.

--
Chris Smith
glen herrmannsfeldt

2007-05-13, 7:18 pm

Chris Smith wrote:

> Hans-Peter Diettrich <DrDiettrich1@aol.com> wrote:


[color=darkred]
[color=darkred]
> Huh? I'm trying to figure out where you're coming from here.


I believe this is the old explicit vs. implicit library call question.
Languages like Fortran use statements such as READ and WRITE for I/O,
which compile into library calls. C and Java explicitly call I/O
functions/methods. There are advantages and divantages of each,
but in most cases the differences aren't that big.

You can extend it to operators vs. function calls, too. Fortran has
the MOD function, C has the % operator. PL/I has the SUBSTR function,
Fortran uses substring notation (start:end), though it isn't an
operator. (It can't be applied to string expressions, only to
CHARACTER variables.) C has bitwise logical operators, Fortran has
bitwise logical functions.

-- glen
kenney@cix.compulink.co.uk

2007-05-16, 4:20 am

cdsmith@twu.net (Chris Smith) wrote:

> Did you really just claim
> that Java has too FEW standard library routines, but Pascal is fine?


I think the point he his trying to make is that both Pascal and Basic
originated as languages to teach programming. Object Pascal as used in
Delphi can but does not have to be used for OO programming. The OO parts
are extensions to a more or less standard Pascal.

Ken Young

Marco van de Voort

2007-05-16, 4:20 am

On 2007-05-11, Hans-Peter Diettrich <DrDiettrich1@aol.com> wrote:
>
> Then you should choose Basic, if you expect that your audience will
> immediately understand how to use a language for writing programs.


If I'd buy the ease of use in Basic myth, I would yes. Moreover I'm still
teaching, not producing.

>
> In this case your audience has to understand too much at once:
> - writing programs
> - writing structured code
> - using subroutines
> - using pointers (or references)
> - using OOP
> - using powerful libraries
> - designing event driven GUI's
> and possibly more less obvious things.
>
> Would people with a COBOL background have had less problems, to move to
> C or Java?


Don't know. Don't get to many students with Cobol backgroun nowadays.

>
> Doesn't writing compilers require, or at least profit, from using
> appropriate languages?


Sure. The ML discussion. But the question is if it is worth it, if I have to
teach a language (in a different class even) before I can start.

Note also that I only made a remark about the "ease of learning" of Java.
(in practice, which is more than the mere language). People always assume it
as easier. But e.g. engineering students I experienced could deal with quite
some complexity and could be precise with e.g. pointers) as long as it was
transparant, which was the devil in Java's case.

> At least I cannot imagine to write n compiler in Basic (without
> extensions), whereas Pascal is well suited for such an task, without a
> need for using any additional library.


> The use of libraries IMO is an important detail, when talking about
> learning and mastering languages. C is a bare bone language without a
> library, lacking such fundamental things like string handling and I/O.


Sure. One could probably teach Java too cmdline. Note that that was part of
what I meant. The whole system must be suitable. Libraries, toolchain,
examples etc. In the Java case, typical programs require inheritance.

The mere availability of stuff like a form designer is a distraction. This
goes for e.g. a Delphi too. Turbo Pascal or Topspeed M2/Pascal would be
better, but the whole cmdline is too alien to the students nowadays.

So IMHO the only decent way is to move to special educational tools.

For FPC support I sometimes find myselfe on fairs and seminars, and we get
a lot of teachers asking for such tools. Unfortunately it is outside the
direct scope of the project.

> The same for C++ or Java, these also are useless without additional
> libraries, even if the languages have more features than e.g. C or
> Basic.


Note that this also depends how much you prepare the course for the
students. Do you let them search and implement anything yourself? Or do you
prepare and provide certain stuff (like e.g. doing a lesson about a basic
tokeniser, and afterwards give them a stronger one to use the rest of the
course)

The do it yourself method is of course best, and the most academic (and fun
for the teacher, since occasionally you get surprised). Unfortunately, class
time is limited however, and you sometimes also need to teach lesser
motivated students.

> When people have to learn the fundamental library structures and
> functions, in addition to a programming language itself, it IMO doesn't
> make a difference whether the language is kind of assembly language or C,
> honestly. Look at the interface or implementation of a library - just the
> declaration syntax of C is better suited to hide things before the reader,
> than to explain them. Add the C standard header files, and their #defines,
> and try to count only the key "words", which a person has to learn AND to
> remember, before she can read or write useful C code.


> Then do the same for Java, certainly with similar results, and then
> for Pascal...


Assuming you have learned enough languages to understand a superset of these
languages.
Hans-Peter Diettrich

2007-05-17, 4:21 am

Marco van de Voort wrote:

> The mere availability of stuff like a form designer is a distraction. This
> goes for e.g. a Delphi too. Turbo Pascal or Topspeed M2/Pascal would be
> better, but the whole cmdline is too alien to the students nowadays.
>
> So IMHO the only decent way is to move to special educational tools.


Having a look at GNU software, I found that writing portable programs
requires the knowledge of about 4 languages, in addition to the
programming language itself. This seems not to matter to Unix people,
which are used to do everything from the cmdline, using vi or emacs as
their "IDE" ;-)

No idea about the preferences of nowadays students, but it might be
*not* a good idea to force them to use a unique language and development
system, be GUI or cmdline, and another one for every parallel course.


> For FPC support I sometimes find myselfe on fairs and seminars, and we get
> a lot of teachers asking for such tools. Unfortunately it is outside the
> direct scope of the project.


FPC is more complete than most Wirth systems, e.g. Wirth refused to
provide an online debugger for Oberon, even if being paid for :-(

But I'm drifting away from the topic...


>
>
> Assuming you have learned enough languages to understand a superset of these
> languages.


IMO libraries have little in common, across languages. Even if there
exist similarities, the little differences make it hard to use a library
of another language. I'm frequently mixing up Latin, Italian, Spanish
and Portuguese terms and idioms, and similar effects may occur with C++
and Java.

DoDi
Hans-Peter Diettrich

2007-05-17, 4:21 am

Chris Smith wrote:

>
>
> Huh? I'm trying to figure out where you're coming from here. Really,
> really trying... and it's not coming to me. Did you really just claim
> that Java has too FEW standard library routines, but Pascal is fine?


After an hint from our esteemed mod I had to revise my opinion. In my
Pascal docs I found about 40 symbols (types, constants, functions),
which are not part of the Pascal syntax. I missed to remember these,
because some of them (Read, WriteLn...) are compiler magics, and as such
IMO are part at least of the semantics of the language.

Apart from that small system library nothing else is required to start
writing programs in Pascal. That was my point in comparison to other
languages, where the coder has to master much bigger libraries, before
he can start writing programs.

DoDi
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com