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 Jason Hooper

    I'd avoid getting caught up in the typical language war. There are no horrible languages--though there are horrible combinations of languages for the task at hand. I wouldn't want perl powering the airplanes I fly in, and I wouldn't expect a full custom C-driven web site solution for a very small e-commerce site. For anything in between, just find something you enjoy and become proficient at it.

    Jason

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

    Jason Hooper wrote:

    I'd avoid getting caught up in the typical language war.

    I try to avoid it. I'd best not mention I'm a VB programmer... :~

    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(); }
      }

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #23

      I wouldn't say "absolutely terrible", there's worse stuff out there.. but I still maintain that C# is "Java done right".

      S 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
        Sameer Mitra
        wrote on last edited by
        #24

        I like Java - maybe I am biased as it was one of my first languages (apart from C++) that I had learned. I used it a lot, both at university and professionally. This was before Microsoft.NET was around. Personally, I think it is a great language to get the basics right.

        1 Reply Last reply
        0
        • Sander RosselS Sander Rossel

          _beauw_ wrote:

          I'm not as big a fan of garbage collection

          You're one of those[^] guys? :laugh:

          It's an OO world.

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

          _ Offline
          _ Offline
          _beauw_
          wrote on last edited by
          #25

          No! The first frame of that cartoon reads "smart pointers are dumb." Smart pointers are RAII- something I actually praised in my post. I don't believe in disorganization, I just believe that having another thread constantly running a garbage collector is not necessarily the best way to avoid disorganization. Or, more subjectively, it doesn't lend itself well to the sort of applications and platforms I enjoy working with. As I've mentioned elsewhere, garbage collection results in a performance profile I would describe as fast-but-uneven, and can make it difficult to make worst-case performance guarantees. RAII (and plain old automatic variables) make more sense to me. Besides that, it doesn't ring true to me when people talk about things like "chasing memory leaks." I've spent much more of my programming career scratching my head at UML diagrams than I have chasing memory leaks (and yet few people, in "IT" at least, are trying to get rid of OOP).

          1 Reply Last reply
          0
          • W wout de zeeuw

            The runtime is actually a lot faster than the .NET runtime.

            Wout

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

            Based on what? I doubt that.

            W 1 Reply Last reply
            0
            • L Lost User

              I wouldn't say "absolutely terrible", there's worse stuff out there.. but I still maintain that C# is "Java done right".

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

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

              M 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
                Mark_Wallace
                wrote on last edited by
                #28

                Just beware of objectfuscation[^]

                I wanna be a eunuchs developer! Pass me a bread knife!

                Sander RosselS 1 Reply Last reply
                0
                • M Mark_Wallace

                  Just beware of objectfuscation[^]

                  I wanna be a eunuchs developer! Pass me a bread knife!

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

                  return IAnswer ;p

                  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(); }
                    }

                    L Offline
                    L Offline
                    Lost User
                    wrote on last edited by
                    #30

                    I used Java and eclipse a lot in my last job and got to like it; it did what was expected of it. As with all languages, hardware platforms and operating systems, there are pros and cons, lovers and haters, and, worst of all, bigots.

                    One of these days I'm going to think of a really clever signature.

                    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(); }
                      }

                      N Offline
                      N Offline
                      Nagy Vilmos
                      wrote on last edited by
                      #31

                      I like Java. The 'big' thing that people often point out is the lack of properties. It takes a bit of getting used to but becomes second nature, everything, everything I say, is performed through a method. But it's just another language with advantages and disadvantages. If you know how to code, then it is as good, or as bad, as any other. If I need performance or low level control then I'd use C or C++, but for most jobs Java is just fine. Pick the right tool for the right job. Simples.


                      Panic, Chaos, Destruction. My work here is done. Drink. Get drunk. Fall over - P O'H OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett

                      1 Reply Last reply
                      0
                      • S ScottM1

                        Based on what? I doubt that.

                        W Offline
                        W Offline
                        wout de zeeuw
                        wrote on last edited by
                        #32

                        There are large areas where .NET is just not very efficient, e.g. in passing around structs to methods. In theory it could be made efficient (like the java VM), but MS has shown little interest in doing so. Have a look here for some numeric performance measurements: http://www.itu.dk/people/sestoft/papers/numericperformance.pdf[^].

                        Wout

                        B 1 Reply Last reply
                        0
                        • W wout de zeeuw

                          There are large areas where .NET is just not very efficient, e.g. in passing around structs to methods. In theory it could be made efficient (like the java VM), but MS has shown little interest in doing so. Have a look here for some numeric performance measurements: http://www.itu.dk/people/sestoft/papers/numericperformance.pdf[^].

                          Wout

                          B Offline
                          B Offline
                          BobJanova
                          wrote on last edited by
                          #33

                          The only test that C# loses on in there, if you look at the MS JIT'd version not the Mono one (which is not a fair comparison with the commercial Sun JVM) is the matrix multiplication one and using double[,] is known to be a bad idea for performance.

                          W 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
                            BobJanova
                            wrote on last edited by
                            #34

                            It's not horrible. That's typical 'language war' overstatement. But it is just a bit worse than C# in pretty much every way (I really can't think of a single advantage now that Mono/Moonlight clears up most of the 'cross platform' thing that Java used to have over everyone else):

                            • No properties; code looks less tidy and you get 'paren fatigue' trying to read it
                            • LINQ is awesome
                            • Java's generics are a bad post-hoc hack that don't really work properly (for example you can't use T.class or have two method overloads which take different types of List)
                            • Package visibility is much less useful than internal in .Net
                            • csc directly produces a usable DLL/EXE; javac produces something you need a build tool to turn into something runnable
                            • lambdas and delegates
                            • proper events as a language feature
                            • Lots of minor things that make code nicer to read (typeof(T), is and as instead of instanceof, upper case convention etc)
                            • Much better UI libraries in the framework (AWT and Swing are notoriously awful; WinForms and WPF are both pretty good)
                            • Better thought out collections in the framework (see also Generics, above)

                            There's also the community, which isn't really the fault of the language, but Java is the source of most of the 'factory factory factory pattern' type of thinking.

                            J 1 Reply Last reply
                            0
                            • B BobJanova

                              The only test that C# loses on in there, if you look at the MS JIT'd version not the Mono one (which is not a fair comparison with the commercial Sun JVM) is the matrix multiplication one and using double[,] is known to be a bad idea for performance.

                              W Offline
                              W Offline
                              wout de zeeuw
                              wrote on last edited by
                              #35

                              Hmm, that's right, that was a rubbish reference! I ran accross articles about the jvm being quite fast several times though, but I never bothered to bookmark them, so can't find them quite quickly. .NET's passing around structs still sucks though.

                              Wout

                              S 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(); }
                                }

                                K Offline
                                K Offline
                                Kimberley Barrass
                                wrote on last edited by
                                #36

                                Personally speaking, I find it a fine and extensible language. Fairly elegant, and with MASSES of freely available code available means it is very easy to learn, and use to actually do something useful. BUT, outside of the language itself, I find it to be despicable to actually deploy and use in an enterprise environment. The tuning is dire, permgen growth is unacceptable, and I much, much prefer the .net framework. If it wasn't for the fact that it is the easiest way to program on posix based systems I probably wouldn't use it at all...

                                1 Reply Last reply
                                0
                                • W wout de zeeuw

                                  Hmm, that's right, that was a rubbish reference! I ran accross articles about the jvm being quite fast several times though, but I never bothered to bookmark them, so can't find them quite quickly. .NET's passing around structs still sucks though.

                                  Wout

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

                                  I'm not sure I understand, how does it suck? Pass them using ref and it will be quick.

                                  W 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(); }
                                    }

                                    E Offline
                                    E Offline
                                    englebart
                                    wrote on last edited by
                                    #38

                                    Java is not horrible and the runtime has been very stable through all of the updates. You can probably take code compiled fifteen years ago by the 1.1 compiler and run it under the 1.7 runtime. Have fun with inner classes inside methods that automatically "clone" final stack variables from the containing method; one feature of Java that I wish C# would copy. The IDE should handle all of your imports for you. I have only had one time in the last fifteen years of working with Java where I really needed a pointer to help with some data structure manipulation. I managed to get something working but it was inefficient.

                                    1 Reply Last reply
                                    0
                                    • S ScottM1

                                      I'm not sure I understand, how does it suck? Pass them using ref and it will be quick.

                                      W Offline
                                      W Offline
                                      wout de zeeuw
                                      wrote on last edited by
                                      #39

                                      Some things are sub optimal, like mentioned a very long ago to MS here: https://connect.microsoft.com/VisualStudio/feedback/details/93858/struct-methods-should-be-inlined#tabs[^] Also see here for some comparisons between struct, passing by val/ref. Passing a struct by value has issues, as the CLR is not smart enough to handle that properly. http://www.kynosarges.de/StructPerformance.html[^] Also the java server VM seems to be better behaved in these tests. Passing a struct containing two doubles by value should be as fast as passing just a two separate doubles, but it's definitely slower (on x64 only at the moment presumably).

                                      Wout

                                      S 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
                                        Stingrae789
                                        wrote on last edited by
                                        #40

                                        So I taught myself Java about a month ago after running through runtime hell for a week with my current project (where I have no 'real' need for C++). I have a semester's worth of experience with C# and my degree was primarily C++ with a splattering of other languages where appropriate. It took about a week to be comfortable in Java. I am now tutoring Java to first years, I ran into the flaws of JCreator which is a very familiar environment from a visual studio background but ultimately only the pro version is good enough when you compare against netbeans (my primary java ide) and eclipse. I have also found JGrasp adequate but not ideal due to the lack of intellisense (excuse the microsoft term). Netbeans window flexibility makes it my choice over eclipse although I still like the visual studio IDE. There are problems with Java but they aren't that noticeable for the most part. Language wars seem futile as compilers improve and cpu power available increases. The language design is however old, Scala is a more modern language for example and still works on the JDK. I also like the ability of Java to integrate with C through the JNI while not ideal, it provides potential optimizations. As for your queries: Properties are nice but certainly not necessary, import replaces using but I miss the idea of things belonging to namespaces (as done in C++ where std::vector != mycontainers::vector), while the ide resolves these I don't enjoy reading code where I can't tell what package things are from. I feel Java is better than C# because of greater portability however this doesn't mean C# doesn't have areas where it is better e.g. Unity3D and XNA are great C# based tools. Also I would like delegates as C# implements them in Java.

                                        1 Reply Last reply
                                        0
                                        • W wout de zeeuw

                                          Some things are sub optimal, like mentioned a very long ago to MS here: https://connect.microsoft.com/VisualStudio/feedback/details/93858/struct-methods-should-be-inlined#tabs[^] Also see here for some comparisons between struct, passing by val/ref. Passing a struct by value has issues, as the CLR is not smart enough to handle that properly. http://www.kynosarges.de/StructPerformance.html[^] Also the java server VM seems to be better behaved in these tests. Passing a struct containing two doubles by value should be as fast as passing just a two separate doubles, but it's definitely slower (on x64 only at the moment presumably).

                                          Wout

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

                                          Well then pass 2 Doubles, why create a struct for that? I just did this test on .Net 4 x64 where I made 10 million calls on 2 different methods, one that accepts a struct and one that accepts 2 Doubles. The one that accepts Doubles ran in 336 ms and the one that accepts a struct ran in 325 ms. It was consistently between 5 and 20 ms difference, hardly something to be concerned about.

                                          W 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