Page 2 of 7 FirstFirst 1234 ... LastLast
Results 11 to 20 of 61

Thread: Java seems harder than C++

  1. #11
    Join Date
    Nov 2007
    Beans
    Hidden!

    Re: Java seems harder than C++

    y
    Last edited by ameba; March 28th, 2008 at 06:11 AM.

  2. #12
    Join Date
    Jul 2007
    Beans
    305
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: Java seems harder than C++

    Quote Originally Posted by bluewagon View Post
    but in Java, you have to have a buffer reader, and have a string variable for every int(or any other type) and then have to convert from string to int(or any other type)
    Additionally you need to catch exceptions that might occur during converting.
    Java is easier than C++ mainly because of automatic memory management, and reduction of error-prone features of C++ such as multiple inheritance, pointers, operator overloading, etc.
    Multiple inheritance is not allowed in java because it's hard to implement. So sun chose interfaces instead. The "It's just too error-prone"-argument is an excuse. If you design a language with this attitude in mind only idiots will use the language.

    Java is easier than C++ but at what cost?
    iplist

    "Specialization is for Insects", R. Heinlein

  3. #13
    Join Date
    May 2005
    Location
    Dallas, TX
    Beans
    116
    Distro
    Ubuntu 20.04 Focal Fossa

    Re: Java seems harder than C++

    Quote Originally Posted by uljanow View Post
    Java is easier than C++ but at what cost?
    I cannot agree more. Our university switched the introductory programming courses from C++ to Java this semester, and I had the lovely job of TAing for this first semester. Perhaps it was just a case of misplaced priorities, but the curriculum was broken from the beginning; while the professors showed examples of Swing, us lab instructors had to teach if-else logic, while loops, and come up with some way to explain to students what all these errors dealing with classes are without explaining OO programming (which is not a part of the course and would only confuse them).

    With C++, there was never the temptation to teach how to make something "fancy" like an applet before learning simple constructs like if-else blocks, loops, and methods.

  4. #14
    Join Date
    Jan 2006
    Beans
    Hidden!
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Java seems harder than C++

    Quote Originally Posted by LaRoza View Post
    Who makes these decisions? The educators or a board?

    MIT uses Python, after Scheme.

    Some say to start with HLL, like Python, Perl, etc, some say start low, assembly, C, I can think of reasons to support both of these recommendations, however, I cannot think of a reason to use Java as a first language over others.
    We all know that Python can be used to program in the 3 largest paradigms (OO, declarative, functional). Scheme can only do functional.

    When MIT taught using Scheme, they taught functional programming.

    Since MIT switched to Python, how do they introduce Python?

    Is it using the OO paradigm? Doubt it, since C++ or Java or even C# can handle that one as well as Python can.

    Is it using functional paradigm? Doubt it, then what's the point of switching?

    Are they teaching Python as a declarative language? I would say yes. I would further say that a vast majority of Python code is written using the declarative paradigm (just like Perl and C).

    MIT's shift from Scheme to Python doesn't say anything about either language (whether one is better than the other). To me their switch is a paradigm shift from functional to declarative.

    Please note that I haven't taken their new CS course, nor do I know anything about it. If you do know how it is taught, please do reply and correct any mistakes/errors I have made.

    a Perl line:
    map { $words{lc($_)}++ } split /\W/, $input;
    #generates a key value pair from input counting how many times each word appears. (makes all words lowercase) (may contain some garbage data)
    I am infallible, you should know that by now.
    "My favorite language is call STAR. It's extremely concise. It has exactly one verb '*', which does exactly what I want at the moment." --Larry Wall
    (02:15:31 PM) ***TimToady and snake oil go way back...
    42 lines of Perl - SHI - Home Site

  5. #15
    Join Date
    Apr 2007
    Beans
    14,781

    Re: Java seems harder than C++

    Quote Originally Posted by slavik View Post
    MIT's shift from Scheme to Python doesn't say anything about either language (whether one is better than the other). To me their switch is a paradigm shift from functional to declarative.
    Yes, but it shows the language chosen (could have been a few others, including Perl and Ruby) will enable the introduction of programming in a logical way.

    I am saying there isn't much sense to learning Java as a first language.

    It is a lucrative language and popular, but isn't the best for instructional purposes.

    Imagine teaching it "This language is called Java, it isn't compiled, well sort of, I'll explain later. Here is the first tradtional program, the 'Hello world' program, I know you don't understand it, but I'll explain all that during the course, but for now, this is what the smallest program looks like."

    Or one could expain OO, Functions, and syntax immediately.

    Whereas in Perl, Python, and Ruby, such concepts can be introduced logically and without confusion.

    Or with Assembly, learning the inner workings with the simplest possible programs, will be more benificial than immediate exposure to a rather developed science all at once.

  6. #16
    Join Date
    Jan 2006
    Beans
    Hidden!
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Java seems harder than C++

    I agree that Java is not the best choice as an introductory language.

    My point in MIT case that they switched from functional programming as instroductory to CS to declarative programming as introductory to CS. And it doesn't show anything about the language.
    I am infallible, you should know that by now.
    "My favorite language is call STAR. It's extremely concise. It has exactly one verb '*', which does exactly what I want at the moment." --Larry Wall
    (02:15:31 PM) ***TimToady and snake oil go way back...
    42 lines of Perl - SHI - Home Site

  7. #17
    Join Date
    Jun 2007
    Location
    Maryland, US
    Beans
    6,288
    Distro
    Kubuntu

    Re: Java seems harder than C++

    Quote Originally Posted by LaRoza View Post
    Yes, but it shows the language chosen (could have been a few others, including Perl and Ruby) will enable the introduction of programming in a logical way.

    I am saying there isn't much sense to learning Java as a first language.

    It is a lucrative language and popular, but isn't the best for instructional purposes.

    Imagine teaching it "This language is called Java, it isn't compiled, well sort of, I'll explain later. Here is the first tradtional program, the 'Hello world' program, I know you don't understand it, but I'll explain all that during the course, but for now, this is what the smallest program looks like."

    Or one could expain OO, Functions, and syntax immediately.

    Whereas in Perl, Python, and Ruby, such concepts can be introduced logically and without confusion.

    Or with Assembly, learning the inner workings with the simplest possible programs, will be more benificial than immediate exposure to a rather developed science all at once.
    Your argument is very good. I am not here to weigh upon its merit.

    However, there are many cases where Java is compiled. Look up JIT, or Just In Time. If you have been around long enough, you would know that Java was conceived to be a language that could be used anywhere, including toasters and microwave ovens (and obviously other embedded applications); not just the WWW and desktop computers where it must be "interpreted".

  8. #18
    Join Date
    Apr 2007
    Beans
    14,781

    Re: Java seems harder than C++

    Quote Originally Posted by dwhitney67 View Post
    Your argument is very good. I am not here to weigh upon its merit.

    However, there are many cases where Java is compiled. Look up JIT, or Just In Time. If you have been around long enough, you would know that Java was conceived to be a language that could be used anywhere, including toasters and microwave ovens (and obviously other embedded applications); not just the WWW and desktop computers where it must be "interpreted".
    I know all about that. It is compiled to byte code, then executed in the "JVM", and about JIT and its original intent (appliances).

    Java is a versitle language, but requires a grasp of programming concepts to learn it. With other languages, concepts are introduced one at a time, whereas Java is written for programmers.

    That was my only argument against Java. I am not a Java hater, although I do not have a use (yet?) for the language for my personal use.

  9. #19
    Join Date
    Aug 2006
    Location
    60°27'48"N 24°48'18"E
    Beans
    3,458

    Re: Java seems harder than C++

    Hmm, Java isn't that bad. Yes, I'm sure that it's probably better to start off with something else, but especially in comparison to C++, Java is just so much simpler if you start with the assumption that you're going to be learning OOP concepts in your introductory course, as I did -- my introductory programming language at uni was Java. I, for one, can't think of a reason for having C++ as the first language... having System.out.println in your Hello World isn't much better than std::cout <<. (Simplicity of Hello World is a really bad argument in general though).

    Java is a kind of general compromise language, and this why it seems a bit bland in some respects. That's also probably it is probably popular

    Modred's example just shows the person who designed the class was incompetent as a teacher, not that Java is the problem.

    And slavik -- Scheme can do even imperative programming... that's what the (foo (x) (y) (z)) constructions are for. x and y are side-effects, z provides the value. And OOP in Scheme is simple -- you just create a lambda with a closure, and process messages in that lambda that manipulate the values in the closure.

    It's sort of sad that MIT decided to move away from Scheme as introductory language -- after all, the syntax part of Scheme is explained really quickly, so you can then move on expressing problems in that language...
    LambdaGrok. | #ubuntu-programming on FreeNode

  10. #20
    Join Date
    Apr 2007
    Beans
    14,781

    Re: Java seems harder than C++

    >Simplicity of Hello World is a really bad argument in general though)

    I wasn't comparing the languages, just the teaching of them.

    >Java is a kind of general compromise language, and this why it seems a bit bland in some respects. That's also probably it is probably popular

    Java isn't the most exciting language, true, but it works for what it is used

    >Modred's example just shows the person who designed the class was incompetent as a teacher, not that Java is the problem.

    Exactly. The people who decide what should be taught are rarely those able to make such decisions.

    >It's sort of sad that MIT decided to move away from Scheme as introductory language -- after all, the syntax part of Scheme is explained really quickly, so you can then move on expressing problems in that language...

    For one who has never taken courses in programming, I can't be sad because I feel no matter what is taught in school, a real programmer will learn without formal instruction.

Page 2 of 7 FirstFirst 1234 ... LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •