Non-programming question about Java...
-
I like Java better than most of the languages invented recently. I'm not as big a fan of garbage collection as most people; I'm more impressed by things like RAII, and (having cleaned up my garbage on my own for many years) I think many people make a bigger deal out of its benefits than they ought to. As far as languages with a garbage collector go, though, Java is probably my favorite. My first impression when it was new was that Java was like a cleaned-up version of C++. My reaction to C# was similar, but C# has really grown a bit out-of-control in its own right. As for properties, I like the Java approach better: getter / setter functions are not a special case (and the programmer isn't tacitly encouraged by the language to think in terms of fields).
-
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 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(); }
} -
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(); }
} -
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(); }
}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.
-
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).
-
The runtime is actually a lot faster than the .NET runtime.
Wout
-
I wouldn't say "absolutely terrible", there's worse stuff out there.. but I still maintain that C# is "Java done right".
-
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(); }
}Just beware of objectfuscation[^]
I wanna be a eunuchs developer! Pass me a bread knife!
-
Just beware of objectfuscation[^]
I wanna be a eunuchs developer! Pass me a bread knife!
return IAnswer
;pIt's an OO world.
public class Naerling : Lazy<Person>{
public void DoWork(){ throw new NotImplementedException(); }
} -
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(); }
}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.
-
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(); }
}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
-
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
-
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
-
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(); }
}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.
-
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.
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
-
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(); }
}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...
-
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
-
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(); }
}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.
-
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
-
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(); }
}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.