Is Java is a bad language for beginners?

Please compose all posts in Emacs.

Moderators: phlip, Moderators General, Prelates

Re: Is Java is a bad language for beginners?

Postby flying sheep » Sat Jan 08, 2011 8:36 pm UTC

Berengal wrote:(I also don't see what dependency injection has to do with closures)

fefe (a german programmer, security expert and blogger, quite self-involved) wrote about closures and posted about this stuff in the java language. i think both are examples of what i said: that java is “extended” by many people in order to do stuff it isn’t made for.
Berengal wrote:Sure, it looks horrible and my wrists hate me for it (even with major IDE support), but what you fail to realize is that not using closures is not an option. If your language doesn't support them, tough luck, you're just going to have to suck it up and write ugly code. Ultimately your code will be better for it.

if closures are neccessary and “your language” doesn’t support them, you draw the wrong conclusions: i don’t fail to realize that not using them is not an option; you fail to realize that not using java is one.
User avatar
flying sheep
 
Posts: 63
Joined: Sun Jan 31, 2010 12:35 am UTC

Re: Is Java is a bad language for beginners?

Postby Trasvi » Thu Feb 17, 2011 1:27 pm UTC

I learnt Java as my first programming language.
Since then, I've learnt C, Python, F# and VB, but I've kept learning more about Java and I can say I'm fairly competent with it.
However, my first learning experience with Java was quite poor. The way we were taught, we may as well have been using C - it wasn't until the second semester where we actually learnt properly what Classes, Objects, Inheritance and all that other fun stuff is.
Overall, I think Java is actually a decent first language, because it has extensive libraries, is well documented, easily supports advanced data structures, and has GUI support standard. I just believe that ANY first programming course should be preceded by teaching more about memory, cpu, assembly+machine code, and how that particular language handles memory management.

There seems to be a lot of hate against Java in this thread. Lots of people complaining that "everything is an object - too much overhead" to "why isn't everything an object - primitives are silly". Its not really that bad, is it? OOP is great for many many applications, and also the good coding practices that OOP encourages. The important thing is just to teach it RIGHT, as well as to encourage people to keep learning more languages on their own as well.
Trasvi
 
Posts: 271
Joined: Thu Feb 17, 2011 12:11 pm UTC

Re: Is Java is a bad language for beginners?

Postby Meteorswarm » Fri Feb 18, 2011 4:10 am UTC

While OOP is useful for dealing with complexity, this is EXACTLY what beginners DON'T need to deal with. Why make new programmers deal with objects and inheritance when they still need to learn the basics? And unlike some other languages that have objects, Java FORCES you to use them. You can't have a program without an object.

Really, I just keep liking python more and more, although I'd support scheme or something like it as well.
The same as the old Meteorswarm, now with fewer posts!
User avatar
Meteorswarm
 
Posts: 980
Joined: Sun Dec 27, 2009 12:28 am UTC
Location: Ithaca, NY

Re: Is Java is a bad language for beginners?

Postby Vash » Wed Feb 23, 2011 8:00 pm UTC

I learned QBASIC when I was 6, VB at 9, and C++ when I was 10 or 11. I did not completely get any of these programming languages at those points, but people trying to teach me the concepts to a limited degree I thought was a good idea. I did also learn a lot. I tried to learn Java at 13 and fell asleep (afternoon). Last thing I am going to mention: I learned HTML when I was 9, and Javascript when I was 9 or 10.

Java is a bad language for anyone. J/k. Java is fine. I don't know if it is an awful language for beginners. It might be alright. BASIC is definitely a good one for beginners, though. The order I learned as the natural order was: QBASIC, VB, (maybe PASCAL? could also be before Java), C, C++, and then Java.
User avatar
Vash
 
Posts: 470
Joined: Sat Jan 22, 2011 9:14 pm UTC
Location: The planet Gunsmoke

Re: Is Java is a bad language for beginners?

Postby Meteorswarm » Thu Feb 24, 2011 12:00 am UTC

I'm pretty ambivalent about the TRUEBASIC that I learned. I got loops and ifs and variables from it, and those are pretty useful, but it also lacked some pretty key stuff, like variable scope. Also, there was this function MATREDIM that claimed to resize a matrix, but I think it just said "yeah, sure, you can go use that memory over there, no problem" without actually checking that, so you got lots of fun nondeterministic behavior.
The same as the old Meteorswarm, now with fewer posts!
User avatar
Meteorswarm
 
Posts: 980
Joined: Sun Dec 27, 2009 12:28 am UTC
Location: Ithaca, NY

Re: Is Java is a bad language for beginners?

Postby squareroot » Sun Feb 27, 2011 9:26 pm UTC

My progression has been something like this:

HTML - not programming, but a language - Age 8.
VB - stopped after a couple months. Never learned what a class was, but I got the stuff about ByVal/ByRef just fine. - Age 8
Java - Got a book. Couldn't figure out how to compile/run stuff, but learned the syntax anyway. Stopped after about a week. - Age 9
JavaScript - where I first started doing cool stuff, like cellular automata and a genetic algorithm - Age 12
Java - Revisted. Learned OOP, generics, and the other funkier stuff. Pretty much the only language I use now. - Age 13

I have dabbled in C++/PHP/Haskell.

Everything I've learned was either from a book on the language, or the internet. I use Java pretty much exclusively, but I still try not to use OOP, so I guess that's evidence I'm not "ruined" or whatever. I'm definitely looking forward to it getting closures, though, in Java 7 or 8 (not sure which). I think that a good language should have pointer arithmetic and currying. :D

Personally, I think that TI Basic is bad for beginners... they're taught to almost exclusively use labels/gotos. Personally, I would like to see - sort of as an experiment - what it would be like to learn Assembly and Haskell (or some similarly extremely abstract language) at the same time, and then kind of work up/down the abstraction ladder from either direction. It's difficult if you just put them somewhere on that ladder and let them go from there, they fall into that Blub programmer mindset of "I don't see how you get anything done in <less abstract language>, it's all too slow and nit-picky, and I don't even have <feature from first language>. And I certainly don't see why you would need <feature from more abstract language>, I get along just fine without it and it just adds overhead."
<signature content="" style="tag:html;" overused meta />
squareroot
 
Posts: 543
Joined: Tue Jan 12, 2010 1:04 am UTC

Re: Is Java is a bad language for beginners?

Postby flying sheep » Mon Feb 28, 2011 7:07 am UTC

right, that’s annoying. but haskell’s abstraction level depends on your viewpoint. for mathematicians it’s pretty close to the metal, i guess.

where would you categorize java in the “abstract” scale? it is like frankenstein’s monster with every new and replaced part being shiny, but tiny chrome bits and pieces, which are not connected to anything:
the effort of making an ancient sytax and a messy standard library look modern is as futile as it is funny.

@syntax:
Code: Select all
int count = 1;
if (distinctSeedCounter.containsKey(seedSequence))
   count += distinctSeedCounter.get(seedSequence);
distinctSeedCounter.put(seedSequence, count);


@standard library (this had to be written by myself. there is a StringCharacterIterator, but it is not an iterator):
Code: Select all
public class IterableString implements Iterable<Character> {
   private String string;
   
   public IterableString(String string) {
      if (string == null)
         throw new NullPointerException();
      this.string = string;
   }
   
   @Override
   public Iterator<Character> iterator() {
      return new Iterator<Character>() {
         private int index = 0;
         
         public boolean hasNext() {
            return index < string.length();
         }
         
         public Character next() {
            if (!hasNext())
               throw new NoSuchElementException();
            return string.charAt(index++);
         }
         
         public void remove() {
            throw new UnsupportedOperationException();
         }
      };
   }
}
User avatar
flying sheep
 
Posts: 63
Joined: Sun Jan 31, 2010 12:35 am UTC

Re: Is Java is a bad language for beginners?

Postby MHD » Wed Mar 02, 2011 5:57 pm UTC

My progression (and the time it took to learn it properly):
Lua (a year) -> Python (a month) -> C++ (a month) -> Java (a day) -> C (a day) -> Haskell (a week) -> Now -> Forth | Scala | GLSL | Eiffel | Objective-C | Erlang


Java is just code bloat, but otherwise okay (there's the primitive vs. Object problem, arrays being pseudo-objects, everything being a reference and so on.) Java IMHO should not be taught to beginners. Scala should if anything. Scala is functional, object oriented, pseudo-pure and runs on the JVM, giving access to everything in Java. Java does do some things good though. That is, batteries included-ness. Python can kiss my figurative bottom, Java has you looking through docs all day just to NOT reinvent the wheel.

The ideal progression into programming would probably be a high level scripting language (Lua), then a low level (C) and an impure functional (ML) at the same time. The something extreme like Haskell, Eiffel, Lisp, Forth, Prolog and so on.
EvanED wrote:be aware that when most people say "regular expression" they really mean "something that is almost, but not quite, entirely unlike a regular expression"

language blag
User avatar
MHD
 
Posts: 630
Joined: Fri Mar 20, 2009 8:21 pm UTC
Location: Denmark

Re: Is Java is a bad language for beginners?

Postby CTangent » Wed Mar 09, 2011 5:39 am UTC

I'm a freshman at Georgia Tech, and my school has three introductory Computer Science classes. One, designed specifically for engineers, is taught in matlab. Another one, designed for natural science majors, is taught in Jython. The one for CS majors is taught in Python, and that's been really successful for my school so far.

The second class in the series of CS classes is taught exclusively in Java, which I think is a very solid progression since students know enough about different paradigms of code that they can be proficient in both. This class also segues into the next class, which is about data structures and basic algorithms and it is also taught in Java.

My own personal progression of languages was 1) Java, 2) LC3 Assembly, and 3) C. Going from something as high-powered as Java to assembly was a drastic jump for me, but once I got a hold of it transitioning into C was incredibly easy and natural, since Java borrowed so much of the C syntax.

My professor described my school's CS progression like this: CS majors go through "CS flight school". First, they are taught how to fly in a small single-engine aircraft capable of doing quick and dirty things fairly easily and efficiently (Python). Next, once they've learned how to fly, they learn to fly a bigger aircraft with a more sophisticated autopilot that allows the pilot to focus on making the plane to more complicated things (Java). Once you know how to fly the plane well, you learn to fly the Wright Flyer and learn exactly how and why a computer works (assembly and C).

Java is probably a good early language, simply due to how picky the language is. Since C lets you do mostly whatever the hell you want, that's not very good for learning, since a good structured environment helps teach good coding practices and how to think in a CS mindset.
CTangent
 
Posts: 3
Joined: Sat Apr 10, 2010 12:40 am UTC

Re: Is Java is a bad language for beginners?

Postby squareroot » Fri Mar 11, 2011 4:59 am UTC

CTangent wrote:Java is probably a good early language, simply due to how picky the language is. Since C lets you do mostly whatever the hell you want, that's not very good for learning, since a good structured environment helps teach good coding practices and how to think in a CS mindset.


Good point. Yesterday, I learned how to do lambdas in C. It's... terrible, and... well actually it's not beautiful at all. But it's really fun. :D
<signature content="" style="tag:html;" overused meta />
squareroot
 
Posts: 543
Joined: Tue Jan 12, 2010 1:04 am UTC

Re: Is Java is a bad language for beginners?

Postby lalop » Tue Sep 27, 2011 3:21 pm UTC

Alan Chatham wrote:I have to throw my hat in with all the other Python supporters here. As has been mentioned by many others in here, the point of beginning to learn how to program is that you're learning how to program. To that end, you should be focussed on the higher-level concepts and algorithms that you'll be using during your entire career, even if the only programming you do 5 years from now is writing a script to reformat the names of 1000 image files on your hard drive. As a result, I think beginners are best served by a language like python that abstracts as much away as possible.


I exactly echo this sentiment. Had our comsci's first language been python, I would still be programming now. Java just made everything seem so unnecessarily difficult until you prefer to just forget it all by the summer.

Hypotthetically, I'd say that two semesters of Java could be met by one semester spent learning it all in python, and then another for learning how to translate those concepts into Java. Python would just let you learn that much faster.

Or imagine a transition from python into "object oriented programming" class taught in ruby? That would not only double your exposure but get you working in one of the most structurally object oriented languages ever.

The disadvantage, of course, is in motivating students when they do have to transition to a Java-like language :twisted: But, if the plan works and you really have the advanced programming down hard, that would just be a detail.
lalop
 
Posts: 120
Joined: Mon May 23, 2011 5:29 pm UTC

Re: Is Java is a bad language for beginners?

Postby thedufer » Thu Sep 29, 2011 5:05 pm UTC

I have to agree with the Python supporters as well. There's a big difference from a one-line file producing output, and the overhead of your initial class in Java just to get things compiling. The added advantage of being able to mess around with things and see what works in the interactive interpreter just makes it better.

After Python, you should go on to C/C++, then a class on computer architecture/assembler. After learning C, you can go on to almost anywhere. From here, its easy to branch out to various other language types - OO in Ruby, perhaps. Maybe some Lisp, Haskell, Prolog, etc. But core courses should continue to be taught in the most appropriate of Python/C (maybe C++). Low-level classes, such as algorithms, should use C, while high-level classes should stick to Python.

I'm going to stray from other opinions here, though. I don't think Java should be taught in an academic setting, period. Its common in business, mostly because non-programmers make language decisions, and you can't go wrong with something backed by Sun. But academically, it brings nothing to the table. The syntax is overly verbose. Many useful features are missing - anonymous functions, function-passing in general, closures. It makes the difference between objects and primitives (with strings forming a bizarre middle ground), but doesn't allow you to work with references properly, like C does. Overall, its confusing more than enlightening if you plan on ever learning another language, which is the opposite of what you want.
User avatar
thedufer
 
Posts: 263
Joined: Mon Aug 06, 2007 2:11 am UTC
Location: Northern VA (not to be confused with VA)

Re: Is Java is a bad language for beginners?

Postby flying sheep » Fri Sep 30, 2011 2:22 pm UTC

and that’s why it is essentially exactly the other way round than the “flight school” metaphor. java has very few concepts and is thus overly verbose. python has many concepts (with statements, lambdas, …) and is thus concise.

starting with java, however brings you into this java mindset that makes people say those things about you. if you don’t pay attention and learn another, radically different language quickly, you are ruined as a programmer.
User avatar
flying sheep
 
Posts: 63
Joined: Sun Jan 31, 2010 12:35 am UTC

Re: Is Java is a bad language for beginners?

Postby lesto » Sat Oct 01, 2011 7:31 pm UTC

IMHO the best first language is C, then you can learn some OO
lesto
 
Posts: 7
Joined: Thu May 05, 2011 9:06 pm UTC

Re: Is Java is a bad language for beginners?

Postby Meteorswarm » Mon Oct 03, 2011 5:21 am UTC

lesto wrote:IMHO the best first language is C, then you can learn some OO


Could you explain why? The downsides of C have been discussed heavily on this thread.
The same as the old Meteorswarm, now with fewer posts!
User avatar
Meteorswarm
 
Posts: 980
Joined: Sun Dec 27, 2009 12:28 am UTC
Location: Ithaca, NY

Re: Is Java is a bad language for beginners?

Postby lesto » Fri Oct 07, 2011 1:46 am UTC

because if you know C, then you know HOW the object work. Oh, and it also help you to understand WHY and WHERE there are some limitation. Also C is the base of many languages, so it will help very much learning these language.
I'm talking about C ansi; pointer (to variable and to function), malloc, and not much more.
Process and Thread can easier be understand in OOP, where is easier subdivide the thread's or process's code.
lesto
 
Posts: 7
Joined: Thu May 05, 2011 9:06 pm UTC

Re: Is Java is a bad language for beginners?

Postby Anonymously Famous » Fri Oct 07, 2011 2:54 am UTC

lesto wrote:because if you know C, then you know HOW the object work. Oh, and it also help you to understand WHY and WHERE there are some limitation.

Isn't that somewhat analogous to saying that people should learn assembly as a first language?

My first programming language was C++, for no other reason than that was the language being taught at my high school at the time. I'm not an expert programmer by any means, because my life and interests took me in different directions, but I don't think I'm any worse off for learning it. In my first programming class as a university student, they taught Java. I was able to use the basic concepts that I'd learned from C++ and apply it to that class, and not only because they're syntactically similar.

The very basic concepts of programming are the same no matter what language you use. If you're teaching yourself, you may want to try something that has a pretty easy learning curve. Python would be a good language for that, but there are likely others. If you know what direction you want your programming to take you -mobile apps, for example- you may want to focus on a language that's used in that area. If you're in a classroom setting, I maintain that it doesn't matter too much what language you learn as long as you can see around the syntax to the concepts.
Anonymously Famous
 
Posts: 240
Joined: Thu Nov 18, 2010 4:01 am UTC

Re: Is Java is a bad language for beginners?

Postby EvanED » Fri Oct 07, 2011 4:10 am UTC

Anonymously Famous wrote:
lesto wrote:because if you know C, then you know HOW the object work. Oh, and it also help you to understand WHY and WHERE there are some limitation.

Isn't that somewhat analogous to saying that people should learn assembly as a first language?

If you start with assembly, how are you going to understand how the chip's front end figures out which instructions to run during the next cycle (e.g., how does the out-of-order execution unit work), and stuff like that?

Assembly is too high-level. Better to start at the transistor level, work your way up to gates, circuits, then a whole chip so that you can see how the instructions are actually run.

The very basic concepts of programming are the same no matter what language you use. If you're teaching yourself, you may want to try something that has a pretty easy learning curve. Python would be a good language for that, but there are likely others. If you know what direction you want your programming to take you -mobile apps, for example- you may want to focus on a language that's used in that area. If you're in a classroom setting, I maintain that it doesn't matter too much what language you learn as long as you can see around the syntax to the concepts.

I agree with this... except that I think that last bit is made way too difficult by languages like C and C++, or even Java. There's too much focus on details that are irrelevant for learning the parts of programming that are actually important: decomposing problems into bits you can precisely specify.

For most beginning programmers, that alone is plenty, without having to worry about what the compiler and runtime are doing for you behind the scenes.
EvanED
 
Posts: 3766
Joined: Mon Aug 07, 2006 6:28 am UTC
Location: Madison, WI

Re: Is Java is a bad language for beginners?

Postby Jplus » Fri Oct 07, 2011 12:39 pm UTC

I globally agree to the two posts above (including the obvious sarcasm on starting with the transistors). As for the obtrusiveness of details in languages like C, C++ and Java, I think it's not that harmful if you're taking a class that guides you through the underlying concepts. I also learnt C++ first in a class and I'm fine. Without professional guidance however, easier languages are definitely better to start with.

I can think of at least two other reasons why C is not better or more 'basic' to start with than (for example) C++. The first is that you're actually not any closer to 'how it works'. For one, the operating system is always playing a very big role behind the scenes that you don't need to be aware of as the programmer, whether you're doing C, C++ or Python. Also, your C code can undergo so many transformations during compilation that you never really know whether the code you wrote actually reflects what your machine is doing -- just like with Python.
(This is however not to say that C doesn't have any advantages.)

The other reason that I can think of is that C works with a relatively small set of concepts. Programming in C will normally not confront you with any idioms that are associated with object-oriented, functional, list or generic programming. The consequence is that when you move from C to a richer language like C++, Haskell, Java or Python, you'll have to learn a lot again. Going the other way round is quite easy: just work around the features that are 'missing'.
In other words, learning C as the first language might put people in a somewhat limited state of mind, which they'll have to break out of when they move to another language. If you're confronted with a large set of possibilities from the first day onwards, you'll find it much easier to get used to another language.
Hey, like coding? Perhaps you should check out the red spider project.
Feel free to call me Julian. J+ is just an abbreviation.
User avatar
Jplus
 
Posts: 1091
Joined: Wed Apr 21, 2010 12:29 pm UTC

Re: Is Java is a bad language for beginners?

Postby Yakk » Fri Oct 07, 2011 12:55 pm UTC

If we had non-problematic garbage collection, I'd be less leery about Java as a language for someone who is a beginner and wants to later on be an expert.

But our garbage collection algorithms all have non-trivial issues.

That makes me leery of teaching Java to beginners.

Then again, it might be better than BASIC.
One of the painful things about our time is that those who feel certainty are stupid, and those with any imagination and understanding are filled with doubt and indecision - BR

Last edited by JHVH on Fri Oct 23, 4004 BCE 6:17 pm, edited 6 times in total.
User avatar
Yakk
 
Posts: 10038
Joined: Sat Jan 27, 2007 7:27 pm UTC
Location: E pur si muove

Re: Is Java is a bad language for beginners?

Postby Anonymously Famous » Fri Oct 07, 2011 1:13 pm UTC

Say what you will about BASIC, but there was a class that I took that taught VB.net and mentioned how VB script can be found inside MS Office. It was useful knowledge, and the class ended up teaching most of the basic (no pun intended) concepts as any of the other entry-level programming classes that I took.

This class was part of my minor. Otherwise I wouldn't have taken it. To this day, VB.net is pretty high on my list of favorite programming languages.
Anonymously Famous
 
Posts: 240
Joined: Thu Nov 18, 2010 4:01 am UTC

Re: Is Java is a bad language for beginners?

Postby Yakk » Fri Oct 07, 2011 1:33 pm UTC

I wasn't talking about VB, or even VB.net. VB merely looks syntactically similar to BASIC, and VB.net merely looks syntactically similar to VB. VB.net is really C# with a few corners filed off, and a number of features removed, and one or two dollops of syntactic sugar. Don't mistake VB.net for BASIC.

I'm talking good, old-fashioned, C64 era BASIC. No subprocedures, no local variables, mandatory line numbers.
One of the painful things about our time is that those who feel certainty are stupid, and those with any imagination and understanding are filled with doubt and indecision - BR

Last edited by JHVH on Fri Oct 23, 4004 BCE 6:17 pm, edited 6 times in total.
User avatar
Yakk
 
Posts: 10038
Joined: Sat Jan 27, 2007 7:27 pm UTC
Location: E pur si muove

Re: Is Java is a bad language for beginners?

Postby Anonymously Famous » Fri Oct 07, 2011 1:44 pm UTC

Yakk wrote:VB.net merely looks syntactically similar to VB. VB.net is really C# with a few corners filed off, and a number of features removed, and one or two dollops of syntactic sugar.

I have a suspicion that that's not entirely accurate, but point taken. In that case, I agree, BASIC may be a bit confusing for a beginner.
Anonymously Famous
 
Posts: 240
Joined: Thu Nov 18, 2010 4:01 am UTC

Re: Is Java is a bad language for beginners?

Postby Jplus » Fri Oct 07, 2011 1:47 pm UTC

But Yakk, aren't you saying now that any language with garbage collection is a bad choice as a first language? That would exclude most languages, including ones that are generally conceived as very fit, like Python.
Hey, like coding? Perhaps you should check out the red spider project.
Feel free to call me Julian. J+ is just an abbreviation.
User avatar
Jplus
 
Posts: 1091
Joined: Wed Apr 21, 2010 12:29 pm UTC

Re: Is Java is a bad language for beginners?

Postby EvanED » Fri Oct 07, 2011 3:16 pm UTC

Jplus wrote:I globally agree to the two posts above (including the obvious sarcasm on starting with the transistors). As for the obtrusiveness of details in languages like C, C++ and Java, I think it's not that harmful if you're taking a class that guides you through the underlying concepts. I also learnt C++ first in a class and I'm fine. Without professional guidance however, easier languages are definitely better to start with.

Having a guide makes it easier, but those issues are still there for you to deal with. It's like if you're trying to get to the top of Yosemite's half dome. You can hire a guide to help you up the face of it. Sure, that'll be easier that trying it yourself if you're unfamiliar with the route, but it's still easier to walk up the path.

Yakk wrote:If we had non-problematic garbage collection, I'd be less leery about Java as a language for someone who is a beginner and wants to later on be an expert.

But our garbage collection algorithms all have non-trivial issues.


What's your problem with GC? Especially for a teaching language.
EvanED
 
Posts: 3766
Joined: Mon Aug 07, 2006 6:28 am UTC
Location: Madison, WI

Re: Is Java is a bad language for beginners?

Postby Yakk » Fri Oct 07, 2011 5:36 pm UTC

It depends what you want to teach. There are many kinds of programs that forced automatic garbage collection would be a good idea for.

1: A course for people with little to no interest in programming. Here your goal is to make the course fun, more than anything else.
2: A course in abstract computer science concepts. Garbage collection is just one kind of problem, and so long as your problem doesn't involve resource allocation, you can punt it.

If among your goals is to produce people who could, say, program an operating system, starting with a language crippled by forced automatic garbage collection could be problematic, as it could lead to bad habits.

LISP-like languages are decent intro languages for the same reason, so long as it is in a course built around #2.

Admittedly, the demand for programmers who actually can program an operating system if they had to is less than it was in the past.
One of the painful things about our time is that those who feel certainty are stupid, and those with any imagination and understanding are filled with doubt and indecision - BR

Last edited by JHVH on Fri Oct 23, 4004 BCE 6:17 pm, edited 6 times in total.
User avatar
Yakk
 
Posts: 10038
Joined: Sat Jan 27, 2007 7:27 pm UTC
Location: E pur si muove

Re: Is Java is a bad language for beginners?

Postby lesto » Sun Oct 09, 2011 5:23 pm UTC

EvanED wrote:
Anonymously Famous wrote:
lesto wrote:because if you know C, then you know HOW the object work. Oh, and it also help you to understand WHY and WHERE there are some limitation.

Isn't that somewhat analogous to saying that people should learn assembly as a first language?

If you start with assembly, how are you going to understand how the chip's front end figures out which instructions to run during the next cycle (e.g., how does the out-of-order execution unit work), and stuff like that?

Assembly is too high-level. Better to start at the transistor level, work your way up to gates, circuits, then a whole chip so that you can see how the instructions are actually run.


LOL no......
you never play with register or stack allocation (at beginning), you can compile the code on different architectures, but you'll always play with pointer. This is very important to understand the difference between passing variable by value or by reference (live VB)
Also, to understand HOW pointer works, you should know a little bit HOW cpu and ram works. You don't need to know how build a CPU, but at least what happen with a malloc in ram, and maybe what happen in the stack when calling a function...
And after all, you can learn some Assembly and "Chip Architecture" to understand many things, but this is a bit advanced, and is needed only when you are a good programmer (like programming shader, microcontrol, driver, etc..)

Programming in C will normally not confront you with any idioms that are associated with object-oriented, functional, list or generic programming. The consequence is that when you move from C to a richer language like C++, Haskell, Java or Python, you'll have to learn a lot again


true, you are going to learn MORE, but you will still use what you have learned from sequential languages. This mean nicer learning curve.

Yakk wrote:It depends what you want to teach. There are many kinds of programs that forced automatic garbage collection would be a good idea for.
1: A course for people with little to no interest in programming. Here your goal is to make the course fun, more than anything else.
2: A course in abstract computer science concepts. Garbage collection is just one kind of problem, and so long as your problem doesn't involve resource allocation, you can punt it.

I agree, if point 1 is true, then learning C as first language is not useful, just find the language with best libraries for what you want do
lesto
 
Posts: 7
Joined: Thu May 05, 2011 9:06 pm UTC

Re: Is Java is a bad language for beginners?

Postby EvanED » Mon Oct 10, 2011 5:16 am UTC

lesto wrote:you never play with register or stack allocation (at beginning),

I know, it's a travesty! After all, how can you understand functions if you haven't written the code that builds your own stack frame?

(Sorry, this will be your one piece of sarcasm for this post.)

you'll always play with pointer. This is very important to understand the difference between passing variable by value or by reference (live VB)

So first, why is that important early on? How does that help you learn how to think computationally? (In other words, know how to decompose your problem until you have something precise enough that you can actually write code for.)

Second, what the heck makes you think you can't teach that in a language other than C? You don't need the ability to synthesize pointer values out of thin air in order to talk about what a pointer is. Sure, you'll call it a reference or something like that, but any decent course in Java will talk about how references store memory addresses and stuff like that.

Programming in C will normally not confront you with any idioms that are associated with object-oriented, functional, list or generic programming. The consequence is that when you move from C to a richer language like C++, Haskell, Java or Python, you'll have to learn a lot again


true, you are going to learn MORE, but you will still use what you have learned from sequential languages. This mean nicer learning curve.

You also have to unlearn some stuff... but this is beside the point.

The problem with C is that (1) it makes you care about details that are irrelevant to the problem at hand (like when to free pointers) and (2) won't tell you when you make a mistake (like an out-of-bounds access). Dealing with those problems is a distraction from learning to think computationally, and should wait.

You don't go to swimming lessons and the first day they throw you into a rip current. Yes, you should learn how to get out of a rip current at some point, but that comes after spending some time in the 3" section of the pool, then deeper waters, then the ocean. Teaching a class in C is basically tossing your students into the rip current, then paddling alongside trying to tell them how to move their arms and legs to get back to shore.

Edit: This isn't to say that individual people can't start with C... but it takes a certain mindset that I don't think benefits even most CS people. And for that reason I don't think it should be a typical early CS curriculum class. (And if you do teach such a class, it really ought to be a much more integrated class than your typical programming one: I really do think you need to look at what the compiler is doing and to a small extent what the hardware is doing under the hood, or you're keeping all of the bad things about C and ignoring why you would want to use it.) Even if you have more than a passing interest in CS, I suspect it will be more beneficial to start in a language like Scheme or Python or ML than in C. And that's ignoring the practical issues of teaching students who are not fully interested in programming, and not turning off students who are.
EvanED
 
Posts: 3766
Joined: Mon Aug 07, 2006 6:28 am UTC
Location: Madison, WI

Re: Is Java is a bad language for beginners?

Postby lesto » Sun Oct 23, 2011 11:32 pm UTC

"learning to think computationally"?

we used Flowchart! you don't even need to use a PC :D

and you can use them in any abstraction level.

this applied to what you do when you wake up or when you drive help you to (sorry if the word is wrong) rationalize your way of thinking.
Then you can face the problem of the limited instruction set that the language of your choose give you.
lesto
 
Posts: 7
Joined: Thu May 05, 2011 9:06 pm UTC

Re: Is Java is a bad language for beginners?

Postby antoinelepenseur » Tue Oct 25, 2011 5:14 pm UTC

Read The pitfalls of Java as a first programming language.
User avatar
antoinelepenseur
 
Posts: 18
Joined: Tue Oct 25, 2011 2:25 pm UTC
Location: Yuba City, CA

Re: Is Java is a bad language for beginners?

Postby Meteorswarm » Wed Oct 26, 2011 5:46 am UTC

antoinelepenseur wrote:Read The pitfalls of Java as a first programming language.


While you didn't offer any summary, 30 seconds of searching tells me that that book's thesis is that Java is bad because it hides system details like pointers and memory management.

I disagree completely, although I also think Java is a poor first language. We should be reducing the complexity it takes to program to a bare minimum, and classes aren't needed at that stage.
The same as the old Meteorswarm, now with fewer posts!
User avatar
Meteorswarm
 
Posts: 980
Joined: Sun Dec 27, 2009 12:28 am UTC
Location: Ithaca, NY

Re: Is Java is a bad language for beginners?

Postby yukizora » Wed Nov 16, 2011 6:55 pm UTC

I'd disagree, if you're motivated it's a language you might use a real lot, and that's Object-Oriented. I don't think I need to say more.
It *will* be useful to know java later on, it's just not something to learn and throw away afterwards.
My other picks would be C/C++/PHP. I can hardly think of anything else that you'll want to use often.

While I like to have some friendly languages around, I think they should come after a good learning of the syntax of a lower-level language, so that you'll just not throw away stuff hoping that "it's how it works cause it looks good" and rather *know* what got abstracted and how so that you can use the types / methods as intended. I should note that I had to tinker a python file only once in my life. I can't count how much C I've done though. I don't think I'm alone either :)
yukizora
 
Posts: 42
Joined: Tue Jun 08, 2010 9:13 am UTC

Re: Is Java is a bad language for beginners?

Postby EvanED » Thu Nov 17, 2011 5:14 pm UTC

yukizora wrote:I'd disagree, if you're motivated it's a language you might use a real lot, and that's Object-Oriented. I don't think I need to say more.
It *will* be useful to know java later on, it's just not something to learn and throw away afterwards.
My other picks would be C/C++/PHP. I can hardly think of anything else that you'll want to use often.

I agree. You should always start with the language that you think you'll be using later. After all, that obviates the need to learn a second language later, which is a lot of wasted work.
EvanED
 
Posts: 3766
Joined: Mon Aug 07, 2006 6:28 am UTC
Location: Madison, WI

Re: Is Java is a bad language for beginners?

Postby Yakk » Thu Nov 17, 2011 10:00 pm UTC

No, learning a second language isn't wasted work -- it breaks you out of the myopia of being a single linguist.

People beginning to program are only going to be writing toy programs. So if you want them to learn a 'useful' skill in the short term, pick a language that is good at writing programs to solve toy problems. This won't always be the best path to follow for long-term programming literacy, but we could be realistic and say that most people who learn the basics of programming never get good at it anyhow.
One of the painful things about our time is that those who feel certainty are stupid, and those with any imagination and understanding are filled with doubt and indecision - BR

Last edited by JHVH on Fri Oct 23, 4004 BCE 6:17 pm, edited 6 times in total.
User avatar
Yakk
 
Posts: 10038
Joined: Sat Jan 27, 2007 7:27 pm UTC
Location: E pur si muove

Re: Is Java is a bad language for beginners?

Postby EvanED » Thu Nov 17, 2011 11:13 pm UTC

Yakk wrote:No, learning a second language isn't wasted work -- it breaks you out of the myopia of being a single linguist.

Sorry, I probably typed that out a little too straight-faced.

People beginning to program are only going to be writing toy programs. So if you want them to learn a 'useful' skill in the short term, pick a language that is good at writing programs to solve toy problems. This won't always be the best path to follow for long-term programming literacy, but we could be realistic and say that most people who learn the basics of programming never get good at it anyhow.

I also think that it usually is, though. And more to the point, you should put very little weight on what languages will be useful later on, and choose what's best for learning. I've already said why I strongly think that a language like Python, Scheme, or perhaps ML or Haskell fits that bill far better than something like C, C++, or Java.
EvanED
 
Posts: 3766
Joined: Mon Aug 07, 2006 6:28 am UTC
Location: Madison, WI

Re: Is Java is a bad language for beginners?

Postby Yakk » Fri Nov 18, 2011 3:14 am UTC

Ah, yes, you where too cunning there.
One of the painful things about our time is that those who feel certainty are stupid, and those with any imagination and understanding are filled with doubt and indecision - BR

Last edited by JHVH on Fri Oct 23, 4004 BCE 6:17 pm, edited 6 times in total.
User avatar
Yakk
 
Posts: 10038
Joined: Sat Jan 27, 2007 7:27 pm UTC
Location: E pur si muove

Re: Is Java is a bad language for beginners?

Postby yukizora » Sun Nov 20, 2011 8:58 pm UTC

It just looks like a PC vs Apple thread, where Apple supporters just go ahead and put noob-friendliness forward.
Higher learning curve is not always bad.
The fact that you learn an useful language first doesn't mean you won't use any other. (There are a handful of those)
Of course for someone who really struggles you can take one more step, but in this case I'd rather start with HTML, then maybe MySQL, then something with more substance like PHP / C / java depending on whichever is most useful.
Notice they just don't do the same thing, but that's not the matter, you have to get used to abstraction, that's it.
yukizora
 
Posts: 42
Joined: Tue Jun 08, 2010 9:13 am UTC

Re: Is Java is a bad language for beginners?

Postby Jplus » Mon Nov 21, 2011 11:37 am UTC

Excuse me, but if people just "have to get used to abstraction", as you put it, then why are languages like C and Java better than Python, according to you? I'd say they have so many complicated details and other peculiarities that you might be distracted from the actual abstractions. In fact, Python is more open to different paradigms, so it might provide better grounds to learn all kinds of abstractions. To put it bluntly: "easy" languages like Python are more abstract, while languages like C and Java involve more technical details.

PHP has about the same kind of substance as Python, so I don't see why you share it with C and Java. Also, I don't see how it makes any sense to learn SQL before learning a (near-)general purpose language. On the other hand, I do agree that HTML is a good way to get familiar with formal languages, before moving on to programming.

A steep learning curve isn't always bad (it depends on the person and the situation), but I think in most cases a gentle curve is still better. Also, that's not the only thing this thread is about; people have mentioned other reasons why Java in particular might be a bad first language.
Hey, like coding? Perhaps you should check out the red spider project.
Feel free to call me Julian. J+ is just an abbreviation.
User avatar
Jplus
 
Posts: 1091
Joined: Wed Apr 21, 2010 12:29 pm UTC

Re: Is Java is a bad language for beginners?

Postby yukizora » Tue Nov 22, 2011 10:10 am UTC

Jplus wrote:Excuse me, but if people just "have to get used to abstraction", as you put it, then why are languages like C and Java better than Python, according to you? I'd say they have so many complicated details and other peculiarities that you might be distracted from the actual abstractions. In fact, Python is more open to different paradigms, so it might provide better grounds to learn all kinds of abstractions. To put it bluntly: "easy" languages like Python are more abstract, while languages like C and Java involve more technical details.

PHP has about the same kind of substance as Python, so I don't see why you share it with C and Java. Also, I don't see how it makes any sense to learn SQL before learning a (near-)general purpose language. On the other hand, I do agree that HTML is a good way to get familiar with formal languages, before moving on to programming.

A steep learning curve isn't always bad (it depends on the person and the situation), but I think in most cases a gentle curve is still better. Also, that's not the only thing this thread is about; people have mentioned other reasons why Java in particular might be a bad first language.


Yep, my point was rather against python and not completely for Java.
Java is nice to start if you can deal with the Object-oriented perspective. It might be too much for some, it might look awesome to others.
In a world where there are languages that have different syntax, and they fit different needs, you have the luxury of picking a language that has the syntax you can understand AND that will be useful in the future. Java is one of the languages that is very useful in a general or professional purpose, and while C++ is close and could be argued as an alternative, they're just used for different things overall, and C++ is maybe a little harder for beginners.

And that's not even taking care of the ginormous Java doc that has been priceless since I started learning.
yukizora
 
Posts: 42
Joined: Tue Jun 08, 2010 9:13 am UTC

Re: Is Java is a bad language for beginners?

Postby Yakk » Tue Nov 22, 2011 1:23 pm UTC

I understand the position that Java can be useful professionally. But many other languages are also useful professionally, and they don't suck your soul out through a straw and then masticate it before reinserting it via an enema. So there is that.
One of the painful things about our time is that those who feel certainty are stupid, and those with any imagination and understanding are filled with doubt and indecision - BR

Last edited by JHVH on Fri Oct 23, 4004 BCE 6:17 pm, edited 6 times in total.
User avatar
Yakk
 
Posts: 10038
Joined: Sat Jan 27, 2007 7:27 pm UTC
Location: E pur si muove

PreviousNext

Return to Religious Wars

Who is online

Users browsing this forum: 0scqu404 and 2 guests