Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. Non-programming question about Java...

Non-programming question about Java...

Scheduled Pinned Locked Moved The Lounge
questioncsharpjavalearning
74 Posts 33 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J jschell

    Naerling wrote:

    I've heard some colleagues and friends say that Java is absolutely terrible, so I wasn't to happy about having to use Java.

    Certainly if there was no context with those comments then I would dismiss them as at best ignorant and and worse it might indicate that the commenter isn't very smart.

    Naerling wrote:

    and the Namespace Imports (using),

    Huh? Java has import. And in terms of syntax I haven't seen any difference between those two.

    Naerling wrote:

    Am I missing something or is Java just not the horrible language I was told it is?

    Without a context it doesn't mean anything. Various preferences that I can note. - I like the power of C++ templates, memory management and pointers (emphasizing the power here.) - C# app domains are a poor substitute for Java's class loaders. I have yet to see any way in which they are better and quite a few ways in which they are worse. - I like C# properties. - I dislike the ease of C# Linq especially since it can lead to connection leaks (which I have seen.) - I dislike the C# exception handling versus Java. With C# one MUST capture exceptions in every thread or it will take down the application. And there is no equivalent global catch unlike Java. - I like C#/Java null reference exception, array boundary checks and various other exceptions that originate from programming bugs and which C++ merely fails. - In general I prefer the app to handle memory for me in C#/Java (even despite liking the control in C++.) - I like how fast I can put together a simple tool, especially parser/interpreters in Perl. The same thing would take longer and with more code in C#, Java and C++.

    Sander RosselS Offline
    Sander RosselS Offline
    Sander Rossel
    wrote on last edited by
    #60

    jschell wrote:

    Huh?
     
    Java has import. And in terms of syntax I haven't seen any difference between those two.

    As far as I understood the difference would be the following: C#:

    // Only one using statement for the entire namespace.
    using System.Collections.Generic;

    public class SomeClass
    {
    List<String> someList;
    Dictionary<String, String> someDict;
    IEnumerable<Object> ienum;
    }

    And now C#, but using the 'Java mindset'.

    // Every class needs another using statement.
    using System.Collections.Generic.List<T>;
    using System.Collections.Generic.Dictionary<TKey, TValue>;
    using System.Collections.Generic.IEnumerable<T>;

    public class SomeClass
    {
    List<String> someList;
    Dictionary<String, String> someDict;
    IEnumerable<Object> ienum;
    }

    It tends to make the list of using statements quite long :)

    jschell wrote:

    Various preferences that I can note. etc...

    Nice! I'm not very familiar with C++ (but I do want to learn it someday). I don't know Perl at all (just by name). Is it worth the trouble to learn?

    It's an OO world.

    public class Naerling : Lazy<Person>{
    public void DoWork(){ throw new NotImplementedException(); }
    }

    J 2 Replies Last reply
    0
    • B BobJanova

      Lambdas and Linq queries certainly don't have 'a very minimal place in code' in any vaguely up to date .Net development. You are correct about not taking on every cool piece of technology but those language features have made it to the mainstream.

      Not to mention of course that "less code" has almost zero impact on the cost of developing software.

      I really disagree with that. More code means more time to maintain it, more familiarisation time when bringing new people onto the project, more difficulty in understanding the whole system and more difficulty tracking down the right place to change something when modifying a program. That's why we use high level languages and frameworks in the first place!

      J Offline
      J Offline
      jschell
      wrote on last edited by
      #61

      BobJanova wrote:

      Lambdas and Linq queries certainly don't have 'a very minimal place in code' in any vaguely up to date .Net development.

      So in your significant business applications what percentage of the entire code base do those idioms represent? And what percentage do they represent if boiler plate database API code is not included (since of course with code generation and/or frameworks all of that can be removed as a maintenance item)?

      BobJanova wrote:

      More code means more time to maintain it

      Nope. If your code base is 1000% bigger than mine and our products do the same thing then I would in fact expect that your maintenance cost is higher than mine. However there is no way that language syntax is going to produce that differential. However poor programming can and does. On the other hand a differential of 1% or less is not going to have any measurable impact on maintenance. And would be lost in the noise.

      BobJanova wrote:

      more familiarisation time when bringing new people onto the project, more difficulty in understanding the whole system and more difficulty tracking down the right place to change something when modifying a program.

      All of those same things happen when there is a muddled design, muddle requirements/business needs, code grown re-actively (rather than planned), mixed language usage (even when justified), no process control, etc, etc, etc. And since it is more likely that any or all of those things will occur in the average shop it is going to be flat out impossible to measure the impact that any single language feature would have on actual maintenance costs.

      1 Reply Last reply
      0
      • Sander RosselS Sander Rossel

        jschell wrote:

        Huh?
         
        Java has import. And in terms of syntax I haven't seen any difference between those two.

        As far as I understood the difference would be the following: C#:

        // Only one using statement for the entire namespace.
        using System.Collections.Generic;

        public class SomeClass
        {
        List<String> someList;
        Dictionary<String, String> someDict;
        IEnumerable<Object> ienum;
        }

        And now C#, but using the 'Java mindset'.

        // Every class needs another using statement.
        using System.Collections.Generic.List<T>;
        using System.Collections.Generic.Dictionary<TKey, TValue>;
        using System.Collections.Generic.IEnumerable<T>;

        public class SomeClass
        {
        List<String> someList;
        Dictionary<String, String> someDict;
        IEnumerable<Object> ienum;
        }

        It tends to make the list of using statements quite long :)

        jschell wrote:

        Various preferences that I can note. etc...

        Nice! I'm not very familiar with C++ (but I do want to learn it someday). I don't know Perl at all (just by name). Is it worth the trouble to learn?

        It's an OO world.

        public class Naerling : Lazy<Person>{
        public void DoWork(){ throw new NotImplementedException(); }
        }

        J Offline
        J Offline
        jschell
        wrote on last edited by
        #62

        Naerling wrote:

        And now C#, but using the 'Java mindset'.

        No. Actual pseudo syntax would be as follows. using System.Collections.Generic.*; // Asterisk. And C# is basically the same way since you can explicitly name classes via using with the following. using MyClass = MyPackage.MyClass;

        Sander RosselS 1 Reply Last reply
        0
        • Sander RosselS Sander Rossel

          jschell wrote:

          Huh?
           
          Java has import. And in terms of syntax I haven't seen any difference between those two.

          As far as I understood the difference would be the following: C#:

          // Only one using statement for the entire namespace.
          using System.Collections.Generic;

          public class SomeClass
          {
          List<String> someList;
          Dictionary<String, String> someDict;
          IEnumerable<Object> ienum;
          }

          And now C#, but using the 'Java mindset'.

          // Every class needs another using statement.
          using System.Collections.Generic.List<T>;
          using System.Collections.Generic.Dictionary<TKey, TValue>;
          using System.Collections.Generic.IEnumerable<T>;

          public class SomeClass
          {
          List<String> someList;
          Dictionary<String, String> someDict;
          IEnumerable<Object> ienum;
          }

          It tends to make the list of using statements quite long :)

          jschell wrote:

          Various preferences that I can note. etc...

          Nice! I'm not very familiar with C++ (but I do want to learn it someday). I don't know Perl at all (just by name). Is it worth the trouble to learn?

          It's an OO world.

          public class Naerling : Lazy<Person>{
          public void DoWork(){ throw new NotImplementedException(); }
          }

          J Offline
          J Offline
          jschell
          wrote on last edited by
          #63

          Naerling wrote:

          I don't know Perl at all (just by name). Is it worth the trouble to learn?

          I do a lot of code generation. Ideally I would prefer to use the language of the shop (C#, Java, C++) to do code generation but it requires writing so much more code that it just is not worth it.

          1 Reply Last reply
          0
          • J jschell

            Naerling wrote:

            And now C#, but using the 'Java mindset'.

            No. Actual pseudo syntax would be as follows. using System.Collections.Generic.*; // Asterisk. And C# is basically the same way since you can explicitly name classes via using with the following. using MyClass = MyPackage.MyClass;

            Sander RosselS Offline
            Sander RosselS Offline
            Sander Rossel
            wrote on last edited by
            #64

            Ahhh... Didn't know the * was also valid syntax. I guess those introductions don't tell you everything :)

            It's an OO world.

            public class Naerling : Lazy<Person>{
            public void DoWork(){ throw new NotImplementedException(); }
            }

            1 Reply Last reply
            0
            • Sander RosselS Sander Rossel

              So I've made my first aquintance with Java since I need it for my study at OU. I've heard some colleagues and friends say that Java is absolutely terrible, so I wasn't to happy about having to use Java. I started using JCreator (which looks nice, but is quite limited in features). After that I was introduced to Eclipse which looks a lot better. Of course the editor has nothing to do with the language, but it makes programming in it a lot more pleasant. So what did I think of Java? It's not bad. Missing the Properties of C# and the Namespace Imports (using), but they're stuff I can get used to. I could run it on my desktop or in my browser without much trouble. Am I missing something or is Java just not the horrible language I was told it is?

              It's an OO world.

              public class Naerling : Lazy<Person>{
              public void DoWork(){ throw new NotImplementedException(); }
              }

              S Offline
              S Offline
              Steve Naidamast
              wrote on last edited by
              #65

              Java is a language which has been promoted by students, academics, and computer scientists. Because of this foundation, the language has been made much more complex than necessary limiting its use to only those who like such environemnts. Microsoft's .NET, in my opinion, is a far superior environment to work in (and yes, I am a .NET specialist) due to its easier learning curves and better intergated tools. That being said, Java is just as good as .NET in terms of capability, which is enhanced by the NetBeans platform, which mirrors the capabilities of Microsoft's Visual Studio. Your colleagues who have found Java to be a difficult language to work with may just see it as such due to the style of the environments that Java offers, which once again is based upon its historical foundations in academia and computer science. If you use the right tools (ie: Netbeans) and obtain some good manuals (ie: O'Reilly), it will make working with this language a far more enjoyable experience...

              Steve Naidamast Black Falcon Software, Inc. blackfalconsoftware@ix.netcom.com

              1 Reply Last reply
              0
              • Sander RosselS Sander Rossel

                So I've made my first aquintance with Java since I need it for my study at OU. I've heard some colleagues and friends say that Java is absolutely terrible, so I wasn't to happy about having to use Java. I started using JCreator (which looks nice, but is quite limited in features). After that I was introduced to Eclipse which looks a lot better. Of course the editor has nothing to do with the language, but it makes programming in it a lot more pleasant. So what did I think of Java? It's not bad. Missing the Properties of C# and the Namespace Imports (using), but they're stuff I can get used to. I could run it on my desktop or in my browser without much trouble. Am I missing something or is Java just not the horrible language I was told it is?

                It's an OO world.

                public class Naerling : Lazy<Person>{
                public void DoWork(){ throw new NotImplementedException(); }
                }

                B Offline
                B Offline
                Bob Spar
                wrote on last edited by
                #66

                Personally I love the language, and with good dev tools like Netbeans and Eclipse emerging, its just getting better. As the second most popular language after C, it cant be going too wrong, and before dotNet Microsoft tried to steal it, for those that remember. The real issue is just that, one guy owns the platform, another a cool language, the guy with the platform (like Microsoft) makes a cool video system but licenses it so the platform above Java cant use it... and so the language has a Multimedia deficiency. Its the business end that is "where its really at", and keeping your eye on what these warring platforms get up to. This is how I use Java... and it scares the hell out of all the big platform boys. http://ecoamigo.herobo.com/POJO/ so I think its safe to say that Java is still very much in the game. If you consider that big players like Android/Google/IBM/Sun/Oracle are also very much in the Java game, I think its safe to say that the dotNet Java battle is far from over. Also look at things like the Apache Project... I fell in love with Java when Microsoft brought it out, yes!... and the love affair hasn't stopped.

                1 Reply Last reply
                0
                • S Shelby Robertson

                  I don't think the language is terrible, but I think the run time is a steaming pile.

                  CPallini wrote:

                  You cannot argue with agile people so just take the extreme approach and shoot him. :Smile:

                  P Offline
                  P Offline
                  planetjim
                  wrote on last edited by
                  #67

                  Java is a modern procedural object-oriented language with garbage collection. It's really not that much different to C# and several other less common languages. Of course, the details are different and good programmer output requires language familiarity. A lot of language bitching is related to familiarity and habits of thought. Java's real success is in server applications due to it's platform independence. For the vendor, this means they can maintain a single core code base and sell to the customer's preferred platform, including Windows, Linux, Sun, IBM, and more. The vendor might have a little platform specific code and tweaks, eg, installers and launchers, but the core 99% of their code runs on any JVM. For the customer there is less platform tie-in although in practice this typically doesn't amount to much: customers will stick with their familiar platform. So the platform independence really translates to product availability for their house platform. JVMs are mature technology: fast, stable, scalable and tuneable. Java and the JVM is great for writing web applications and several good Java application server platforms are available that handle the connection and management stuff. Java has a pluggable library set that is roughly comparably to dotnet, with pluses and minuses. There are often a few different Java libraries available for a particular purpose including a lot of good open source. When debugging Java you tend to make it to the actual source rather than hitting a blackbox function call. A variety of other languages have been subsequently written for or ported to the JVM because it is a reliable standard. The case for Java on the desktop is a little weaker but the same argument applies. Zippy UIs are better written in native languages but generic system tools - things like ldap directory browsers or log analysers - are commonly written in Java.

                  If, after hearing my songs, just one human being is inspired to say something nasty to a friend, or perhaps to strike a loved one, it will all have been worth the while." - Tom Lehrer

                  S 1 Reply Last reply
                  0
                  • P planetjim

                    Java is a modern procedural object-oriented language with garbage collection. It's really not that much different to C# and several other less common languages. Of course, the details are different and good programmer output requires language familiarity. A lot of language bitching is related to familiarity and habits of thought. Java's real success is in server applications due to it's platform independence. For the vendor, this means they can maintain a single core code base and sell to the customer's preferred platform, including Windows, Linux, Sun, IBM, and more. The vendor might have a little platform specific code and tweaks, eg, installers and launchers, but the core 99% of their code runs on any JVM. For the customer there is less platform tie-in although in practice this typically doesn't amount to much: customers will stick with their familiar platform. So the platform independence really translates to product availability for their house platform. JVMs are mature technology: fast, stable, scalable and tuneable. Java and the JVM is great for writing web applications and several good Java application server platforms are available that handle the connection and management stuff. Java has a pluggable library set that is roughly comparably to dotnet, with pluses and minuses. There are often a few different Java libraries available for a particular purpose including a lot of good open source. When debugging Java you tend to make it to the actual source rather than hitting a blackbox function call. A variety of other languages have been subsequently written for or ported to the JVM because it is a reliable standard. The case for Java on the desktop is a little weaker but the same argument applies. Zippy UIs are better written in native languages but generic system tools - things like ldap directory browsers or log analysers - are commonly written in Java.

                    If, after hearing my songs, just one human being is inspired to say something nasty to a friend, or perhaps to strike a loved one, it will all have been worth the while." - Tom Lehrer

                    S Offline
                    S Offline
                    Shelby Robertson
                    wrote on last edited by
                    #68

                    I'm humbled by your sorcerous skill at casting maximized wall of text.

                    CPallini wrote:

                    You cannot argue with agile people so just take the extreme approach and shoot him. :Smile:

                    1 Reply Last reply
                    0
                    • W wout de zeeuw

                      Closer timings than on my machine, do you think it's due to the StopWatch? Can't image. The matter is definitely quite obscure, so I wouldn't dare to speculate about why it's still slower on x86.

                      Wout

                      S Offline
                      S Offline
                      ScottM1
                      wrote on last edited by
                      #69

                      It probably is because of the Stopwatch, DateTime and TimeSpan aren't very accurate. This has been interesting though, I didn't know C# was slower when passing structs.

                      1 Reply Last reply
                      0
                      • S Shelby Robertson

                        I don't think the language is terrible, but I think the run time is a steaming pile.

                        CPallini wrote:

                        You cannot argue with agile people so just take the extreme approach and shoot him. :Smile:

                        M Offline
                        M Offline
                        Member 4608898
                        wrote on last edited by
                        #70

                        I'll second that. I had a C program that took 10s to run. It read variable length records and split them into fixed sized record files. Converted it to Java: after 2 hours it still hadn't finished. That was the bytecode interpreter. Native is a lot faster but crap for development.

                        1 Reply Last reply
                        0
                        • S ScottM1

                          I don't think there is anything worse than Swing though.

                          M Offline
                          M Offline
                          Member 4608898
                          wrote on last edited by
                          #71

                          You haven't used a lot of GUI APIs then.

                          S 1 Reply Last reply
                          0
                          • M Member 4608898

                            You haven't used a lot of GUI APIs then.

                            S Offline
                            S Offline
                            ScottM1
                            wrote on last edited by
                            #72

                            What's worse than Swing then? Instead of some vague all-knowing comment why don't you give an example? I think you'd be pretty hard-pressed to find anything worse than the layouts in Swing and the way the whole GUI feels so clunky.

                            M 1 Reply Last reply
                            0
                            • S ScottM1

                              What's worse than Swing then? Instead of some vague all-knowing comment why don't you give an example? I think you'd be pretty hard-pressed to find anything worse than the layouts in Swing and the way the whole GUI feels so clunky.

                              M Offline
                              M Offline
                              Member 4608898
                              wrote on last edited by
                              #73

                              Take it you haven't tried other non-Java GUIs like SL-GMS, SDL, FLTK, MFC, Windows SDK, Athena Widgets or X-Windows. SL-GMS is screen scalable - everything is a fraction of 1 screen so to draw a line across the centre, it has to be from 0.0,0.5 to 1.0, 0.5. In these APIs, the button sizes are fixed: they don't expand to the text size so if you're switching from English to German where small words like return become big words like zurückkehren you need to redo the entire GUI. SL-GMS is so bad, the text even runs out of the list boxes and over other controls! The tree control in MFC is sheer murder. Even MS can't get it right. Sometimes on explorer windows, disk drives repeat. If you have a big C# project in Visual Studio, it takes ages to open and ages to close because the tree control keeps on redrawing itself as it closes each project! If you want it to work properly, you need custom drawing and that's a nightmare in itself. It is really clunks are us. SDL and X Windows are really basic - lower than AWT (which is very similar to Motif). Count yourself lucky that you haven't been given just one routine: how to draw a dot at a location on the screen in a certain colour. Then you have to write the entire suite: buttons, lines, textboxes, listboxes, fonts: the whole works!

                              1 Reply Last reply
                              0
                              • Sander RosselS Sander Rossel

                                So I've made my first aquintance with Java since I need it for my study at OU. I've heard some colleagues and friends say that Java is absolutely terrible, so I wasn't to happy about having to use Java. I started using JCreator (which looks nice, but is quite limited in features). After that I was introduced to Eclipse which looks a lot better. Of course the editor has nothing to do with the language, but it makes programming in it a lot more pleasant. So what did I think of Java? It's not bad. Missing the Properties of C# and the Namespace Imports (using), but they're stuff I can get used to. I could run it on my desktop or in my browser without much trouble. Am I missing something or is Java just not the horrible language I was told it is?

                                It's an OO world.

                                public class Naerling : Lazy<Person>{
                                public void DoWork(){ throw new NotImplementedException(); }
                                }

                                M Offline
                                M Offline
                                MarvinMartian
                                wrote on last edited by
                                #74

                                As and old time (seriously) C and then C++ programmer, I love Java. In fact I'm expending a large effort of time, not to mention dollars, to get my SCEA. I will be testing for SCJP shortly (Two weeks). All my career direction is toward Java now. Even if I do have to C# .Net at this time.

                                1 Reply Last reply
                                0
                                Reply
                                • Reply as topic
                                Log in to reply
                                • Oldest to Newest
                                • Newest to Oldest
                                • Most Votes


                                • Login

                                • Don't have an account? Register

                                • Login or register to search.
                                • First post
                                  Last post
                                0
                                • Categories
                                • Recent
                                • Tags
                                • Popular
                                • World
                                • Users
                                • Groups