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 Praetor » Sun Aug 01, 2010 3:26 am UTC

I started with TI-BASIC, and pretty much dove straight into C/C++ after that, and I've been using it since... (though I believe the intro to CS class I'm taking this fall is in Java, so I'll be picking that up I guess). I've used php and javascript a bit and messed with Lisp and a little C#, among other things, but my ultimate career goal is in game programming, where C++ is pretty much the standard, so I've focused pretty heavily on it.

Why don't more people write in assembly? I could do boatloads of stuff in Redcode and I've heard C is considerably slower than assembly.


Well, if you know assembly well you could probably write somewhat faster code than the average C compiler's output (and probably create a much smaller executable), but it would likely be a slow and painful process to write that assembly for anything of any complexity... plus portability issues (assembly languages vary based on processor architecture and whatnot). I've been meaning to learn some basic assembly for the heck of it, but I don't think a whole lot of people are willing to give up the portability/clarity etc of higher level languages for a speed boost.
Praetor
 
Posts: 11
Joined: Sun Aug 09, 2009 1:56 am UTC

Re: Is Java is a bad language for beginners?

Postby Indefinity » Sun Aug 01, 2010 2:50 pm UTC

From what I've heard, unless you're an expert in assembly (which are few and far between), then the C compiler will almost always beat you. Maybe in a few small domains you might have the edge over the compiler, but probably not enough to warrant writing everything in assembly. If you decide to go that route, focus on C, and learn some assembly to supplement that.
Indefinity
 
Posts: 87
Joined: Thu Dec 24, 2009 7:49 pm UTC

Re: Is Java is a bad language for beginners?

Postby Xanthir » Sun Aug 01, 2010 4:34 pm UTC

Indefinity wrote:From what I've heard, unless you're an expert in assembly (which are few and far between), then the C compiler will almost always beat you. Maybe in a few small domains you might have the edge over the compiler, but probably not enough to warrant writing everything in assembly. If you decide to go that route, focus on C, and learn some assembly to supplement that.

This is absolutely true. Modern C compilers are *extremely* intelligent and will routinely stomp even expert assembly programmers. The amount of information you have to keep track of in a modern computer to wring out the best efficiencies is so enormous and intricate that human brains just can't keep up.
(defun fibs (n &optional (a 1) (b 1)) (take n (unfold '+ a b)))
User avatar
Xanthir
My HERO!!!
 
Posts: 4022
Joined: Tue Feb 20, 2007 12:49 am UTC
Location: The Googleplex

Re: Is Java is a bad language for beginners?

Postby Praetor » Sun Aug 01, 2010 11:21 pm UTC

Xanthir wrote:
Indefinity wrote:From what I've heard, unless you're an expert in assembly (which are few and far between), then the C compiler will almost always beat you. Maybe in a few small domains you might have the edge over the compiler, but probably not enough to warrant writing everything in assembly. If you decide to go that route, focus on C, and learn some assembly to supplement that.

This is absolutely true. Modern C compilers are *extremely* intelligent and will routinely stomp even expert assembly programmers. The amount of information you have to keep track of in a modern computer to wring out the best efficiencies is so enormous and intricate that human brains just can't keep up.


That's what I thought; I do remember seeing some project euler solution or something in assembly that had a tiny executable and was supposedly fairly fast compared to C, but I suspect it took a lot more effort to write than the alternatives, and that speed boost probably wouldn't continue for anything more complex (unless you're a compiler writer or something...)...
Praetor
 
Posts: 11
Joined: Sun Aug 09, 2009 1:56 am UTC

Re: Is Java is a bad language for beginners?

Postby Xanthir » Mon Aug 02, 2010 12:54 am UTC

Right, PE problems typically count as "trivial" in terms of implementation, and so the speed benefits gained from lifting the whole thing to registers, avoiding the stack and the heap, can be substantial. C compilers will put as much as possible into registers, but can't always tell when such would be beneficial or harmful.
(defun fibs (n &optional (a 1) (b 1)) (take n (unfold '+ a b)))
User avatar
Xanthir
My HERO!!!
 
Posts: 4022
Joined: Tue Feb 20, 2007 12:49 am UTC
Location: The Googleplex

Re: Is Java is a bad language for beginners?

Postby cjmcjmcjmcjm » Mon Aug 02, 2010 1:31 am UTC

I went Qbasic, TI-Basic, Java, and then college happened and I've been stuck here. I also learned LilyPond on the way, but that is more of a markup language than a general-purpose programming language
frezik wrote:Anti-photons move at the speed of dark

DemonDeluxe wrote:Paying to have laws written that allow you to do what you want, is a lot cheaper than paying off the judge every time you want to get away with something shady.
User avatar
cjmcjmcjmcjm
 
Posts: 1022
Joined: Tue Jan 05, 2010 5:15 am UTC
Location: Anywhere the internet is strong

Re: Is Java is a bad language for beginners?

Postby flying sheep » Mon Aug 02, 2010 6:43 pm UTC

a friend told me of a guy who writes assembler vst plugins for fun. his newest can process 16 channels in real time using 3% cpu time.
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 Xeio » Tue Aug 03, 2010 6:48 pm UTC

My order:

Quickbasic
C++ (this was horrible in high school)
Java (Starting Uni)
C# (I use this for my job, I love it; learned in personal time)
Haskell
C (So much better than C++)
Ruby
Python (Bleh)

I think java is an ok language for beginners, but it's not very fun, and once you get down the basics it has a lot of quirks that will slowly drive you insane. I think C# is a much better progression than Java (it's basically Java 2.0, but in a good way). For the most part, I think a scripting language is also fine to start with, I'm not necessarily sold as being better than a compiled language though. My biggest complaint is that as a beginner, I (others opinions may differ) would rather see more errors at compile time than runtime.
User avatar
Xeio
Friends, Faidites, Countrymen
 
Posts: 4446
Joined: Wed Jul 25, 2007 11:12 am UTC
Location: C:\Users\Xeio\

Re: Is Java is a bad language for beginners?

Postby GoC » Tue Aug 03, 2010 7:29 pm UTC

Xanthir wrote:Right, PE problems typically count as "trivial" in terms of implementation, and so the speed benefits gained from lifting the whole thing to registers, avoiding the stack and the heap, can be substantial.
What are PE problems?
Belial wrote:I'm just being a dick. It happens.
GoC
 
Posts: 336
Joined: Mon Nov 24, 2008 10:35 pm UTC

Re: Is Java is a bad language for beginners?

Postby stephentyrone » Wed Aug 04, 2010 12:41 am UTC

Xanthir wrote:Modern C compilers are *extremely* intelligent and will routinely stomp even expert assembly programmers. The amount of information you have to keep track of in a modern computer to wring out the best efficiencies is so enormous and intricate that human brains just can't keep up.


No. I don't consider myself an "expert" assembly programmer (though I would consider myself "very good"), and I routinely stomp compilers. I'm regularly called to consult with compiler writers on how to improve their codegen. I have never had the experience of hand-tuning a routine only to discover that the compiler could do better.

That said, the compiler is much, much faster than me at generating the code; this is the real benefit of compilers, and why very little assembly is written. Beyond a set of system critical routines, you can't justify the expense of paying a skilled programmer to sweat every detail, do complex dependency analysis and write mathematical correctness proofs of optimizations--if you tried to write all code the way I do, fairly simple programs would cost thousands of dollars (at retail) and take years to develop.

Back on subject, here's how I came to be a very good assembly programmer:

1. Scheme
2. Prolog
3. Years of formal mathematics
4. C++
5. C

Personally, I think Java is a terrible language for beginners.

GoC wrote:What are PE problems?

Project Euler.
GENERATION -16 + 31i: The first time you see this, copy it into your sig on any forum. Square it, and then add i to the generation.
stephentyrone
 
Posts: 779
Joined: Mon Aug 11, 2008 10:58 pm UTC
Location: Palo Alto, CA

Re: Is Java is a bad language for beginners?

Postby Jplus » Wed Sep 15, 2010 5:12 pm UTC

Some remarks on the above posts.

- I agree that a first language doesn't need to be a good one, and that being easy is a much more important property. The very most important thing to start learning programming is the basic attitude. I started with Casio BASIC. My first "serious" language was C++, which I happen to like, but I noticed that many of my fellow students failed miserably because they didn't fully grasp the basic attitude of programming. Of course, if your first language is a good one, that's, er... good. But if the language is hard, that's bad. Python might be a candidate for being both good and easy.

- Java doesn't require less typing than C or C++. That shouldn't surprise anybody because the syntax is nearly the same (especially for basic stuff). For the same reason I don't think it's an easy language. Of course, Java has a particularly large library support, which can be convenient for experienced programmers, but I don't think it's really helpful for novices.
(Also, I think Java is not a good language in general, but there exist other threads for that.)

- Not just OOP doesn't reflect how the code actually runs. High languages never reflect how the code runs, that's why they are high. Only assembly reflects reliably what the machine is going to do. OOP certainly has its use, just like other paradigms, because in some cases it can be a better way to organise your code.

- I think that stephentyrone is right about assembly: C compilers (and fortran/C++/ObjC compilers, for that matter) aren't "extremely intelligent" or otherwise superhuman, but they do efficiently automate common optimizations. Humans can write faster assembly, but only if they are skilled and very well informed about the hardware and if they take a lot more time than the compiler. Even then, the produced code is not much faster and a lot less portable than if you'd written it in C.
However, when programming for special hardware, automated optimization might not be (fully) available, and portability is also less of an issue.

- Assembly is not good for beginners because it isn't easy, but it can be very instructive for advanced programmers.
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: 1098
Joined: Wed Apr 21, 2010 12:29 pm UTC

Re: Is Java is a bad language for beginners?

Postby Hybris » Fri Sep 24, 2010 1:20 pm UTC

My progression:
A little Visual Basic
Python
MATLAB
Java
A little C

First of all, I'm not a very experienced programmer (as you'll probably be able to tell), I am a bachelor (undergrad) student. I am fairly solid in Python though.

Python remains my favorite - a "Jack of all trades, master of one" language (that's not a typo, I meant "one"). I love how code readabilty is emphasized, and how easy it is to use the different, often very solid libraries.

Java is very messy in my perception. I don't mean the syntax, but eg. the way var-names refer to the locations and not the values. There's to many type declarations, "incantations" as our professor called unnecessary code. If you're gonna use a high-level language, why not go all the way? But I realize that it is so common (and with so many libraries) that Java can make you a decent programmer at low cost. Hell, I'm using it for a project at work right now.

I only wrote a few programs in C - I can certainly tell the advantages of the language. Definitely not suitable as a first or second language, but looks like a must for any serious programmer. Some very elegant solutions can be written. (It took me ages to understand the whole pointers-business though..!)

My vote is for Python. The applicability, ease of use, power, many libraries make it near perfect.
Hybris
 
Posts: 0
Joined: Fri Sep 24, 2010 1:04 pm UTC

Re: Is Java is a bad language for beginners?

Postby Berengal » Fri Sep 24, 2010 2:16 pm UTC

Hybris wrote:Java is very messy in my perception. I don't mean the syntax, but eg. the way var-names refer to the locations and not the values.
To be fair, python does the same thing. Everything's a reference in both python and Java (except primitives in Java, but they can be thought of as a short-bus version of immutable objects.)

Java does have lots of compulsory, unignoreable, useless details.
It is practically impossible to teach good programming to students who are motivated by money: As potential programmers they are mentally mutilated beyond hope of regeneration.
User avatar
Berengal
Superabacus Mystic of the First Rank
 
Posts: 2707
Joined: Thu May 24, 2007 5:51 am UTC
Location: Bergen, Norway

Re: Is Java is a bad language for beginners?

Postby rrwoods » Fri Sep 24, 2010 2:18 pm UTC

Berengal wrote:compulsory, unignoreable, useless details.

The only things I've found "compulsory, unignoreable, and useless" about Java is things it doesn't have rather than things it does have.

Like god damn generic reification.
26/M/taken/US
age/gender/interest/country

Belial wrote:The sex card is tournament legal. And I am tapping it for, like, six mana.
User avatar
rrwoods
 
Posts: 1505
Joined: Mon Sep 24, 2007 5:57 pm UTC
Location: US

Re: Is Java is a bad language for beginners?

Postby Indefinity » Sun Sep 26, 2010 3:58 pm UTC

rrwoods wrote:
Berengal wrote:compulsory, unignoreable, useless details.

The only things I've found "compulsory, unignoreable, and useless" about Java is things it doesn't have rather than things it does have.

Like god damn generic reification.

It's hard to find anything to like about generics, other than the fact that they're better than nothing. Can they come out with a fixed, non-backwards compatible Java 2.0 already? Oh wait, Oracle is in charge now. So much for that.
Indefinity
 
Posts: 87
Joined: Thu Dec 24, 2009 7:49 pm UTC

Re: Is Java is a bad language for beginners?

Postby Alan Chatham » Sun Oct 03, 2010 9:40 am UTC

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 think it's hard for anyone to really think back at the first time they started programming and have an accurate idea of what made sense, what didn't make sense, and what was hard. I really appreciate Python's syntax in that regard - no messing around with curly braces, enforced tabbing, and no end-line semi-colon. It took me at least a year of working with Java/C++ before I wasn't regularly omitting semi-colons. I figure if you stick with CS, you'll get plenty of chances to deal with mystery compiler errors because you forgot a semicolon or paren or bracket, so starting with something that's somewhat more forgiving syntactically makes a lot of sense.

Also, it's hard to remember how much very basic stuff in CS you don't know when you're a beginner. For instance, on Day 1, do you really need to know much about variable types? I don't think you do. You probably need to know what a function is. I mean, in a first-semester CS class, you should learn about types, but I think your time is much better spent wrapping your head around recursion, iteration, and what's appropriate, rather than worrying about memory allocation, pointers, and generics. Python is ideal for that level of "I've never programmed anything in my life", IMO.

I'm just thinking back to my progression - I work almost exclusively in C and ASM for microcontrollers these days, so there's a ton of stuff I never touched with Python that I have to deal with. However, all that stuff came later in my education. My first class (CS 5) started with Python, then did some digital logic, then some made-up ASM, then back to Python, and I thought it was fantastic for a beginner. Mostly Python, with just enough to start to realize what was going on under the hood. In later courses, I did Java, Scheme, C++, and C, but yeah, it wasn't until course #3, course #4 in the series that we got back to memory management, even. There are a lot of really important things that go on in lower-level languages, but we have languages that do all those nasty things for you, so when you start out, go ahead and ignore them. You'll get to them eventually, and they're really interesting topics, but there's a lot of foundation stuff that needs to be built first - when you're building a house, it's a lot easier to make the frame if you use power tools than if you forge your own nails.
Alan Chatham
 
Posts: 7
Joined: Sat Nov 14, 2009 1:26 am UTC

Re: Why Java is a bad language for beginners

Postby whatshisfoot » Tue Oct 12, 2010 1:20 am UTC

Notch wrote:(Java's still my favorite language, it's so pure and clean, and the style guide actually makes it pretty to look at (except that {'s should be on their own lines, damnit))

Your handle is Notch, you live in Stockholm, and you like Java.
Are you the guy behind minecraft?

Also, as a semi-beginner with Java as his first language, I can say that I do really like Java, its very definite and easy to read.
Last edited by whatshisfoot on Tue Oct 12, 2010 1:59 am UTC, edited 1 time in total.
whatshisfoot
 
Posts: 13
Joined: Wed Mar 17, 2010 6:00 pm UTC

Re: Is Java is a bad language for beginners?

Postby Indefinity » Tue Oct 12, 2010 1:34 am UTC

If you say that Java is clean and easy to read, then you've really been looking at the wrong languages.
Indefinity
 
Posts: 87
Joined: Thu Dec 24, 2009 7:49 pm UTC

Re: Is Java is a bad language for beginners?

Postby whatshisfoot » Tue Oct 12, 2010 2:02 am UTC

I don't claim to have much to go by, but for whatever reason, it just seems to make more sense than anything I've ever worked with. but then, I'm biased, because its the only thing I've ever really tried with much intent.
whatshisfoot
 
Posts: 13
Joined: Wed Mar 17, 2010 6:00 pm UTC

Re: Is Java is a bad language for beginners?

Postby Jplus » Tue Oct 12, 2010 11:53 am UTC

I find Java's syntax one of the uglier syntaxes that I know of. And honestly, I do have quite some comparison material.
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: 1098
Joined: Wed Apr 21, 2010 12:29 pm UTC

Re: Is Java is a bad language for beginners?

Postby cjmcjmcjmcjm » Thu Oct 14, 2010 4:44 am UTC

jfeord14 wrote:disagree, bluej is great for begginers it helped me immensely

bluej++. I still wish Eclipse had something like Blue J's object creator
frezik wrote:Anti-photons move at the speed of dark

DemonDeluxe wrote:Paying to have laws written that allow you to do what you want, is a lot cheaper than paying off the judge every time you want to get away with something shady.
User avatar
cjmcjmcjmcjm
 
Posts: 1022
Joined: Tue Jan 05, 2010 5:15 am UTC
Location: Anywhere the internet is strong

Re: Is Java is a bad language for beginners?

Postby VOIDHand » Thu Oct 14, 2010 8:01 pm UTC

Going back to multiple [edit] return values brought up earlier, what would be a better approach for converting 3-dimension coordinates? With multiple [edit] return values:

Code: Select all
func CartesionToSpherical(x, y, z) returns pi, theta, phi {
  //calculate the values
  return pi, theta, phi
}


Would it be better to always return a single class (return Point) or tuple? Maybe pass the return values by Reference?

Closer to being on topic:

My own experience with programming languages is:
TI-83+ Basic - self-taught
C++ - taught by a book (wouldn't recommend... wrapping my head around classes without having the opportunity to ask what it was talking about was a bad idea);
C++ - taught in classes, took the AP CS exam
Java - for AP classes
VB6 and VB.NEt - in two more high school classes
Oz - For a programming paradigms class
PHP - self taught to make myself more marketable.

I would consider the worst possible first programming language would be Javascript. Unfortunately, I could see this being a number of people's first experience with programming, especially those that decide to start by messing around with HTML and other basic webdesign. I'm not a fan of any weakly typed language, but the fact that without external tools it can be difficult know what's actually going wrong even with some amount of experience.

I do agree that Java might be a bit verbose, but I don't think it necessarily is a "bad" language to learn as a first language, especially if you have a good teacher, but there are definitely better languages.
Last edited by VOIDHand on Mon Oct 18, 2010 5:05 pm UTC, edited 1 time in total.
VOIDHand
 
Posts: 0
Joined: Thu Oct 14, 2010 5:35 pm UTC

Re: Is Java is a bad language for beginners?

Postby Jplus » Sat Oct 16, 2010 5:39 pm UTC

VOIDHand wrote:Going back to multiple inheritance brought up earlier, what would be a better approach for converting 3-dimension coordinates? With multiple inheritance:

Code: Select all
func CartesionToSpherical(x, y, z) returns pi, theta, phi {
  //calculate the values
  return pi, theta, phi
}


Would it be better to always return a single class (return Point) or tuple? Maybe pass the return values by Reference?

I don't see the relation to multiple inheritance. In fact, I see no relation with inheritance at all.
As for your question on how to return the values: it totally depends on what you want and what language you are using. Returning an instance of a specialized class or struct is the most popular way in languages like C++ and Java, and fits well if you like encapsulation. Returning a tuple is the easiest and cleanest way if you're using something like Python or Haskell. Passing references to the objects that should hold the return value is something you'd typically do in a strong optimizing context, perhaps in C or C++.
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: 1098
Joined: Wed Apr 21, 2010 12:29 pm UTC

Re: Is Java is a bad language for beginners?

Postby VOIDHand » Mon Oct 18, 2010 5:04 pm UTC

Jplus wrote:
VOIDHand wrote:Going back to multiple inheritance brought up earlier, what would be a better approach for converting 3-dimension coordinates? With multiple inheritance:

Code: Select all
func CartesionToSpherical(x, y, z) returns pi, theta, phi {
  //calculate the values
  return pi, theta, phi
}


Would it be better to always return a single class (return Point) or tuple? Maybe pass the return values by Reference?

I don't see the relation to multiple inheritance. In fact, I see no relation with inheritance at all.
As for your question on how to return the values: it totally depends on what you want and what language you are using. Returning an instance of a specialized class or struct is the most popular way in languages like C++ and Java, and fits well if you like encapsulation. Returning a tuple is the easiest and cleanest way if you're using something like Python or Haskell. Passing references to the objects that should hold the return value is something you'd typically do in a strong optimizing context, perhaps in C or C++.


Wow, Bad slip of the tongue there. I had intended to say "Multiple Return Values". Mea Culpa.
VOIDHand
 
Posts: 0
Joined: Thu Oct 14, 2010 5:35 pm UTC

Re: Is Java is a bad language for beginners?

Postby ochuckles » Sun Nov 14, 2010 9:51 pm UTC

Languages you should learn first (in order):

- C. (To learn how computers actually work.)
- Scheme or CL or Lua or maybe JavaScript. (To learn how to describe patterns.)
- Anything in between that floats your fancy. (This would include Python.)

Start with an understanding of both low and high level programming, then just "follow your nose."

The most important thing is not the language, but to always be solving practical problems. That's the best way to drive learning.

Java is a terrible language to start with for some pretty obvious reasons. "Hello, world" is 5 lines long and has about 12 different language concepts in it. Beyond indicated a ridiculously designed language, it's also a very confusing starting point.
ochuckles
 
Posts: 8
Joined: Sun Nov 14, 2010 9:24 pm UTC

Re: Is Java is a bad language for beginners?

Postby flying sheep » Mon Nov 15, 2010 1:51 pm UTC

java is bad because
  • it doesn’t practice what it preaches (if operator overloading is so bad, why does java do it itself with strings)
  • it has the confusing concept of primitives vs. objects (why is not everything an object?)
  • it violates the DRY concept in multiple ways (e.g. there isn’t multiple inheritance (which is ok), but there are neither mixins to compensate that. or you have to say tell it that {"ab","cd"} is a string array, which the compiler clearly can see)
  • checked exceptions have the same problems windows’ “are you really sure” boxes have: they are annoying and delude to simply “click them away” after the 100th time (try/catch which simply prints the error message or even is empty)
  • everything has very long names, and there is no way to keep the code nice and short (such as python’s import … as …)
  • as said in the previous post: you have to learn almost everything before you understand a hello world program (and that’s bad, because “simply ignore 90% of the code for now” is really bad for learning something)
  • you have to have the insecure, slow (and on windows annoyingly auto-updating) java vm on your pc.
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 Indefinity » Wed Nov 17, 2010 1:22 am UTC

flying sheep wrote:java is bad because
    ...
  • you have to have the insecure, slow (and on windows annoyingly auto-updating) java vm on your pc.

Now this part I disagree with. The JVM is slower than, say, a natively-compiled program, but is still much faster than just about anything produced in Python, even compiled Python. I've never really heard much (recently) about the JVM being insecure, and anyways most Java programs run on servers and not the client anyways so there's no reason you should be running insecure code on a machine you control so closely. (I might be making an assumption about your environment here :)) (I also don't consider the JVM as part of the browser to be a valid argument, because everyone knows that applets suck.)

Also, the JVM is the reason why much better languages like Groovy and Scala have made a splash in the community so soon after their inception.

You do have a point about the Windows auto-updating thing though. But just about any auto-update is annoying.


Another thing to note about Java's inconsistencies: when declaring a variable, you must always declare its type, yet when chaining multiple method calls, the compile seems to already know the return type. For instance:
Code: Select all
StringBuilder sb = new StringBuilder(); // must declare "sb" as a StringBuilder
String s = sb.append("hello").append(" world!").toString(); // Why no casting after the first append() method?

My guess is that Java does this so you can declare a variable as a more abstract type than what you're instantiating. Still, since it's obvious that the compiler knows what type the object is, it would be nice to just not bother repeating the type twice.
Indefinity
 
Posts: 87
Joined: Thu Dec 24, 2009 7:49 pm UTC

Re: Is Java is a bad language for beginners?

Postby Xanthir » Wed Nov 17, 2010 6:21 am UTC

The Java runtime has actually become one of the most prolific attack vectors for viruses lately. We don't allow the runtime on our computers at all at my work anymore.
(defun fibs (n &optional (a 1) (b 1)) (take n (unfold '+ a b)))
User avatar
Xanthir
My HERO!!!
 
Posts: 4022
Joined: Tue Feb 20, 2007 12:49 am UTC
Location: The Googleplex

Re: Is Java is a bad language for beginners?

Postby Jplus » Wed Nov 17, 2010 5:42 pm UTC

So these are some of the reasons Java is bad in general. I stick with my opinion that the reason it's bad for beginners is that it isn't easy.

Admittedly, once you've grasped the very basics it's relatively easy to produce something with Java because of the extensive standard libraries. Then again, that very fact has yet another educational backdraw, as explained by articles from AdaCore. I'm sure links like these have been posted before in several other places on these forums, maybe even already earlier in this thread.
http://www.cs.fsu.edu/~gaitrosd/classes/CEN4010/Articles/DewarSchonberg.pdf
http://www.adacore.com/wp-content/uploads/2009/02/principled_approach.pdf
(I seem to recall that there was a famous HTML version of the former article, but I couldn't find it.)

Edit: removed the second link. After a second look, it mostly appeared to be ranting on Java to make Ada look better. The first article however makes very valid points.
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: 1098
Joined: Wed Apr 21, 2010 12:29 pm UTC

Re: Is Java is a bad language for beginners?

Postby Indefinity » Wed Nov 17, 2010 11:08 pm UTC

That article is interesting, though I think the authors fail to realize that you can most certainly learn algorithms in languages that don't start with a C. While I think every programmer worth their salt should eventually learn C, there's no reason you can't learn how to create a linked list in Java or Python. Performance analysis is still important, but is losing importance with every new chip that comes out. And while C++ does bring to C some "fundamental concepts of modern software engineering", I hardly think that they're necessarily good examples of it.
Indefinity
 
Posts: 87
Joined: Thu Dec 24, 2009 7:49 pm UTC

Re: Is Java is a bad language for beginners?

Postby Thesh » Thu Nov 18, 2010 1:45 pm UTC

I started out with HTML and CSS, and then did some JavaScript before moving into C. Admittedly, I had some bad habits from JavaScript.

I think you will be fine with pretty much any language for your first language, but I believe C should be something to learn early on (e.g. second or third language) before you start really drilling deep into object oriented concepts.
Eppur si mouve.
User avatar
Thesh
Has the Brain Worms, In Case You Forgot.
 
Posts: 2573
Joined: Tue Jan 12, 2010 1:55 am UTC
Location: Southern California, USA

Re: Is Java is a bad language for beginners?

Postby stephentyrone » Mon Dec 27, 2010 5:18 am UTC

Indefinity wrote:Performance analysis is still important, but is losing importance with every new chip that comes out.


No. Ten thousand times no.

Performance analysis is always and will always be important (ok, for the foreseeable future). Even if there's no perceptible difference in user-level application performance, improved performance translates directly into lower energy usage, which gets you better battery life, which means the tiny device in your pocket lasts longer before you need to plug it into a wall, or can be smaller to fit in your pocket more easily.
GENERATION -16 + 31i: The first time you see this, copy it into your sig on any forum. Square it, and then add i to the generation.
stephentyrone
 
Posts: 779
Joined: Mon Aug 11, 2008 10:58 pm UTC
Location: Palo Alto, CA

Re: Is Java is a bad language for beginners?

Postby Zarj » Tue Jan 04, 2011 12:34 am UTC

I must admit I just skimmed through the first page before deciding to post a reply...
Java is absolutely the best programming language to start people on.
First of all, it's extremely well documented. Javadoc and the Java API make writing code in Java extremely easy. No other language is as well documented (especially for seeing documentation in real-time in the form of Javadoc) like Java. Yes, plenty of other languages have good documentation, but Javadoc is truly a step above everything else.
Secondly, Java is an excellent balance between being too abstract and too low-level. I've read some of the replies in this thread and thought they were entirely ridiculous. Starting people in assembly? Yeah, right, people who have never touched code before are going to easily understand that. C/C++ aren't bad choices, but all the low-level manipulation in C makes it not ideal for beginners (a first time programmer shouldn't have to memset everything). On the other side of the spectrum, Python is a terrible language for beginners. Sure, it's fairly intuitive. It's also extremely unambiguous. What is this data structure I am getting? A list? A dictionary? Java's structure is a good thing for new programmers to learn. If you were to start with Python, I think transferring to C would be a hard stretch.
Thirdly, Java is one of the most easily readable languages. It's rarely cryptic, and when you use proper variable names, things make sense. For those of you who say "new programmers shouldn't have to learn the conventions of any language": well then, let's let them write bad code in every language they write in, yeah?

My progression of languages was:
TI-83 (graphing calculator version of basic)
C++
Java
C
Python
MIPS assembly

(I should also say that everyone should spend a little while programming graphing calculators before they get into any real language. It's excellent for learning loops and basic control flow).
User avatar
Zarj
 
Posts: 17
Joined: Tue Jan 04, 2011 12:04 am UTC

Re: Is Java is a bad language for beginners?

Postby Meteorswarm » Wed Jan 05, 2011 6:21 am UTC

Zarj wrote:I must admit I just skimmed through the first page before deciding to post a reply...
Java is absolutely the best programming language to start people on.
First of all, it's extremely well documented. Javadoc and the Java API make writing code in Java extremely easy. No other language is as well documented (especially for seeing documentation in real-time in the form of Javadoc) like Java. Yes, plenty of other languages have good documentation, but Javadoc is truly a step above everything else.
Secondly, Java is an excellent balance between being too abstract and too low-level. I've read some of the replies in this thread and thought they were entirely ridiculous. Starting people in assembly? Yeah, right, people who have never touched code before are going to easily understand that. C/C++ aren't bad choices, but all the low-level manipulation in C makes it not ideal for beginners (a first time programmer shouldn't have to memset everything). On the other side of the spectrum, Python is a terrible language for beginners. Sure, it's fairly intuitive. It's also extremely unambiguous. What is this data structure I am getting? A list? A dictionary? Java's structure is a good thing for new programmers to learn. If you were to start with Python, I think transferring to C would be a hard stretch.
Thirdly, Java is one of the most easily readable languages. It's rarely cryptic, and when you use proper variable names, things make sense. For those of you who say "new programmers shouldn't have to learn the conventions of any language": well then, let's let them write bad code in every language they write in, yeah?

My progression of languages was:
TI-83 (graphing calculator version of basic)
C++
Java
C
Python
MIPS assembly

(I should also say that everyone should spend a little while programming graphing calculators before they get into any real language. It's excellent for learning loops and basic control flow).


The languages you have tasted cover only a very small part of the space of possible languages. With the exception of python (and it's only there if you look for it), you don't have any functional languages, so you're probably not familiar with that kind of programming, let along more exotic types like declarative languages.

Also, why should a new programmer have to know what they're dealing with explicitly? Even Java has generic types and types with inheritance for just this reason - you can write lots and lots of code that doesn't need to know exactly what it's dealing with, as long as it behaves properly. You're coming from a very low-level background that deals with lots of the intricacies of the machine. And that's fine. In fact, that kind of knowledge is really important, but it's not the whole story. One can be quite productive without knowing the details of how something is implemented.

I think it's a bit premature to say that "Java is absolutely the best programming language to start people on" without understanding the values of other languages. What if somebody is from a pure mathematical background and never intends to touch the hardware in their life? Why start them on Java, which has lots of data structures and optimizations tied to hardware peculiarities, when they'd probably be better served by a functional language, or a declarative one, or a logic language? There are a hundred other use cases where Java is demonstratably not the optimal choice.
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 Zarj » Wed Jan 05, 2011 5:15 pm UTC

Meteorswarm wrote:I think it's a bit premature to say that "Java is absolutely the best programming language to start people on" without understanding the values of other languages. What if somebody is from a pure mathematical background and never intends to touch the hardware in their life? Why start them on Java, which has lots of data structures and optimizations tied to hardware peculiarities, when they'd probably be better served by a functional language, or a declarative one, or a logic language? There are a hundred other use cases where Java is demonstratably not the optimal choice.


Fair enough, I suppose Java is not always the best choice, depending on what you are planning on doing as a programmer. However, for the average programmer, who is probably going to go on to develop games or business software or web applications, I think Java is absolutely the best choice for a first language. You need to start people off with a small understanding of what is going on at a low level, so as to not overwhelm them, but still make them aware of what is going on in the background, while also teaching them solid programming concepts. Java is portable, easy to debug, readable... for the beginner who is not just dabbling in one language, but who eventually wants to master the concept of "programming" as a whole, Java is the best place to start.
User avatar
Zarj
 
Posts: 17
Joined: Tue Jan 04, 2011 12:04 am UTC

Re: Is Java is a bad language for beginners?

Postby flying sheep » Fri Jan 07, 2011 12:51 pm UTC

argh, if i read “java” in combination with “business” one more time, my head asplodes like a minecraft creeper. *bsssssssssssssssssssBOOOOM*

java is inconsistent and forces bad habits down your throat. some things about that language went terribly wrong, and on top among them are bazillions of srs bizniss java ee retard “solutions” only created to overcome shortcomings of the language. if you don’t fucking have closures then don’t try to use them ore use another language which has them. and if thou shalt useth the clean an pureth java language, then don’t use beans to mimick multiple return values, because java has none.

what i want to say is: java is a very narrow hammer, but unfortunately it’s popularity made whole towns of self-proclaimed programmers to look on many problem long enough that they looked like nails.
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 Berengal » Fri Jan 07, 2011 4:13 pm UTC

Code: Select all
public class App{
  public static void main(String...args){
    abstract class F{abstract void call(Object...args);}
    new Object(){void map(F f, Object...args){
      for(Object arg : args){f.call(arg);}}
    }.map(new F(){public void call(Object...args){System.out.println(args[0]);}}
      , "They take my lambdas"
      , "and my types, but I can still"
      , "write closure haikus"
      , ""
      , "  - Haskell developer");
  }
}
It is practically impossible to teach good programming to students who are motivated by money: As potential programmers they are mentally mutilated beyond hope of regeneration.
User avatar
Berengal
Superabacus Mystic of the First Rank
 
Posts: 2707
Joined: Thu May 24, 2007 5:51 am UTC
Location: Bergen, Norway

Re: Is Java is a bad language for beginners?

Postby flying sheep » Sat Jan 08, 2011 3:55 pm UTC

this… is horrible! *shudder* i never thought it could be this bad.

thanks for backing my point, i seldom get support when i make such statements.
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 Zarj » Sat Jan 08, 2011 4:44 pm UTC

flying sheep wrote:this… is horrible! *shudder* i never thought it could be this bad.

thanks for backing my point, i seldom get support when i make such statements.


How does writing bad code in Java prove that Java is a bad language?
I can wrote some bad code in C, and C++, and a few others things too, if you would like, and then we can call them bad languages too.
User avatar
Zarj
 
Posts: 17
Joined: Tue Jan 04, 2011 12:04 am UTC

Re: Is Java is a bad language for beginners?

Postby Berengal » Sat Jan 08, 2011 5:24 pm UTC

flying sheep wrote:this… is horrible! *shudder* i never thought it could be this bad.

thanks for backing my point, i seldom get support when i make such statements.

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.

(I also don't see what dependency injection has to do with closures)
It is practically impossible to teach good programming to students who are motivated by money: As potential programmers they are mentally mutilated beyond hope of regeneration.
User avatar
Berengal
Superabacus Mystic of the First Rank
 
Posts: 2707
Joined: Thu May 24, 2007 5:51 am UTC
Location: Bergen, Norway

PreviousNext

Return to Religious Wars

Who is online

Users browsing this forum: Slageammalymn and 2 guests