Why do people hate Java?



  • Several posts on this site imply that Java is rubbish, I am interested as to why.  I am hoping this thread will be in a similar vain to the one on PHP. 

    I am a C++ programmer who has recently starting doing a little Java and so far it seems fairly good, the bits I haven't liked are:

    - no RAII so some resource management is manual e.g. closing database connections

    - checked exceptions - but you can get more sensible unchecked behaviour by writing 'throws Exception' so I don't find this much of a problem.



  • Java is a perfectly good language overall.  I think there are two things people generally don't like about it:

    1) It can be comically verbose when you do things the "right" way, and

    2) Swing sucks more than you can imagine.

    Steve Yegge can say it better than I:  http://steve.yegge.googlepages.com/tour-de-babel (scroll down to the Java section).



  • @MET said:

    Several posts on this site imply that Java is rubbish, I am interested as to why.  I am hoping this thread will be in a similar vain to the one on PHP. 

    I am a C++ programmer who has recently starting doing a little Java and so far it seems fairly good, the bits I haven't liked are:

    - no RAII so some resource management is manual e.g. closing database connections

    - checked exceptions - but you can get more sensible unchecked behaviour by writing 'throws Exception' so I don't find this much of a problem.


    I don't know for others. I don't hate Java, I just find it far too verbose (the compiler still not being able to perform local type inference is... distasteful), lacking some concepts I grew to like a lot (higher-order functions, pattern matching, tuples & destructuring assignment, literal syntaxes for maps and arrays/arraylists).

    Which is part of the reason why I plan to check on Scala, looks like a very nice JVM language.

    Plus Scala implements an Erlang-like actors-based concurrency model instead of java's threads.



  • I will at some point be surrounded by people who don't know how to code, and they will do far less damage with Java than with C++.

    Now that's a great arguement =D

    What I like when looking at java (thinking from my C/C++ background):

    • strings. OMG give me easy manageable strings that don't suck.
    • virtual function calling from constructors. Yes, I know, members haven't been inilized yet. But I didn't need members, I need modified actions. Why does a language that allows loads and loads of unsafe shit (C) not to call virtual functions from a constructor?



  • @MET said:

    you can get more sensible unchecked behaviour by writing 'throws Exception' so I don't find this much of a problem.

    Oh dear. If you must, wrap Exceptions in RuntimeExceptions, but getting every method to throw Exception? Real WTF in the works there.

    I believe Java gets a tough rep here because TheDailyWTF has been a long-time refuge for Microsoft apologists. It's a great language.


     



  • I hate the Java standard library because it's full of poorly thought-out rubbish like Swing, and ends up having several different ways to do things because new versions were added to fix the stupider parts of earlier ones, with each different variant having different sets of bugs and some of them just being plain wrong.

    The Java language isn't really all that repulsive - but it's not all that good either. I'd give it a resounding "mediocre". It gets a few things right, but misses out on most of the best ideas about language design that have come up in the past 10 or 15 years (type inference, true polymorphism, naturally parallelisable code, a whole host of performance-related features, non-trivial namespace manipulation, ....)

    It could have been much better. It wasn't. 



  • @asuffield said:

    It could have been much better. It wasn't. 

    Worst part is that one of the designers wanted to add the advanced features some people are now asking for (anonymous first-class functions with closures and stuff), but the others didn't see the point (blub syndrome to re-use the expression) and just wanted to ship it.



  • Java is still suffering from the bad reputation it acquired in the mid to late 90's.

    It hit the scene pretty big in '95 claiming that it was the solution to all the world's problems.

    I remember some of the books I owned back then on Java...huge 1000+ page tomes on how Java was the future...and Java this and Java that.

    Well, the reality of the matter was, back in '95 nobody's home PC could run the stuff. So our machines crashed. And they crashed hard.

    People were soured on Java for years. The programmers were paid very well of course. What they built which was so wonderful and justified their salaries still mystifies me. Although I do remember so many shimmering water applets...

    Nowadays, Java works well on your average PC. But then again, so does .NET. So instead of Java being this "golden child", it's just another option.

    I think people hate Java because of their past experience with it. I struggled through those PC-crash days, so I guess I would fall into the hate camp. 



  • Swing has become better (IMO a lot better) in 1.5. Faster, less bugs. Other than that, I aggree with CPound. Hard to believe, isn it? ;-)

    What I like most about Java is the true plattform independence. I write Java apps on my Linux box and deploy them on Windows PCs. They simply work. I also like the comprehensive standard libraries and the good stuff that comes from Apache (Jakarta), Jasper and others. Report generation, export to Excel - all done without proprietary third-party components.

    What I hate most about Java, and the word "hate" is even euphemistic, is the abundance of frameworks. Useless frameworks. Redundant frameworks. Complicated frameworks. Short-lived frameworks. It seems to me that when some programmers noticed how easy software development is with Java, they desperately looked for ways to decrease productivity, to create an artificial lack of manpower so the wages stay high. They invented frameworks, and the succeeded.



  • @ammoQ said:

    What I hate most about Java, and the word "hate" is even euphemistic, is the abundance of frameworks. Useless frameworks. Redundant frameworks. Complicated frameworks. Short-lived frameworks.

    Amen, brother.  Because of yet another "standards readjustment" where I work, I've got this year to look forward to forgetting all the Struts I had to learn a couple years ago.



  • Java in in certain ways a fine language, and in other a less fine one. The love-vs-hate thing going on is, as almost always in such situations, misguided: Java, as any language, is a tool. Tools are generally speaking specialised (even when called "general-purpose" and suchlike) and more or less suitable for certain problems. That said, what I personally perceive as problems with Java is

    In contrast to f.i. C++ Java misses some language constructs. Most recognisable among these is multiple inheritance, without which it can be argued to be less than a fully object-oriented language, and operator overloading. To leave out MI means that many OO solutions cannot be implemented under Java. Leaving out operator overloading means that any object manipulation must go through method- and linked methods syntax and prohibits you from allowing natural and arithmetic syntactic manipulation of instances. The probable reason for leaving these out (especially MI) was likely to keep the compilation model simpler, but the utterly false and FUD-ish market reason was that "MI and operator overloading leads to error-prone and difficult-to-maintain" code, which is unsubstantiated rubbish.

    Compared to f.i. Ruby and Python (iirc) Java misunderstands the meaning of "fully Object-Oriented": Java claims to be fully object oriented in that everything in Java must be encapsulated within the brackets of a class construct, which among other things leads to the quite arbitrary and for beginners incredibly confusing placement of the main function inside the class. In a real object-oriented language everything manipulated is an object, but code can be written as functions - Ruby is the excellent example of this. Countrary, Java retains atomic data types, f.i. integers. This detracts from the aesthetics and principles of the language, leads to counter-intuitive and forced constructs as the placement of the main [i]method[/i] and wrapper classes for atomic data types.

    Java, which begun as a very focused and sleek design, has turned into a pincushion of a language, pointing in all directions at once. The focused concept has turned into a unwieldy behemoth.

    The previous point is exacerbated by that today it is principally unavoidable to write Java applications without incorporating multiple, often extrvagant numbers of, external frameworks of which you often only need a limited functionality. Java proliferates in packages and frameworks, and often turns the act of programming into one of code archaeology.

    Then we have the "portability" argument; Java is often called a "write once run everywhere" language, but a common criticism is that a better phrase would be "write once tune everywhere", reflecting that JVM implementations are anything but uniform and writing full-scale applications is in fact very involved and not thus not really platform-independent, albeit in a different way from in compiled languages.

    Lastly, Java is increasingly being used as the first language in programming education. This is a mistake due to several factors. Java is really confusing for beginners due to its arbitrary mix of paradigms and designs: object-orientation and atomics, and try to meaningfully explain the void public static main() inside a class for newbies in a lecture and you might understand. Secondly, starting to code in Java teaches you dangerous habits, among others acquiring resources without thinking about deallocating them and a certain wantonness and laxness to allocating resources and including external packages.



  • Why do people hate COBOL?

    And of all those who hate COBOL, how many even know what a COBOL program looks like?

     



  • @newfweiler said:

    Why do people hate COBOL?

    And of all those who hate COBOL, how many even know what a COBOL program looks like?

    C code:   c = a * b;

    COBOL: MULTIPLY A BY B GIVING C 

    The bad memories from 2nd year university COBOL class are flooding back.  Honestly, it's a really easy language to learn, but god it's just so strongly typed.

    I remember we did this one assignment in class.  Two different groups of people writing the same assignment in COBOL.  One was 2000 lines of code.  The other was 200 :)

    Back when we didn't have 1600x1200 32bit desktops, this was the most powerful "GUI" language there was, in my opinion.  You could do some pretty wicked things with just a little bit of code/configuration.  You know all of those point of sale screens you see with the old monochrome monitor, all in text mode?  You could whip up one of those in COBOL in no time.  Of course finding a good use for COBOL nowadays is pretty tough, other than maybe for a history class.


    And yes, I know people who are STILL actively programming in COBOL... sad as it is. 



  • @newfweiler said:

    Why do people hate COBOL?

    Because it sucks like hardly any other language sucks (Since I don't know ABAP in detail, I can't say for sure "like no other language sucks").

    Hardly any other language encourages the creation of copy-paste spagetti code with lots of global variables like COBOL does.

    It got better with COBOL-85, but since most COBOL programs are legacy programs, that doesn't help much.

     

     

    And of all those who hate COBOL, how many even know what a COBOL program looks like?

    In my case: Definitely yes, though fortunately I don't haven't had to write COBOL code for the last 18 years.

    The last COBOL code I've seen, about 4 years ago, was still spagetti code with lots of GOTOs and PERFORMs.


  • @Mikademus said:

    In contrast to f.i. C++ Java misses some language constructs. Most recognisable among these is multiple inheritance, without which it can be argued to be less than a fully object-oriented language, and operator overloading. To leave out MI means that many OO solutions cannot be implemented under Java. Leaving out operator overloading means that any object manipulation must go through method- and linked methods syntax and prohibits you from allowing natural and arithmetic syntactic manipulation of instances. The probable reason for leaving these out (especially MI) was likely to keep the compilation model simpler, but the utterly false and FUD-ish market reason was that "MI and operator overloading leads to error-prone and difficult-to-maintain" code, which is unsubstantiated rubbish.

     Just wondering, can you give me an example where multiple inheritance is really necessary and cannot be replaced by interfaces? I cannot think of any.
     



  • I am now deterred from attempting to become a Real Boy via Java.

    Fortunately, two helpful smurfs I know from another forum have smurfed me into the right direction for Ruby experimentation.



  • To me, Java is wonderland. C++ forces me to spend 90% of my time thinking about how, and not what to implement. Python is a nice hack, with better bindings to low level stuff, while still maintaining a nice high-level scripted feeling. On the other hand, Python doesn't give me type checking and feels generally less professional. C# is like Java, but is overly complicated. I don't like the massive use of redundant keywords. .NET generally is also nice, but gives you vendor locking. Badly. I respect Perl and love it, but it's not for everyday coding.

     Java gives me true power. You have heaps of great, free libraries, toolkits, make utilities (ant, maven), application servers (Jboss, Tomcat etc) and really nice IDE:s. I don't feel restricted while using Java. I know that there is almost always a solution to any possible upcoming problem, and that the solutions are almost always good (Enterprise level persistence, cache solutions, image manipulation, great GUI components (yes, i love Swing, it beats the crap out of .NET), great webservice support, you name it). You also have platform independence and can choose another language if you feel like it (JPyton, Scala, Groovy etc).

     The only negative side to this is partly speed (which is not really a problem since my general impression is that it's much easier to write good code in Java, compared to for example C++), and RIIA. RIIA is actually a bad problem, and requires a lot of redundant coding. The new trend with resource injection (SEAM etc), fixes this in a nice way though. So, all in all, Java rocks.

    Thats my five cents.
     



  • Things I don't like about Java:

     - EJBs and container-managed persistance. I think a lot of old hands are sticking with, or moving back to, session beans and POJOs (plain ol' Java objects). But, last I checked (which, admittedly was a few years ago), container vendors were pushing hard on how well their shit supported this stuff.

     - Giving up a "safe" container for speed. This can be a nice thing too, being able to choose when you want to shoot yourself in the foot, but doing something like tuning a hotspot jvm on a HPUX 11i box just to watch it core dump because one developer on one team wrote a bad recursion function can ruin your night.

     - CLASSPATH

     - It's everything to everyone. This is a blessing and a curse... but think about the choices you need to make when you start a project and, especially if you don't have a clear understanding of what's out there, it's too hard to get where you want to be... standard JSPs, struts? log4j, logkit? hibernate, the container's cmp? spring, pico? Plus all of the libraries at your disposal... don't get me wrong, I love the toolset, but, if I was approaching it as a novice to the language, there is a definate impedence to getting started.

     - Checked exceptions. Again, this can be a powerful thing once you understand it, but, in my opinion, it forces something about the runtime into the design contract that I don't like. And, again, it's a level of impedence that a beginner isn't going to appreciate.

    Things I like about Java:

     - All of the tools that have come out of the community... spring, struts, hibernate, ant, anthill, junit, log4j, maven.

    Now, honestly, I'm super-biased, but, I'm gradually moving to Ruby. I'd recommend looking into that language a bit more and comparing it against your C++ and Java experience. The biggest thing I like about Ruby, especially when you combine it with Rails or Camping, is the utter lack of impedence to start. It's a language that you can have going in four minutes on a clean machine and have a reasonably cool working example in another 10 minutes. It's a wonderful experience if you've never encountered a language like that before.



  • @bouk said:

    @Mikademus said:

    In contrast to f.i. C++ Java misses some language constructs. Most recognisable among these is multiple inheritance, without which it can be argued to be less than a fully object-oriented language, and operator overloading. To leave out MI means that many OO solutions cannot be implemented under Java. Leaving out operator overloading means that any object manipulation must go through method- and linked methods syntax and prohibits you from allowing natural and arithmetic syntactic manipulation of instances. The probable reason for leaving these out (especially MI) was likely to keep the compilation model simpler, but the utterly false and FUD-ish market reason was that "MI and operator overloading leads to error-prone and difficult-to-maintain" code, which is unsubstantiated rubbish.

     Just wondering, can you give me an example where multiple inheritance is really necessary and cannot be replaced by interfaces? I cannot think of any.

    Mixins. Java can't do them at all. Multiple inheritance is not the only mechanism for implementing mixins, but it is one of the simplest (and the one used in C++). Java users tend to end up abusing things like AspectJ to do it instead.
     



  • @webzter said:

    Things I don't like about Java:

     - EJBs and container-managed persistance. I think a lot of old hands are sticking with, or moving back to, session beans and POJOs (plain ol' Java objects). But, last I checked (which, admittedly was a few years ago), container vendors were pushing hard on how well their shit supported this stuff.

     - Giving up a "safe" container for speed. This can be a nice thing too, being able to choose when you want to shoot yourself in the foot, but doing something like tuning a hotspot jvm on a HPUX 11i box just to watch it core dump because one developer on one team wrote a bad recursion function can ruin your night.

     - CLASSPATH

     - It's everything to everyone. This is a blessing and a curse... but think about the choices you need to make when you start a project and, especially if you don't have a clear understanding of what's out there, it's too hard to get where you want to be... standard JSPs, struts? log4j, logkit? hibernate, the container's cmp? spring, pico? Plus all of the libraries at your disposal... don't get me wrong, I love the toolset, but, if I was approaching it as a novice to the language, there is a definate impedence to getting started.

     - Checked exceptions. Again, this can be a powerful thing once you understand it, but, in my opinion, it forces something about the runtime into the design contract that I don't like. And, again, it's a level of impedence that a beginner isn't going to appreciate.

    Things I like about Java:

     - All of the tools that have come out of the community... spring, struts, hibernate, ant, anthill, junit, log4j, maven.

    Now, honestly, I'm super-biased, but, I'm gradually moving to Ruby. I'd recommend looking into that language a bit more and comparing it against your C++ and Java experience. The biggest thing I like about Ruby, especially when you combine it with Rails or Camping, is the utter lack of impedence to start. It's a language that you can have going in four minutes on a clean machine and have a reasonably cool working example in another 10 minutes. It's a wonderful experience if you've never encountered a language like that before.

    I'll add a few likes and dislikes-

    Likes:

    -Some awesome GUIs with crippled GUI toolkits.

    -Reasonably fast application execution once the code has been cached.

    -really easy to see what is going on with source code; Easy to comment on.

    -Framework.

     

    Dislikes:

    -Crippled GUI toolkits.

    -Everything's a friggin class.

    -Doesn't do everything fast.

    -Fairly wordy language.

     -No stock IDE (although there are some really nice ones)

    As it pertains to your "working example in ten minutes" VB.NET has that sort of learning curve, especially for console apps. I'd never done a windows form before in my life and i had an alarm clock application written and working in about 30 minutes - the longest part was trying to figure out how to get an mp3 to play. Furthermore, i did a client/server chat client that allowed any copy of the application to act as a server and have multiple people connect in about 3 hours, most of that was spent looking up threading - another thing i had never intentionally done before.

    I dunno, both Java and VB.NET (and all common .NET dialects) have really nice documentation, and a widespread developer presence on the internet. if you really can't figure something out, you're probably approaching the problem wrong.

    I'll stick with .NET rather than java for now, and maybe look into ruby (i haven't heard anything really bad about it on these forums yet... i'm just wondering what it can do... isn't it a powerful scripting language, rather than a high level compiled language?)

    thanks for reading!



  • @Obfuscator said:

    To me, Java is wonderland. C++ forces me to spend 90% of my time thinking about how, and not what to implement. Python is a nice hack, with better bindings to low level stuff, while still maintaining a nice high-level scripted feeling. On the other hand, Python doesn't give me type checking and feels generally less professional. C# is like Java, but is overly complicated. I don't like the massive use of redundant keywords. .NET generally is also nice, but gives you vendor locking. Badly. I respect Perl and love it, but it's not for everyday coding.

     Java gives me true power. You have heaps of great, free libraries, toolkits, make utilities (ant, maven), application servers (Jboss, Tomcat etc) and really nice IDE:s. I don't feel restricted while using Java. I know that there is almost always a solution to any possible upcoming problem, and that the solutions are almost always good (Enterprise level persistence, cache solutions, image manipulation, great GUI components (yes, i love Swing, it beats the crap out of .NET), great webservice support, you name it). You also have platform independence and[b] can choose another language if you feel like it (JPyton, Scala, Groovy etc)[/b].

     The only negative side to this is partly speed (which is not really a problem since my general impression is that it's much easier to write good code in Java, compared to for example C++), and RIIA. RIIA is actually a bad problem, and requires a lot of redundant coding. The new trend with resource injection (SEAM etc), fixes this in a nice way though. So, all in all, Java rocks.

    Thats my five cents.
     

    Huge issue here: from my understanding, the thread was about Java-the-language, yet the part I bolded has nothing to do with java-the-language (e.g. Scala is clearly a superior Java. Nice, too, but they're not the language, they're at best part of java-the-platform, and extremely nonstandard at that)

    Other than that
    @Obfuscator said:

    requires a lot of redundant coding

    AFAIK everything in java requires a lot of redundant coding.



  • @GeneWitch said:

    I'll stick with .NET rather than java for now, and maybe look into ruby (i haven't heard anything really bad about it on these forums yet... i'm just wondering what it can do... isn't it a powerful scripting language, rather than a high level compiled language?)

    I'd say Ruby nicely nails the best of Perl and LISP (how it passes messages for method invocation smells a lot like SmallTalk as well). Check out the O'Reilly book 'Instant Rails' for an introduction to Rails (a domain-specific language built on top of Ruby) for a great jumpstart to the language.

    The super-cool things about Ruby / Rails.

     - Plugins. Want to make any class in your application taggable, just install and use the acts_as_taggable plugin. Want voting?

    class User
      acts_as_voter
    end

    class Post
      acts_as_voteable
    end

     - DB migration. You automatically create migration scripts for your DB. You use rake to migrate to previous versions if needed.

     - Scaffolding. You can tell Rails to auto-gen screens for you on the fly and then, as you override functionality, it ceeds control for those screens back to you. It's like what a lot of us do with autogen scripts but it happens transparently at runtime rather than statically at design time.

     Do you give up control with Rails? Yes, to a degree... you should spend the time to understand what's going on under the hood, but you don't need to, especially when you start. However, when you think about it, in many situations, getting something done, even if it's not perfect, is critical. Paul Graham talks about how, even though their dev language wasn't the fastest runtime, it was the key to their success because it abstracted so many concepts away they were easily able to stay ahead of the competition.... Ruby and Rails aren't the best tool for every situation, but they are great in some very critical areas. I've been using C# since RC1. I'd say that, given two weeks of just digging into Rails, I'd easily be much faster with Rails than I could ever hope to be with C#.



  • OMFG, did I read somebody say that C/C++ makes them THINK about what they're doing!? I'll call out a WTF on that! The role of a programmer is just that; come up with the best solutions possible and implement them. Java seems to let you do a little less thinking and tries to do some of the thinking for you. For example, garbage collection (freeing up unused objects and releasing their memory) is handled automatically in Java by the Java Virtual Machine (JVM). The problem with this is that garbage collection is out of your control. The JVM decides when it is appropriate to garbage collect (I assume based on how busy the system is and how much memory is consumed by unused objects) and it's possible for garbage collection to NEVER occur during the duration of your program (or so I'm told). Apparently there is a way to manually invoke garbage collection, with System.gc(), but I'm told that even this does not guarantee garbage collection.

    (I am a 3rd year college student graduating in about two months from a Computer Programmer/Analyst program. Do excuse me if I'm incorrect about something because I am still learning and doing my best to pick up on the right and best ways to do things - it is sometimes difficult to keep language constructs separate or to get the real facts on how things work)

    I first learned programming basics in high school with C/C++ and continued with C/C++ for the first year and a half of college. After graduating high school I learned that the high school had switched to teaching Java right after I graduated and that the "university" in town used ONLY Java to teach their students. I don't support this at all! Java is not the next C/C++, and I don't think C/C++ is going away anytime soon! At least I hope it isn't; it's still in my opinion the best and most powerful language around.

    Second year college sent Java my way and I hated it. Last semester we took our final college Java class and I did learned to like it, if only a little. I still prefer C/C++ and consider Java to be useful for small, multiplatform projects. It is a good concept, but in practice I agree that Java is missing some key concepts like multiple inheritance. I don't have very much experience 'porting' Java applications between platforms, though I have successfully executed a few of my applications in both Linux and Windows. I can say, however, that Java applications appear to perform better in Linux (shocker!) and that large applications (NetBeans IDE comes to mind) do not perform well in Windows at all. I remember my first Java class was taught in Windows using the NetBeans IDE and things like the "intelli-sense" feature took like 5 minutes to gather for even small classes (2 or 3 members/methods). During this time the application would stop responding. I'm not sure of the exact computer specs, but I think they had 1.0+ Ghz Intel Pentium 4 processors and at least 1 GB of RAM. Needless to say, the lag of NetBeans contributed to my dislike for Java.

    I agree that encapsulating the main() function in a class is weird, at least coming from C/C++. I also don't like Java's garbage collection and prefer having more control of resources used within my program. I also like the concept of pointers, which as I understand don't exist in Java. I don't think you can access memory addresses in Java, which as I undersatnd is what the & does in C/C++. Also I am extremely confused by Java's package system, which is essentially how you "include" other classes in your program (this is the basis for the reuseabilty).

    [code]imports java.io.Buffer;         // I don't even remember if that is a valid class, but the syntax is right.[/code]

    I found that writing GUI applications in NetBeans was a nightmare because of these dependant packages which I could never find in the system and couldn't figure out how to include them with my application. It was, therefore, a lot more difficult to release applications in Java... I literally couldn't figure out how to run them outside of the NetBeans IDE.

    C/C++ is nice because of the #include instruction which basically allows you to include libraries of code. Also you can link to static or dynamic binary libraries which can be located anywhere in the systems execution PATH.

    Obviously I am still an intermediate programmer, but in my experience Java does not live up to the hype.

    My interpretation of Java Pros:
    ======================

    - Multi-platform (usually).
    - Object-Oriented support (though maybe not complete).
    - ...There is probably more, such as the standard packages, but meh... That's all I'm willing to give it.

    My interpretation of Java Cons:
    =======================

    - Weird package system...
    - Lack of multiple-inheritance...
    - Weak garbage collection...
    - Lag due to an extra layer (being executed in a Virutal Machine inside the operating system instead of natively in the operating system)...
    - Confusing design...
    - One I just thought of now is lack of preprocessor instructions (which I don't think there are for Java)... For example, you can't #define things.

    In short, learn to use C/C++ (do your best to learn the right way and follow best practices) and when you're comfortable with that learn Java for the sake of knowing another language. C/C++ is far superior to EVERYTHING!



  • @GeneWitch said:

    Dislikes:

     -No stock IDE (although there are some really nice ones)

    I had that bias as well (my introduction to J2EE development came via wretched JBuilder).... but after using Eclipse for a couple years now, I gotta say it's an outstanding IDE.



  • @xtremezone said:

    {Stuff}

    You silly



  • @xtremezone said:


    [code]imports java.io.Buffer;         // I don't even remember if that is a valid class, but the syntax is right.[/code]


    Sorry about that... I just took a stab at using <squarebracket>code</squarebracket> to format it like code (like on allegro.cc) and it seems to have replaced spaces with &nbsp;... This is what I meant:

    imports java.io.Buffer;         // I don't even remember if that is a valid class, but the syntax is right.



  • @xtremezone said:

    @xtremezone said:

    [code]imports java.io.Buffer;         // I don't even remember if that is a valid class, but the syntax is right.[/code]


    Sorry about that... I just took a stab at using <squarebracket>code</squarebracket> to format it like code (like on allegro.cc) and it seems to have replaced spaces with &nbsp;... This is what I meant:

    imports java.io.Buffer;         // I don't even remember if that is a valid class, but the syntax is right.

     And of course the syntax is *NOT* right.. Should be...

    /*
     *    (This time I just went with "namespace", "package", and "class" to avoid
     *    getting it wrong - I THINK that is right now)
     */
    import namespace.package.class;



  • @xtremezone said:

    /
     
        (This time I just went with "namespace", "package", and "class" to avoid
         getting it wrong - I THINK that is right now)
     
    /
    import namespace.package.class;

    There is no "namespace" just a package name. Common practice is to use an inverted domain name to avoid collisions. "class" is a restricted keyword, i.e. it can't be the class name and instead is used to reference the reflection interface for a class, i.e.

    System.out.println( someObject.class.getClass() );
    or
    Class.forName("java.lang.String").newInstance();
     

    So you're on the right track, but that package/class name wouldn't work.

    import java.io.*; // there you go 



  • @xtremezone said:

    At least I hope it isn't; it's still in my opinion the best and most powerful language around.

    C/C++ is far superior to EVERYTHING!

    You don't know what you're talking about and putting C and C++ together as if that was a single language shows it. Stop it, it's getting very silly

    Additionally:

    @xtremezone said:

    The role of a programmer is just that; come up with the best solutions possible and implement them.
    Java seems to let you do a little less thinking and tries to do some of the thinking for you.

    No. Java, like many other high-level languages, takes care of the nitty-gritty job (memory management for example) so that you can focus on solving the problem. Java doesn't "try to do some of the thinking for you", it helps you spend more time thinking about the problem instead of thiking about how to implement the problem.



  • How unusual, an dispassionate discussion about programming languages turns into the beginning of a Holy War. 

    @bouk said:

    @Mikademus said:

    In contrast to f.i. C++ Java misses some language constructs. Most recognisable among these is multiple inheritance, without which it can be argued to be less than a fully object-oriented language, and operator overloading. To leave out MI means that many OO solutions cannot be implemented under Java. Leaving out operator overloading means that any object manipulation must go through method- and linked methods syntax and prohibits you from allowing natural and arithmetic syntactic manipulation of instances. The probable reason for leaving these out (especially MI) was likely to keep the compilation model simpler, but the utterly false and FUD-ish market reason was that "MI and operator overloading leads to error-prone and difficult-to-maintain" code, which is unsubstantiated rubbish.

     Just wondering, can you give me an example where multiple inheritance is really necessary and cannot be replaced by interfaces? I cannot think of any.

    Welcome to the [url=http://en.wikipedia.org/wiki/Turing_tarpit]Turing Tarpit[/url].

     

    @Obfuscator said:

    To me, Java is wonderland. C++ forces me to spend 90% of my time thinking about how, and not what to implement.

    @xtremezone said:

    OMFG, did I read somebody say that C/C++
    makes them THINK about what they're doing!? I'll call out a WTF on
    that! The role of a programmer is just that; come up with the best
    solutions possible and implement them. Java seems to let you do a
    little less thinking and tries to do some of the thinking for you.

    @masklinn said:

    Java, like many other high-level languages, takes care of the
    nitty-gritty job (memory management for example) so that you can focus
    on solving the problem. Java doesn't "try to do some of the
    thinking for you", it helps you spend more time thinking about the
    problem instead of thiking about how to implement the problem.

    First, Obfuscator, saying that Java frees you from thinking sounds very, very bad. If you do not want to think then stop coding immediately so we won't have to see you code here or, worse, have to maintain it. Taken as you probably meant it, though, it only sounds as you are a pretty bad C++ coder.

    Masklinn, that "Java takes care of the nitty-gritty" in fact means that the language restricts the problem-space it can extend over and represent. Thus, that you find it easier to handle Java is because there are fewer possible implementations of solutions to fewer problems to address. Probably, for you Java is the intersection of a set of problems you're primarily involved with and a language suitable for that set, which makes it seem as easier and more productive to you in your particular situation. Do not fall prey to the fallacy that you're representative.

    Both Java and C++ are tools, and in being different tools are suitable for different things. Speaking of better or worse languages only makes a statement about the speaker. I use both languages extensively, and use them for different things.
    Nonetheless, I express myself better in C++ and C++, objectively possessing greater genericity and more language facilities than Java, allows you to
    represent and manipulate a greater set of possible problems then Java. This greater genericity comes at the price of an arguably higher complexity, but also with greater power. If you don't want or need that power then other languages might be more appropriate. However, that does not necessarily mean Java, in fact, for almost anything Java is used to atm Ruby is probably more suitable. Other languages running on the JVM is Nice, and especially [url=http://www.scala-lang.org/]Scala[/url], which retains full inter-operability with Java libraries while fixing most of the bumps in Java's aesthetics, syntax and missing language capabilities. 

    As Bjarne said, "There are two types of languages, those that everyone argues about and those that no-one use". That the Java and C++ camps often battle is because they're two of the larger languages and they represent two quite diametrically opposing philosophies.

    • C++ is a language based on freedom. It is multi-paradigm because it will not decide for the programmer what problems should be addressed or the best solution to them. C++ trust the programmer to always know what is best.
    • Java is a language that, like Pascal, is based on restricting freedom to help the programmer avoid certain mistakes. Java does not trust the programmer. The consequence is that while some tasks are streamlined other are made much harder, convolute or impossible.



  • @Nandurius said:

    There is no "namespace" just a package name.

    "In the Java programming language, the idea of a namespace is embodied in Java packages. All code belongs to a package, although that package need not be explicitly named. Code from other packages is accessed by prefixing the package name before the appropriate identifier, for example class String in package java.lang can be referred to as java.lang.String (this is known as the fully qualified class name). Like C++, Java offers a construct that makes it unnecessary to type the package name (import). However, certain features (such as reflection) require the programmer to use the fully qualified name." -- <http://en.wikipedia.org/wiki/Namespace_(computer_science)> (Note that thedailywtf doesn't appear to recognize the whole address)

    Wikipedia would have to disagree. Correct me if I'm wrong, but that paragraph suggests that "java" is an example *namespace*, "java.lang" is an example package, and "java.lang.String" is an example class. If I'm wrong maybe you should correct that article. ;)

    @Nandurius said:

    "class" is a restricted keyword, i.e. it can't be the class name and instead is used to reference the reflection interface for a class

    Sorry, I never meant it as an existing class, I meant it as a "label" for what would generally go there...

    @masklinn said:

    You don't know what you're talking about and putting C and C++ together as if that was a single language shows it.

    "Bjarne Stroustrup developed C++ (originally named "C with Classes") in 1983 at Bell Labs as an enhancement to the C programming language. Enhancements started with the addition of classes, followed by, among other features, virtual functions, operator overloading, multiple inheritance, templates, and exception handling." -- <http://en.wikipedia.org/wiki/C++> (Note that thedailywtf doesn't appear to recognize the whole address)

    I never said that C and C++ were the same language, I simply said...

    @xtremezone said:

    C/C++ is far superior to EVERYTHING!

    Try searching Google for C/C++. I'm not the only one who refers to them as a single entity, even though they are not the same. C does not support object-oriented programming, and probably a new other things. Correct me if I'm wrong, but C libraries are compatitble with C++ compilers, aren't they? If "compilers" is too specific for you than how about the C++ standards/specification? Does C not fall in there anywhere?

    @masklinn said:

    No. Java, like many other high-level languages, takes care of the nitty-gritty job (memory management for example) so that you can focus on solving the problem.

    When your application doesn't perform well on a user's computer you have a whole new problem. Memory management is not 100% left to the developer in C/C++, however, he does have a lot more control than that of a Java developer; at least from what I have seen.

    ...

    All you had to say was that you like Java, state your pros and cons verses that of other languages you've used. Bashing me doesn't change what Java is.



  • Quoting Wikipedia as factual is silly.

    To break out the pendantic tea-party, it should be "C and C++ are far superior to EVERYTHING". Otherwise, you come off as treating them as one entity.

    Referencing what something started as 20+ years ago as comparison to argue your case now is silly.

    I like nazi's.. not them as people, mind you, but it's a funny-looking word.



  • @webzter said:

    Quoting Wikipedia as factual is silly.

    You're right and I didn't. Hense...

    @xtremezone said:

    If I'm wrong maybe you should correct that article. ;)

    Wikipedia is a Web encyclopedia written by anyone that wants to contribute. The point is to do your best to be accurate and if somebody else comes along and sees a mistake they should correct it. To trust Wikipedia as a source of accurate information is definitely not silly. You can't take it as 100% correct though either.



  • @xtremezone said:

    I don't support this at all! Java is not the next C/C++, and I don't think C/C++ is going away anytime soon! At least I hope it isn't; it's still in my opinion the best and most powerful language around.

    I guess you have never used LISP/Ruby/Perl/ML/Smalltalk if you think that C++ is the most powerful language around.  These languages allow the programmer to do more in a day that he can do in a week with C or C++.  Unless of course by powerful you meant closest to the hardware, and able to do the most with memory manipulation, inline asm and efficiency tweaking.  In that case you are most certainly wrong!  If that is what you are looking for you should just use assembly.  Of course that is just a round about way of generate machine code so you should just write that! 

     

    @xtremezone said:

     In short, learn to use C/C++ (do your best to learn the right way and
    follow best practices) and when you're comfortable with that learn Java
    for the sake of knowing another language. C/C++ is far superior to
    EVERYTHING!

    You need to learn another language (and not just for the sake of knowing another language).  C/C++ is NOT superior to everything.  Please stop making yourself look bad.



  • @Mikademus said:

    Masklinn, that "Java takes care of the nitty-gritty" in fact means that the language restricts the problem-space it can extend over and represent. Thus, that you find it easier to handle Java is because there are fewer possible implementations of solutions to fewer problems to address.

    Erm... I was only talking about the issue of memory management here, I'm not interested in using java unless I have to.

    @Mikademus said:

    Probably, for you Java is the intersection of a set of problems you're primarily involved with and a language suitable for that set, which makes it seem as easier and more productive to you in your particular situation. Do not fall prey to the fallacy that you're representative.

    Wrong presumption, factually for me Java is the intersection of Pain and Suffering.

    @xtremezone said:

    @Nandurius said:

    There is no "namespace" just a package name.

    "In the Java programming language, the idea of a namespace is embodied in Java packages. All code belongs to a package, although that package need not be explicitly named. Code from other packages is accessed by prefixing the package name before the appropriate identifier, for example class String in package java.lang can be referred to as java.lang.String (this is known as the fully qualified class name). Like C++, Java offers a construct that makes it unnecessary to type the package name (import). However, certain features (such as reflection) require the programmer to use the fully qualified name." -- <http://en.wikipedia.org/wiki/Namespace_(computer_science)> (Note that thedailywtf doesn't appear to recognize the whole address)

    Wikipedia would have to disagree. Correct me if I'm wrong, but that paragraph suggests that "java" is an example *namespace*, "java.lang" is an example package, and "java.lang.String" is an example class. If I'm wrong maybe you should correct that article. ;)

    You're wrong, it's just that you can't read. "java" is a package and that package is a namespace. Likewise, "java.lang" is another package and that other package is yet another namespace, and java.lang.String is a class, which can also be considered yet-another-namespace.

    You only had to read the first paragraph of the page you linked and you managed to fail... seriously, stop...

    @xtremezone said:

    When your application doesn't perform well on a user's computer you have a whole new problem.

    And you start worrying about it at that point, unless the harsh performance issues were foreseeable.

    You know, it's that whole Correctness First stuff.

    @tster said:
    @xtremezone said:

    I don't support this at all! Java is not the next C/C++, and I don't think C/C++ is going away anytime soon! At least I hope it isn't; it's still in my opinion the best and most powerful language around.

    I guess you have never used LISP/Ruby/Perl/ML/Smalltalk if you think that C++ is the most powerful language around.

    Can we add Python, Haskell, Erlang, D, Factor and Self to the list?



  • @masklinn said:

    @Mikademus said:

    Probably, for you Java is the intersection of a set of problems you're primarily involved with and a language suitable for that set, which makes it seem as easier and more productive to you in your particular situation. Do not fall prey to the fallacy that you're representative.

    Wrong presumption, factually for me Java is the intersection of Pain and Suffering.

    LOL!

    Thanks for a genuine guffaw, they're too far between! Honestly, that was a great answer!! :D



  • @Mikademus said:

    How unusual, an dispassionate discussion about programming languages turns into the beginning of a Holy War. 

    @Obfuscator said:

    To me, Java is wonderland. C++ forces me to spend 90% of my time thinking about how, and not what to implement.

    First, Obfuscator, saying that Java frees you from thinking sounds very, very bad. If you do not want to think then stop coding immediately so we won't have to see you code here or, worse, have to maintain it. Taken as you probably meant it, though, it only sounds as you are a pretty bad C++ coder.

     Hmm, seems like it became quite obvious that English is not my first language ;). What I meant was that I can spend more time designing my systems when using Java. That's partly because I have less experience with C++ (1 year working and a couple of university courses), but mainly because its more tedious work implementing stuff. I don't really like having to cope with memory management and compiler quirks all the time. I think that C++ is too verbose and offers way too many obscure constructs. I don't want to spend my time writing neverending method definitions like

    template<typename t> const &t namespace::class::method(const argtype &a1, argtype2 @Mikademus said:

    How unusual, an dispassionate discussion about
    programming languages turns into the beginning of a Holy War. 

    [quote
    user="Obfuscator"]To me, Java is wonderland. C++ forces me to spend 90%
    of my time thinking about how, and not what to implement.

    First,
    Obfuscator, saying that Java frees you from thinking sounds very, very
    bad. If you do not want to think then stop coding immediately so we
    won't have to see you code here or, worse, have to maintain it. Taken
    as you probably meant it, though, it only sounds as you are a pretty
    bad C++ coder.[/quote]

     Hmm, seems like it became quite obvious
    that English is not my first language ;). What I meant was that I can
    spend more time designing my systems when using Java. I don't need as much time implementing the solutions as if I was using C++. That's partly
    because I have less experience with C++ (1 year working and a couple of
    university courses), but mainly because its more tedious work
    implementing stuff. I don't really like having to cope with memory
    management and compiler quirks all the time. I think that C++ is too
    verbose and offers way too many obscure constructs. I don't want to
    spend my time writing neverending method definitions like

    template<typename t> const t& namespace::class::method(const argtype &a1, const argtype2 &a2) const  {...} or whatever...

    Neither do I feel compelled to write copy constructors, destructors and assignment operations, remember all the consts, fight the templating system, pass array lengths around or anything else like that UNLESS I NEED TO.

    I use C++ fairly often, but only when I really feel like the performance gain is worth the hassle. Back in the days, I hacked around in borland C++, and back then it was the shit :). I just feel like there are soo many good alternatives to all that by now, so I only use C++ when i need to. This is probably going to start a flame war, but i feel that C++ smells like premature optimization ;)

    Anyways, with boost and the std library, C++ has got some pretty cool and powerfull stuff, I'll agree on that. However, Java is more OO in my opinion, and that has taught me the importance in design, rather than relying on language features.


     


     



  • @masklinn said:

    @tster said:
    @xtremezone said:

    I don't support this at all! Java is not the next C/C++, and I don't think C/C++ is going away anytime soon! At least I hope it isn't; it's still in my opinion the best and most powerful language around.

    I guess you have never used LISP/Ruby/Perl/ML/Smalltalk if you think that C++ is the most powerful language around.

    Can we add Python, Haskell, Erlang, D, Factor and Self to the list?

     

    Sure..  I just didn't want to make a long list and make it look like it was the definitive list...  THere are certainly more. 



  • @Obfuscator said:

     Hmm, seems like it became quite obvious that English is not my first language ;). What I meant was that I can spend more time designing my systems when using Java. That's partly because I have less experience with C++ (1 year working and a couple of university courses), but mainly because its more tedious work implementing stuff. I don't really like having to cope with memory management and compiler quirks all the time. I think that C++ is too verbose and offers way too many obscure constructs. I don't want to spend my time writing neverending method definitions like

    template<typename t> const &t namespace::class::method(const argtype &a1, argtype2

    Neither do I feel compelled to write copy constructors,
    destructors and assignment operations, remember all the consts, fight
    the templating system, pass array lengths around or anything else like
    that UNLESS I NEED TO.

    Lacking proper templates is, imo, one of Java's most serious drawbacks. Destructors you miss because Java has no RAII, which can be argued to be another serious drawback since it restricts Java from being applicable to certain problems, or complicates addressing them. As for arrays, you should stay away from them, unless necessary (very rare) in BOTH Java and C++.

    i feel that C++ smells like premature optimization ;)Anyways,
    with boost and the std library, C++ has got some pretty
    cool and powerfull stuff, I'll agree on that. However, Java is more OO in my opinion, and that has taught me the importance in design, rather than relying on language features.

    That Java seems "more OO" for you is probably because it might appear a bit "cleaner" or "tidier" to you. However Java is actually less OO than C++. C++ has more OO facilities than Java, while Java is a single-paradigm language that force you to code in a way that appears OO. However, neither Java nor C++ are fully Object-Oriented languages, make no mistake. If you want that you'd have to go to Python or Ruby,  I'd also like to recommend you to look up Scale, which is a fully OO-conforming implementation based on Java that runs on the JVM with full Java-interoperability.



  • My dislikes of Java, which are those of others posting here as well I see:

    - Forcing you to declare throws clauses. Apart from being the cause of '... throws Exception' WTFs as one of the earlier posters is in danger of heading towards, it's just a major irritation, and sometimes actually stops you doing what you want (e.g. allowing an exception to ripple all the way up to Main() where you can display an error message and get out).

    - Swing. You either love it or hate it, from what I hear, and I hate it.

    - The outrageous verbosity of your code if you do things the Right Way. They deprecated a lot of the less verbose stuff from 1.0, like Component.hide().

    - The standard library just seems very fragmented to me, I can never find anything.

    - GUI applications (which is what we all use most of the time) are slow to start and slow to paint, and don't fit in with other apps on any system.

    I was one of those who jumped on the Java bandwagon back in 1995 or 1996. It had the potential to be a great language - but it never quite made it and now it's stuck in the legacy code bog. I've jumped to C# and am loving it - hopefully Mono will become mainstream enough that C# apps can be thought of as genuinely cross-platform.



  • @Mikademus said:


    That Java seems "more OO" for you is probably because it might appear a bit "cleaner" or "tidier" to you. However Java is actually less OO than C++. C++ has more OO facilities than Java, while Java is a single-paradigm language that force you to code in a way that appears OO. However, neither Java nor C++ are fully Object-Oriented languages, make no mistake. If you want that you'd have to go to Python or Ruby,  I'd also like to recommend you to look up Scale, which is a fully OO-conforming implementation based on Java that runs on the JVM with full Java-interoperability.

    Yes, you're right. I feel that by not introducing too many special constructs, Java teaches design patterns in a nice way. My first encounter with the observer pattern was through learning event propagation in Swing. Same with delegate, factory, builder an many more. I think that the class library is very nicely designed and while not perfect is still one of the best API:s i've seen (just compare Java Collections with .NET). I think that the C++ standard library depends a bit too much on templating and that,IMHO, produces way too wierd compiler errors which are almost impossible to decipher.

    You say that Java lacks templating, but Java has got Generics, and so far I have encountered no situation when that wasn't enough. RAII is, as i mentioned earlier, is a really serious problem, which has been address by extensive use of resource injection and/or AOP, which are suboptimal solutions. So yes, having stack variables destructing when out-of-scope or simulating something like that would be great!

    As far as OO goes, I'm not an expert, but in my opinion non-OO things like exposing basic data types really helps in certain situations.  As i said in my first post, i quite like Python, but it lacks other things, such as compile-time type checking. I think Java is a good compromise.

    I'll look into scala, thanks for the tip! And I'm not a fanatic, I'd rather have a serious discussion with you guys. I really don't understand why people here hate Java so much ;)

     


     



  • @Obfuscator said:

    I feel that by not introducing too many special constructs, Java teaches design patterns in a nice way.

    Fair enough. Just remember that by lacking some critical OO (and other) language mechanisms not all (of the basic set of) design patterns can be, or at least easily, efficiently, elegantly or tidily, be implemented in Java.

    I think that the C++ standard library depends a bit too much on templating and that,IMHO, produces way too wierd compiler errors which are almost impossible to decipher.

    Yes, one of the classic problems of C++ - that it is near impossible to generate truly meaningful error messages from a standard library external to the language core. On the other hand, having it (1) external and (2) templated means that the STL is portable (and you even have a choice of STL implementation IF you wish!) and  there will be no code redundancy as well as code optimised on a per-compilation base, which is very slick!

    You say that Java lacks templating, but Java has got Generics, and so far I have encountered no situation when that wasn't enough.

    Generics is not templates, it is only a very limited portion of templates. It means Java's genericity is limited to "containers-or-type-T", which is the simplest and least powerful (though often the most usable) usage of code templating, while to do anything similar to metaprogramming we have to go through reflection or aspects, which makes for code of such esoterics that C++ template error messages might seem clear prose.

    As far as OO goes, I'm not an expert, but in my opinion non-OO things like exposing basic data types really helps in certain situations.

    Well, yes, but speaking from a teaching perspective (I teach Java to beginners now and then) all those "specials" and "impurities" for performance reasons or for aesthetic considerations makes it a strange beast for the neonates, and may create problems, not only for the newblars. That atomic types cannot be returned like objects etc not only breaks symmetry and intuition but also generic code design (though autoboxing helps). Further, one doesn't have to give away the one to acheive the other, as Ruby and Scala has proved (and for that matter returning references in C++).

    I really don't understand why people here hate Java so much ;)

    It is a clash of ideologies; reduced to a rhetorical core, it is the hacker mindset (C++; control and freedom) versus the user mindset (Java; "Make as many choices for me as possible", "I turn the key and it goes"). Pushing it to the extreme for illustration, it isn't strange that these two diametrically opposed world-views cannot find much common ground. Except in hating VB (which even I admit is fair game for loathing).



  • @Mikademus said:

    It is a clash of ideologies; reduced to a rhetorical core, it is the hacker mindset (C++; control and freedom) versus the user mindset (Java; "Make as many choices for me as possible", "I turn the key and it goes"). Pushing it to the extreme for illustration, it isn't strange that these two diametrically opposed world-views cannot find much common ground. Except in hating VB (which even I admit is fair game for loathing).

     

    http://www-users.cs.york.ac.uk/susan/joke/cpp.htm ;) 



  • @Bob Janova said:

    - GUI applications (which is what we all use most of the time) are slow to start and slow to paint, and don't fit in with other apps on any system.

     

    I guess you have never heard of UIManager.setLookAndFeel



  • @tster said:

    I guess you have never heard of UIManager.setLookAndFeel

    Ah yes, another of the dumber parts of the java standard library. I mean -  UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()), what sort of utter BASTARD names functions like that? It's like the opposite of Hungarian notation. I keep expecting to find stuff like this lurking somewhere:

    int intNumberStorageVariable;

    String[] strArrayOfStringsStorageVariable;
     



  • @asuffield said:

    Ah yes, another of the dumber parts of the java standard library. I mean -  UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()), what sort of utter BASTARD names functions like that?

    I fail to see the problem here. getSystemLookAndFeelClassName does exactly what the name says, it delivers the class name of the system's (native) look-and-feel. The "ClassName" part of the method name makes clear that this will return a string and not the LookAndFeel object itself.

     

     



  • @asuffield said:

    @tster said:

    I guess you have never heard of UIManager.setLookAndFeel

    Ah yes, another of the dumber parts of the java standard library. I mean -  UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()), what sort of utter BASTARD names functions like that? It's like the opposite of Hungarian notation. I keep expecting to find stuff like this lurking somewhere:

    int intNumberStorageVariable;

    String[] strArrayOfStringsStorageVariable;
     

     

    Because it stands out so badly in all the other Hungarian notation in the JDK? 



  • @Obfuscator said:

    Yes, you're right. I feel that by not introducing too many special constructs, Java teaches design patterns in a nice way.

    The issue I have with this declaration is the fact that you consider design patterns good thing. See, Java teaches design patterns but in other languages what you get by introducing design patterns is baked into the language or so simple to attain that you don't even think of it as a pattern, it's just natural behaviour.

    The way I see it, most low level design patterns (i'm not talking about, say, MVC here) are "common solutions to work around the shortcomings of the language", the more design patterns you need to use (or you can recognize, or whatever) and the lower level they are, the less productive (from a programmer standpoint) and high level your language is.

    Remember, in the 70s Object Orientation was a C design pattern...



  • @tster said:

    @masklinn said:
    @tster said:

    I guess you have never used LISP/Ruby/Perl/ML/Smalltalk if you think that C++ is the most powerful language around.

    Can we add Python, Haskell, Erlang, D, Factor and Self to the list?

    Sure..  I just didn't want to make a long list and make it look like it was the definitive list...  THere are certainly more. 

    Well you're right that I haven't used that long list of languages (I believe I said I am a young programmer). From what I can tell most of the languages listed are scripting languages, which generally speaking suffer from performance loss like that of Java. I'm not saying that they aren't powerful. Nor did I say that Java was not powerful.

    The fact is that processing power is limited and you simply cannot give the BEST solution from scripted or byte-coded applications. It might require more work on the programmer's part to do, but it seems that a well written application in C/C++ will result in a much faster application than a functionally equivalent written in any of the scripting languages you have named.

    I'm referring to the end result: the application from a user's perspective. Writing the application is all good; fun for programmers, etc., etc. However, without the user the application isn't really worth anything. I, myself, as a user, hate waiting for slow applications to complete a task. I wish applications written in scripted or byte-coded languages were written in a compiled language and the application was built into a native binary so I wouldn't have to wait as long. (And for the record I most enjoy writting in C/C++... No other language that I have used is as fun to write -- C++, Java, VB6, VBA, VB .NET, VBScript, JavaScript, PHP, HTML/XHTML/XML, ActionScript, Tcl).

    RAD languages/tools provide the programmer with an advantage when developing fast solutions to small problems, but on a much larger scale performance needs to be considered.

    The only two languages in the above lists that are compiled (from what I found) are ML and D.

    ML has a short Wikipedia article and I've never heard of it until now. I can't say how useful it is, but looking at the small syntax example it looks like a nightmare. The small article suggests that it's not a very popular language. In fact, a google search for ML programming returned top ten results with dates in the 90s.

    D appears to be the result of taking the good of C++ and adding to it lessons learned in C#, Java, and Eiffel. Sounds like a great language, but it also sounds like a derivative of C++. Shock. I'm sure it's a very powerful language, but it sounds like it's trying to sugar-coat C++ (even though it is apparently a separate language). The Wikipedia article on compiled languages appear to group it amoung the C family of languages (regardless of the fact that they are not actually C).

    @Wikipedia: Compiled languages said:

  • C
  • The truth is that C has been around for over 30 years and is still a very popular language. The majority of open-source projects that I have used have been written in C or C++, which means they are still very much used today. C has influenced many languages such as C++, C#, Objective-C, Java, Perl, PHP, and D.

    I have given my opinion, and I think I made it clear that I am a young programmer, so take it as you wish. Stop bashing me for giving my opinion! And stop saying "silly"... It's silly. C/C++ lets the programmer do the programming which is what I want from a language. I compare everything I have used with C++ and I always find myself wishing the other languages were more C-like.

    I don't like programming approaches that look for the quickest solution to problems. The right solution is usually nowhere in sight. I known guys from college with this mind state and I'm confident you will see some of their code on this site before long.



  • Well, that's interesting... extremely stupid, but interesting. There you go, I'm not calling your opinion silly, just stupid. Is that better?

    C++ isn't the perfect language for every domain. Not everyone is writing the next killer OS. I'd love to see how efficient you are as a programmer writing a proof of concept website versus a proficient Ruby developer. My money is on the Ruby person.

    Just think about your stance for a minute... you don't like the quickest solution to a problem. Well, I sure as hell hope you end up working for my competition. If the right solution is nowhere in sight, then your best bet is to fail quickly and move on to the next possible solution. Do you honestly think taking longer to build a system is going to magically keep you from being on the wrong path? No! It just means you wasted even more time on the wrong path.

    I'm going to have to refer you to Paul Graham. Like him or not, he did succeed at what he set out to do, admirably. He also attributes the success of his product, ViaWeb, to the technology it was built on... a domain-specific language built on top of Lisp, if I remember right. And, he'll be the first to tell you that, as a language, it was horribly inefficient as far as run-times go but it allowed them to respond to their competition quickly. In fact, in many instances, they were able to have new features released on their site within an hour or two of their competitor's press releases.

    This would be a good place to start: http://www.paulgraham.com/hundred.html, then go here: http://www.paulgraham.com/popular.html. Go back and follow other links off of the hundred year essay. Then, go install Ruby on Rails and build a website. Heck, try out the very, very beta Ruby editor, built in Ruby... see how "slow" it is on your machine. You have no credibility in this discussion until you've at least experienced life a little.


Log in to reply
 

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.