Re: OT: C or C++?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Excerpts from R. Mattes's message of 2010-10-14 22:35:56 +0200:
> On Thu, 14 Oct 2010 20:10:52 +0200, Philipp Ãberbacher wrote
> > 
> > I'm not experienced in any language but I've dabbled with a few, and
> > imho java and how it's taught here is far too complicated or rather
> > distracting.
> > 
> > The first thing newbies see, before hello world, is a beast like
> > eclipse, which alone causes a whole bunch of problems. Then they have
> > to mess with packages, and classes, and objects, although they teach 
> > it here by saying "take this as given, ignore it for now". The next thing
> > they see are some funky classes that allow proper input/output 
> > because java doesn't seem to have that. Only then they get to start programing
> > and can deal with javas built in funkyness.
> 
> But that's not the language, that's the quality of the people teaching it 
> there.

Using eclipse from the start might be a questionable choice, but for the
rest there's no best answer. Either take the 'take it as a given'
approach or start with explaining objects and classes and and and...

About half of my fellow students are total beginners who've never
written or even read a single line of code. To them everything is new,
and they need to filter the essentials from the distractions, so less
distractions is a real help.

> > What does the following example evaluate to?
> >    1.2+3+"||"+3+2.1
> 
> $ cat > Foo.ava 
> class Foo
> {
>   static { System.out.println( 1.2+3+"||"+3+2.1 ); System.exit( 0 ); }
> }
> ^D
> $ javac Foo.java
> $ java Foo
> 
> C'm on, that's not really that hard, no Eclipse, no packages, no real object.

Is this using some implicit main() or something?

> > I think there's far too much distracting mess to sort out before you
> > even get to programing, so I don't think it's a good teaching language
> > (for total beginners at least).
> 
> What's distracting here?
> 
> Regarding your example -my main question would be: what do _you_ expect from that 
> code. 'I'd say you get what you ask for.

I wouldn't expect 4.2||32.1 as a result. Either interpret the whole
thing as a string, or the number parts as float or don't do this kind of
automagic conversion at all. Interpreting numbers as numbers and
interpreting numbers as string in the same statement is something I
wouldn't expect.

> Java has a defined evaluation order (JLS 15.7) - left to right, and does type
> conversion
> _and_ does overloading of methods. All of this are basic design decisions
> which any language
> has to take. Are you criticising the choices the Java team made? Do you prefer
> the Ocaml way?
> So "1 + 2", or "3.0 +. 2.1"  - and then the horrible "add_int_to_float 1 +
> 2.0" ????
> That for shure will be less confusing to beginners :-/

I don't know Ocaml, so no idea what the above means.

> BTW,
> 
> 1]   1.2 + 3 = 4.2  since you can't convert a float to an int but an int to a
> float
> 
> 2]   4.2 + "||"     need to convert 4.2 to a string, because the other way
> round isn't supported
> 
> 3]   ... go on ...
> 
> 
> Cheers, RalfD
> 
> P.S.: if possible i try to avoid programming in Java, but for totally
> different reasons.

Which are?

Regards,
Philipp

_______________________________________________
Linux-audio-user mailing list
Linux-audio-user@xxxxxxxxxxxxxxxxxxxx
http://lists.linuxaudio.org/listinfo/linux-audio-user



[Index of Archives]     [Linux Sound]     [ALSA Users]     [Pulse Audio]     [ALSA Devel]     [Sox Users]     [Linux Media]     [Kernel]     [Photo Sharing]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux