Love and Hate For Java 8
snydeq writes "Java 8 brings exciting developments, but as with any new technology, you can count on the good, the bad, and the headaches, writes Andrew C. Oliver. 'Java 8 is trying to "innovate," according to the Microsoft meaning of the word. This means stealing a lot of things that have typically been handled by other frameworks and languages, then incorporating them into the language or runtime (aka standardization). Ahead of the next release, the Java community is talking about Project Lambda, streams, functional interfaces, and all sorts of other goodies. So let's dive into what's great — and what we can hate.'"
I'm disappointed. I expected Lambda functions to be closer to Erlang's implementation, where you can access the variables of the enclosing function/method safely. But perhaps the examples in the article are just too simplistic to show such behaviour.
I do not fail; I succeed at finding out what does not work.
Proper date and time handling is one of the reasons I really prefer .Net to Java. The support for dates is just deplorable in Java. One shouldn't have to use an external dependancy, like JodaTime to handle basic date operations. If they could also add a "Decimal" data type, that is, a base-10 decimal primitive datatype, I think Java would be a much more useful language for day to day programming. Almost all the programming I do I would rather use a Decimal data type rather than a float data type, but very few languages support it as a native data type. .Net is one of the few environments where they got this right.
Anthropic principle: We see the universe the way it is because if it were different we would not be here to see it.
Oracle is good at one thing: making Larry Elison money. Microsoft isn't sure what they're good at.
I'm starting to think GNU is the problem with "GNU/Linux" these days.
Java is a real language, and a lot of real programs have been written with it. It's not a good language, but that doesn't make it trivial.
-jcr
The only title of honor that a tyrant can grant is "Enemy of the State."
Having grown up on Java, I know that it's always had a mindset of trying to be pretty much everything to everyone (even if sometimes half-heartedly.) That said, I'm tired of every language trying to see just how much of every possible programming model, paradigm, or feature it can tack on. It really seems like some bizarre dick-measuring contest among language designers these days.
Java is a real language, and a lot of real programs have been written with it. It's not a good language, but that doesn't make it trivial.
-jcr
Its no better or worse than any other languages out there. If you think it is, then you probably need to get out of your mom's basement and into the real business world more.
So you're saying that *all* programming languages are exactly as good each other then? Perhaps you are spending too much time in the "real" world?
I would almost agree, that any language is as good as any other. With a few exceptions, like "whitespace" which isn't meant to be a practical language anyway. What really sets languages apart is the tooling that's built up around them. The debuggers, the IDE, the profilers, etc. Also, the consistency and extent of the standard API plays a huge role in how useful a language is. I would rather use Brainfuck with an amazing tools and a rich API than use Java, Python, or Ruby with bad tools and an inconstent and incomplete API.
Anthropic principle: We see the universe the way it is because if it were different we would not be here to see it.
Well its a mixed bag really. It is a lot more verbose than other recent languages. The type system is inane. The main advantage is you have binary portability across platforms and a really huge standard API to use.
Yes, yes, real programmers use real machine code, because assemblers are for pussies and compilers are for faggots. You keep telling them! I'll be over here, earning money.
Java isn't a language, it's an operating system. And, no, I'm not just talking about the JVM. Java applications are utterly isolated from their environment. It's about as easy to get a Java program to interoperate with other Windows or Linux applications using basic system primitives as getting two applications on two different hosts to interoperate.
Once you go Java, you get sucked in. Nothing matters outside of the Java world. If you don't like the language itself, you use other languages, like Scala, which are built on Java (no, not just the JVM, but the Java libraries, too).
Newsflash: People write major systems in Java that work pretty well. People do mission critical, bet-the-company stuff in Java, and it works. *Your* mileage may vary, but it always does.
This doesn't mean it' the best choice for everything, because *nothing's* the best choice for everything
And it doesn't mean Java doesn't have serious flaws. There's something deeply ingrained in Java that encourages over-engineering. But every language has its pitfalls.
Post may contain irony: discontinue use if experiencing mood swings, nausea or elevated blood pressure.
No, real programmers use butterflies
http://www.paulgraham.com/avg.html
Surely quitting your job and getting a new one is less serious than death.
One new thing for JavaFX http://openjdk.java.net/projects/jdk8/features#153
It's pretty minor.
Deleted from all systems at least a year ago. Why bother?
Its no better or worse than any other languages out there.
That's the voice of inexperience, right there...
get out of your mom's basement
Gosh, what a clever quip. You must be positively venerable to be able to toss off a withering cutdown like that.
-jcr
The only title of honor that a tyrant can grant is "Enemy of the State."
Microsoft isn't sure what they're good at.
Now, now, that's just not true. They know for sure that they are good at not selling Surface RT tablets.
The old adage is always applicable: Those that do not use LISP are condemned to reinvent it. Badly.
I think one of the big problems is that programmers are very much biased towards thinking that what should be considered matters of preference are absolute right/wrongs, and most of the differences between major languages themselves are simply matters of taste or convenience. It's why you can get almost any software engineer to tear apart someone else's code, even if the code is written as well or better than anything they've written: there's pretty much always small differences that the engineer will find offensive even though there's no practical impact.
That was my general thought. Most languages are pretty much interchangeable. What tends to set them apart is the ecosystem they exist in... not just in terms of the 'hard' things like libraries and tools, but the 'soft' things like how much of a developer community (and candidate pool) exists for any particular domain.
Which kinda makes me wonder why language designers bother with these updated versions out side some fetishistic desire to make their language of choice more complicated. Though I guess it does help separate out the 'elite and in the know' from the 'newbies and outsiders'.... though I think C++ really takes the cake in that regard.
Java is a brogrammer language. It's for people that find writing real programs, in real languages, too hard.
Well consider this your lucky day! With Java 8 you can now write JavaScript to run inside of Java! Sayeth TFA:
Netscape created a piece of software called LiveScript to allow for scripting on its Web servers. It decided to port it to its browser and needed a fancier name, so it licensed the Java trademark from Sun and called it JavaScript -- which would long promote the confusion that JavaScript had very much to do with Java. However, after the apAOLcalypse, some members of the 12 colonies of Netscape were not done and sought to continue Netscape's plan of rewriting their browser in Java. In order to do so, it needed to create an implementation of JavaScript in Java. Netscape called the project Rhino; as with turducken, ours is not to question but to enjoy.
So just in case the seemingly unquashable confusion between Java and JavaScript wasn't bad enough, it's about to get worse. But I guess you can't blame Oracle -- they heard you like to use JavaScript and Java, so now you can JavaScript with your Java while you Java with your JavaScript. Or something. Plus throw in some Node.js bullshit for good buzzword coverage.
While there are many places that it can be useful to run JavaScript from within Java....
This is just plain bad.
"What do you despise? By this are you truly known." --Princess Irulan, Manual of Muad'Dib
/)
Yeah, that is one of the things that tends to drive me crazy about programming in Java. I am used to languages that can link with each other or at least work together, java seems almost pathologically isolating.
If you think that all programming languages are the same it is perhaps time you get out of your mom's basement and look at 60 years of efficiency studies which show much the opposite.
If you need all of those things to help you program better, maybe the language you're using really does suck.
I used to work on a Java transaction processing application at a major financial institution that handled more than 1,000,000 transactions a day that consolidated data from Unix, mainframe and Windows systems. The transactions came from batch and online, client-facing applications that had five nines uptime requirements.
I don't know, sounds major to me. And we had no more "major system problems" than any other app and less than most.
It's not to say that Java is the answer to everything because nothing is. But it is definitely capable of doing the heavy lifting.
Some of what I say is fact, some is conjecture, the rest I'm just blowing out my ass...you guess.
The old adage is always applicable: Those that do not use LISP are condemned to reinvent it. Badly.
Not that I totally disagree with you, but that's an amusing statement given that Guy Steele helped to write the implementation of Java per invitation of Bill Joy.
One must also remember the historical context when Java was created. A quotation from Steele on ll1-discuss: "We were not out to win over the Lisp programmers; we were after the C++ programmers. We managed to drag a lot of them about halfway to Lisp. Aren't you happy?"
Given how mainstream Ruby, Python, and even JavaScript are now for "real" development, back in the day "real" programmers only used native binaries for "real" applications. Java managed to pull a lot of people towards the dynamic-ish side of things. Certainly Perl (and shell) was around for use by sysadmins and the like, but those guys weren't "real" programmers.
IMHO, without Java being pushed as an alternative to C/C++, I don't think we would have gotten the renaissance of dynamic languages we have today; or, at the very least, it would have taken longer to get to the same point we are today. I say this as someone who has no great love for the language, but I have no trouble accepting its place in the evolution of languages in terms of technology and culture.
May you spend 100 years in purgatory, writing AI programs in COBOL.
Lisp may be an interesting language, but Lispers scare me. The glow in their eyes when they evangelize about the Mother of All Languages reminds me of Village of the Damned.
Do you have a cite for that? Serious question. I've never seen such a study and would be very interested.
Why are you all feeding the troll? Let the moderation work and ignore the asshole.
"Ignorance more frequently begets confidence than does knowledge"
- Charles Darwin
Since when is standardization stealing? Do you think the Redhat/JBoss devs that wrote Seam complained when they were asked to create the CDI spec? Or when Gavin King (creator of Hibernate) worked on JPA? Maybe in some bizarro world standardization actually happens as technologies mature. You can look at the expert list of any of the JSR and see who these *thieves* are.
My Hello World is 512 bytes. But it's also a valid Fat12 boot sector, Fat12 file reader, and Pmode routine.
No, its just the realisation that if Java was a terrible language it would have died a long time ago. The financial services and banking industry that I work in - the only other services we have ever had to interop with in the last 12 years are Java or .Net based.
If Java was such a rubbish language that would not be the case, although I suspect that due to you not really knowing any better you don't have a clue about the real world.
thanks dude - yes, the one new JavaFX feature ("Enhance the java command-line launcher to launch JavaFX applications.") is pretty minor but that page you provided is very informative.
Java 8 is still limited to 32-bit array indexes, meaning, e.g. that arrays of doubles are limited to 32GB. Java won't get true 64-bit support until Java 9 in 2016.
I remember when C# and .Net first came out, it was noted that it was just borrowing (some said stealing) from Java. When C# first came out, I didn't see it as becoming a leader in new language features, but it is clearly is, as Java 8 addresses a lot of things that been part of C# for a while.
Streams: Similar to IEnumerable and parts of LINQ (LINQ to Objects). Of course, IEnumerables are less strict on multiple enumeration (it may work). Being a bit more strict on this as Streams isn't a bad idea. Functional Interfaces; The article was light on details, but it seems to address the use cases that extension methods in C# addresses. Interesting that the body of the method appear in the interface. The ability for a class to override this default is a new idea, it will be interesting to see how this plays out. Not a bad way to go about this at all. Lambdas:Well, it's -> versus =>. I can't imagine the discussions that occurred over which one to choose.
I'm not sure about the JavaScript in Java feature. But, I've always said being able to execute Scheme in .Net would be useful to me, so this something that MS may have to address down the road.
For me, Java still needs some catching up in terms of parallel programming versus the Task Parallel Library (and the Dataflow Extensions). This is especially true with C# 5.0. Async and await are powerful language features. Personally, I'm still prefer C#. I like having first class generics, the full LINQ library (Expressions) and libraries like Reactive Extensions and Code Contracts (plus the static verifier) are nice features. But, all this in Java 8lis a step in the right direction. I just hope it isn't a case of too little, too late.
That's sort of the point of the language. The ability to write once and not have to rewrite the entire thing because you're now on a different platform.
Your complaint is sort of like complaining about how hard assembly is and how they should figure out how to make it more easily read and do things for you.
And it doesn't mean Java doesn't have serious flaws. There's something deeply ingrained in Java that encourages over-engineering. But every language has its pitfalls.
I don't think there's much in Java the language that encourages over-engineering; it's more in the community that surrounds Java. It's in the tutorials, and books, and code examples and discussion groups . It's in the frameworks and libraries.
The reality is that a "language" is as much shaped by the community that grows up around it as by the actual language itself. Perl doesn't have to be particularly unreadable, but the culture that grew up around perl in the late 90's that was obsessed with cute hacks, fewest keystrokes, and self created obscurity created a state where anyone learning perl was immersed in that culture and came out writing a lot of unreadable stuff. It is my understanding that since many of those programmers left perl for other languages perl has been remade as "Modern Perl" which is largely the same core language, just with a different and libraries, and is quite readable.
Conversely python can be made quite diabolical (just through together chains of nested list comprehensions and single character variables for example), but because it grew up with a culture of "one obvious way to do it" and readability most code you'll see tends to eschew such things, and strive to read like pseudo-code. Again, there's not that much inherent in the language, it's the cultural conventions surrounding the language that enforce much of that.
Java fell in with the Enterprise crowd, and consequently found itself immersed in a culture obsessed with design patterns and over-engineering. Had things gone a little differently with, say, in browser applets somehow becoming the primary driving force for java (let's assume they ran better say) then I doubt java would be known for over-engineering.
Craft Beer Programming T-shirts
He's stuck on an island where there's only one job, and if he doesn't work he doesn't eat. Also, he can't get the job back if he quits.
Lisp is the perfect example of CastrTroy's point -- for a long time the interesting development tools were proprietary, expensive, and obscure. Supposedly things have improved now, but lisp wasn't very practical to use for anything other than emacs.
No, its just the realisation that if Java was a terrible language it would have died a long time ago.
Your optimism is astonishing.
you don't have a clue about the real world.
I spent most of the 90's working on Wall Street, and in Chicago at the Board of Trade. JP Morgan, Salomon Brothers, Phibro Energy, and UBS/Warburg. Since leaving the financial industry, I've been working in the Silicon Valley, much of that time being spent at what is now the most profitable technology company in existence.
But, if as you say I don't have a clue about the real world, I suppose I'll have to bow to your superior intellect and settle for Java as you have. How depressing.
-jcr
The only title of honor that a tyrant can grant is "Enemy of the State."
That's the real question.
I would almost agree, that any language is as good as any other. With a few exceptions, like "whitespace" which isn't meant to be a practical language anyway.
This is a false statement, they are not as good as the other. Each language is designed to be strong in certain areas while weak/ignoring other areas. As an example, C promotes code close to machine language while Java shields the programmer from manual memory management (GC). There are many such design issues that make a language a natural fit for certain applications while making other languages ill-fitted.
What really sets languages apart is the tooling that's built up around them.
While tools may be important, they are of a secondary importance.
No matter how much money Apple makes, Objective-C is still a crappy language.
After years of saying java didn't need C# features they go and steal tons of them from C#! Whether it's properties, lambdas, function pointers or async/await, the Java community has always insisted that those features weren't necessary and that Java was no worse for omitting them. Now they go and steal them and put them into their products and everyone will declare them innovative new Java features. Last month it was Apple stealing the "Metro" UI from Windows Phone. Now this. Is Microsoft the ONLY company doing anything innovative anymore?
He also apparently has ADD.
Mod me down, my New Earth Global Warmingist friends!
Sure the classic discussion is in Mythical Man Month. Here (http://sequoia.cs.byu.edu/lab/files/pubs/Delorey2007a.pdf) is a paper from 2007 which has references to many of the classic discussion. And Brooks I believe cites the original FORTRAN vs. assembler tests.
So if another framework or language has a certain feature Java isn't allowed to have them?
Really?
How much sh*t will break because of Java 8. My current employer of choice still has a core application which requires Java 6 and IE8..
No, you're not clueless. But you do have an overabundance of ego.
It's not stealing from C#. Lisp had many of those features and more as early as the 1960s. Lexical closures, anonymous functions (lambdas), first class functions (i.e. function pointers), garbage collection, all of that was pioneered by Lisp. They are hardly new. John McCarthy and his colleagues invented them decades ago.
I'm not sure how that connects to the GPs request. Anyway Gosling didn't include it because the behavior aren't defined in CPU independent ways.
32-unsigned 0 minus 32-unsigned 1 = ?
where ? is CPU dependent. Some you'll 0xFFFF other 0x8001 others 0xFFFE. That's precisely the sort of thing JAVA was designed to abstract away. And if you don't want unsigned to be doing raw CPU arithmetic on primitives then you can just use a library.
Lisp is the perfect example of CastrTroy's point -- for a long time the interesting development tools were proprietary, expensive, and obscure.
That's not the real problem with Lisp, Smalltalk etc though.
The real problem is that you don't get to benefit from their strengths unless you live completely in their environment. Working with Lisp in a C* based world is like driving a car in the ocean.
Stop rhyming, and I mean it!
Anybody want a peanut?
"Any sufficiently complicated C or Fortran program contains an ad hoc, informally-specified, bug-ridden, slow implementation of half of Common Lisp."
http://en.wikipedia.org/wiki/Greenspun's_tenth_rule
We each have a finite amount of time.
Time spent learning the electronic implementation of every CPU is time I can't spend solving "real" problems.
Where is moderation: -1 False?
It's a much better designed, more modern language, and as an added bonus it runs on the JVM, and integrates with a lot of the tools that Java devs are already familiar with.
In case you weren't aware of it: http://ironscheme.codeplex.com/
No sig, sorry.
Java is a real language, and a lot of real programs have been written with it. It's not a good language
It's very good at what it's designed for, which is keeping your co-worker from messing things up too badly. Every language has a purpose.
"First they came for the slanderers and i said nothing."
I would almost agree, that any language is as good as any other. With a few exceptions, like "whitespace" which isn't meant to be a practical language anyway. What really sets languages apart is the tooling that's built up around them. The debuggers, the IDE, the profilers, etc. Also, the consistency and extent of the standard API plays a huge role in how useful a language is. I would rather use Brainfuck with an amazing tools and a rich API than use Java, Python, or Ruby with bad tools and an inconstent and incomplete API.
I think it would be very difficult to convince Terumo Cardiovascular Systems to build their next blood gas monitor system, or any of their medical devices, on a Java substrate. I think it would be difficult to convince Radiometer Inc. to base their next portable point of care immunoassay system on a Java substrate. I will go further: I doubt you could get any company working on life support systems of any type to trust Java enough to use it as a substrate.
Java is not suitable for a great number of applications, and, indeed, any language that uses a runtime system, and is either interpreted or JIT'ed, or not, is unsuitable for those applications.
For those applications, you need a language that compiles to ROMable machine code.
For applications like industrial control systems, both in manufacturing, and, again in life support, such as the control systems in nuclear facilities - or even coal-fired facilities, if they happen to have their output powering a pediatric ICU, any garbage collected language is unsuitable, since there is very little control, without infinite memory available, on when a GC will run. You can not implement hard real time in a GC'ed language.
For those applications, Java is unsuitable.
There are some languages suitable for those applications: assembly, C, Ada, FORTRAN, C++ (if you disable RTTI and certain aspects of polymorphism, and use an older version, rather than the current draft standard version). There are others, but they are infrequently enough practiced that they would be suspect, both in their mathematical provability, and in their ability to be audited for coding errors.
So No, any language is NOT as good as any other. Not even close.
Java was a GOOD language, because before we had C++.
Fuck systemd. Fuck Redhat. Fuck Soylent, too. Wait, scratch the last one.
The basics still are wrong: generics still are slow and poorly implemented and Java still is bad for numerical apps.
You stupid twat. Don't think for one second that C# invented any of those features. Those features existed long before MS ripped off Java.
7 years of pro development in Java followed by 6 years in C, and I find that even memory management -- that hugely feared thing -- is just a matter of preference. If you're writing unstable code that crashes in C, you're going to write shitty code in Java, and you need to learn whichever language well enough and write meticulously enough to avoid that.
I would agree with the grandparent that it's the tools and support around the language that determine what to choose, at least for anything past a very quick project (e.g., academic display, quickie iOS app.) Hell, lack of auto-complete in an IDE would probably enough for me to disallow a language outside of very special circumstances.
The debuggers, the IDE, the profilers, is completly irrelevant to programming. I never used one before, I debug with print statements
So you've just outed yourself as one of the amateurs in your first paragraph. Congrats.
Everything else you say after that should be disregarded as gibberish.
A lot of medical devices are built using Java.
First Google result: http://www.oracle.com/us/technologies/embedded/embedded-java-for-healthcare-433550.pdf
It's been used in medical devices since the late 90's, shortly after it was invented.
For those applications, Java is purpose built.
Have a look at SWT.
After Oracle's suit against Google about Java, I am not going to touch Java again.
After years of saying java didn't need C# features they go and steal tons of them from C#! Whether it's properties, lambdas, function pointers or async/await, the Java community has always insisted that those features weren't necessary and that Java was no worse for omitting them. Now they go and steal them and put them into their products and everyone will declare them innovative new Java features. Last month it was Apple stealing the "Metro" UI from Windows Phone. Now this. Is Microsoft the ONLY company doing anything innovative anymore?
Right, lets pretend Microsoft invented all of those things.
I'm a good cook. I'm a fantastic eater. - Steven Brust
Java is a *very* good language with a great syntax. C is a great language with a great syntax. C++ has a very poor syntax that gives developers far too much rope to hang themselves with, though its ubiquity makes it powerful. While the typical novice programmer will blindly assume that "harder to use" means "better" and "easier to use" means "for bad programmers," all it takes is one look at Programming Research High-Integrity C++ Coding Standard Manuals juxtaposed with most C++ code you see in the wild to understand that "harder" means "more likely to contain bugs."
I've been on Slashdot for 10+ years reading posts from young, brash coders pounding their chests and extolling the superiority of C++ and sneering at Java development. And, I've read enough code to know how wrong they are.
I swear to God...I swear to God! That is NOT how you treat your human!
If you believe that, then by all means settle for something less.
-jcr
The only title of honor that a tyrant can grant is "Enemy of the State."
Seriously, this entire thread is one of the best examples of why I hate both my industry and coworkers. It's just a horrible culture filled with petty superficial people.
After the disaster known as Java 7 I see no reason to change.
Java 6 works just fine thank you very much and will use it for many more years to come!
Java 7 had so many security vulnerabilities and with 6 I do not have to worry about shit breaking like the Android SDK and malware attacks that 7 has. I cringe thinking about the changes java 8 will include.
http://saveie6.com/
I would suggest that it's in between, at least if you consider the contents of the java.blah package part of "Java the language". There are plenty of bits in that which are grossly overengineered... just look at how much crap you have to do in order to carry out simple tasks like file I/O or reading a line of input. It's not a ton in an absolute sense, but it's several times as much code as what "should" be required (according to me).
I used to work on a Java transaction processing application at a major financial institution that handled more than 1,000,000 transactions a day that consolidated data from Unix, mainframe and Windows systems. The transactions came from batch and online, client-facing applications that had five nines uptime requirements.
I don't know, sounds major to me.
That looks like only 12 transactions per second to me. But then, I guess that's about all Java can handle between garbage collections.
More seriously, we use Java for various server systems with high uptime requirements, but there's usually C++ stuffed in there to handle the performance-critical parts.
What's the realistic alternative to Java? Java is good enough and the main gripe is that Oracle is loosing the trust that Sub Microsystems built up.
C# just isn't for political reasons. Financial institutions are very influential in programming languages becoming significant as they are the ones with deep pockets that hire huge amounts of -admittedly mediocre- programmers. So far all large to huge financial institutions I know bar Microsoft from entering their data centres.
So, what's the realistic alternative to Java that financial institutions will embrace?
I hadn't the slightest objection to his spending his time planning massacres for the bourgeoisie... (P.G. Wodehouse)
1) That's not really a lot.
2) Did they meet the 5 9s requirements?
3) A lot of banking systems are build as layers after layer of ETL/batch. The systems often work but are grotesque in design and overall efficiency. They often would be no less efficient in Perl than Java.
A lot of medical devices are built using Java.
First Google result: http://www.oracle.com/us/technologies/embedded/embedded-java-for-healthcare-433550.pdf
It's been used in medical devices since the late 90's, shortly after it was invented.
For those applications, Java is purpose built.
This PDF is Oracle's "Markitecture" -- it's how they want things to work. They have not certified and indemnified their embedded JVM for use in life support systems. Don't expect them to. Don't expect a device manufacturer to bear the costs of certifying both the JVM and their application specific code, as a combination, for that use. IT's not going to happen.
Yes, my Java ring is in a box in my workroom... I do not wear it every day and do Green Lantern-ish stuff with it, like Sun was predicting would happen when they gave them away at Java One.
Nononono! It's 1960! Not 1995!
Cwm, fjord-bank glyphs vext quiz
Is it better to write 3+5 than 3.add(5) ?
The thing 3.add(5) has going for it is clarity, in that I know 5 is being added to 3.
3+5 in a world where operator overloading exists could mean 3 carves 3 and 5 on a tree, or 5 posts a nice message to 3's Facebook wall.
Because "normal" humans do not have to read code, it's really not that obvious at all that 3+5 is better than 3.add(5) or other variants thereof...
"There is more worth loving than we have strength to love." - Brian Jay Stanley
The fact is it's a bit of a self-propagating system. Kind of like it's current owner Oracle in general. Programmers who work in those environments persist their poorly performing "enterprise patterns" to the exclusion of other options. It happens in .Net too. I don't even blame the language so much as the developer ecosystem. I can't tell you the number of times I've seen in Java and .Net entire structures of Interfaces, and Classes, and Factories that which could be solved in a couple dozen lines of code in a single class. Sometimes the simpler, less enterprisey way is the better way. I even had friction from an enterprise architect trying to introduce automagic WCF client creation/registration in a solution that was already using Unity instead of explicit clients to the explicit service binding(s) implemented as a passthrough of the original interface. Fortunately, when I showed that it could be done wiring up a service binding with a single line, and the client with a single line in the config file, it was a much easier sell for the rest of the developers. Abstraction is awesome when it means less code, and less configuration. If that means writing an abstraction once to get that with all services, cool.. if it means having layers of crappy interfaces with only a single concrete implementation for no other reason, I'm less for it.
.Net and NodeJS... and I have to say, even without all the type safety and intellisense of VS and .Net, that I find NodeJS solutions, even relatively large ones (properly split up into testable, reusable modules) to be far nicer to work with than either Java or .Net have been. I'll take an application with a simpler codebase, with good unit test coverage any day. That's the difference of a platform more than the language itself.
I've spent most of the past year and a half with my time split between
Michael J. Ryan - tracker1.info
Because Microsoft invented those methods? You need to get out of the basement more often, and well did Microsoft "steal" java and change the syntax a little to make c# ? Hmmmm? Quit raging, and grow up.
Just like Cobol, the definition of a terrible language?
Or anything else in COBOL.
-jcr
The only title of honor that a tyrant can grant is "Enemy of the State."
So you're saying that *all* programming languages are exactly as good each other then? Perhaps you are spending too much time in the "real" world?
I think that GP is a turing machine
Indeed, 12 transactions a second is peanuts (it could be done with an antique 16 bit system), but it's not because garbage collection.
Garbage collection adds jitter to the system and increases memory usage (by a factor 2 or 3), but nothing of this matters in a single purpose and well memory provisioned server (it kills interactivity and multitasking a desktop or mobile device, though).
RIP, Mary Jo Kopechne
Get thee glass eyes, and, like a scurvy politician, seem to see things thou dost not.--King Lear
Try "debugging with print statements" when the codebase takes over 10 minutes to compile, and that's when the resources don't need to be re-processed. After you admit to that, the rest of the post can't possibly be taken seriously.
We need to start using the right tools for the right job, or make tools for the right job..
That is... DOMAIN SPECIFIC LANGUAGES, not General purpose language library bloat.
I cannot possibly think Java is "*very*" good, until they give it operator overloading, so I can use [] to access lists and hash tables instead of get/set/put. And while they are at it, also give it properties, like in C# or Javascript, so I don't have to use getX/setX/putX. It's not BAD, but it's slightly lacking. Also, I dislike the methods in camelCase, and constants in caps-and-underscores, but that's not really a feature of the language, only a convention.
Right, lets pretend Microsoft invented all of those things.
If you had been following the language discussions for (for instance) lambda-J you would realize that there is a LOT more to it than simply deciding that a language must have this or that feature.
Specifically, both Java and C# are statically typed languages (although in C# a variable can be statically typed to be dynamic, but I digress) with advanced multi-generation garbage collection, structured exception handling, generics etc. Any new concepts introduced into the language must respect the concepts already there. Designing new features for Java or C# requires significant amount of innovation to solve the interference problems and maintaining the "feel" of the language.
LINQ is a real accomplishment, one that I have not seen put together like that in any other language. Yes, list comprehensions existed before. Yes, expression trees (ASTs) have been used in LIST and several other languages before. Don't know about extension methods, but I'm sure that there must be some research language. Yes, type inference had been used before. Yes, inferred classes must have been used in some language before. Certainly lifted types are well-known in certain other languages. But putting the whole package together and make it fit seamlessly with (and complement) the existing features and at the same time keep it so simple and generic that the useful parts are actually library features, that is a real accomplishment.
Reactive Extensions is real research (primarily by Erik Meijer who has regrettably now left Microsoft to return to academia). Not least because it ties to beautiful in with LINQ. It is entirely new? No, as Erik himself would say, IEnumerable is just a monad. IMHO that does not take away from the accomplishment.
Async and await are *really* cool and have inspired Scala to create something similar.
No, Microsoft didn't invent "all of those things". But fitting them in with a curly-brace, statically typed language is real innovation.
Reading slashdot one-liner: (irm http://rss.slashdot.org/Slashdot/slashdot).rdf.item | fl title,desc*
Still, the platform itself is enormously powerful and well supported in software and hardware which is why it is so popular in the enterprise. It's stable, it's scalable and it's portable.
When installing Java and seeing the "3 billion devices run Java" I couldn't help but shout out "3 billion flies eat shit".
Just because something is popular doesn't mean that it's good.
I would almost agree, that any language is as good as any other. With a few exceptions, like "whitespace" which isn't meant to be a practical language anyway.
You may be right if you talk within one group of languages like e.g. procedural. But there is quite a difference between groups: (procedural, functional, logic), (strict, lazy), (pure, with side effects), (dynamically, or statically typed, or untyped), (static, lexical, dynamic scoping).
No, programming languages are not equal to each other. They can be very different. But I agree that tools are important.
I don't know. Reading the article, all I'm thinking is: how many ways can Jimmy find to fuck up his code now? At least with Groovy and Scala, these language features were pretty much limited to programmers who knew what they were doing. With Java, it's a bit like giving everybody in the world a glock and expecting everything to get better.
JNI isn't as easy as (say) .NET native calls but that could be seen as a blessing because it encourages developers to be platform independent to avoid the pain of JNI. By contrast .NET apps can and often are peppered with native calls to DLLs and Win32 which bind them to the Win32 platform and this bleeds into other bad practices such as hardcoded assumptions about directory structure, file behaviours etc.
Nice try. Java does not steal from .NET -- they are not afraid of them. They try to play catch up with the _other_ JVM languages like Scala, Closure.
Java -> python programmer, both around 5-10 years (partially overlapping and with some R thrown in)
Although the skill and character of the programmer is absolutely the primary thing, I do think that language makes a difference, moreso than tools. If I'd have to rank, I would rank programmer > API/libraries > language > tools. I used to write java in Eclipse and could not live without autocomplete, templates etc. I write python in vanilla emacs and don't miss it at all. Without need for both memory management and "type management", you need a lot less cruft in python so less names, classes etc to remember, and certainly no WidgetConstructorFactoryInterface3. Also, having to reference the real documentation frequently is also a boon, as good documentation (e.g. python stdlib, django) contains very important information that might be missed by relying on autocomplete and assuming you know what something means.
If someone would write a good autocomplete for a dynamic language with metaclasses and other magic I would be game, but I fear that that is either theoretically impossible to do completely & correctly, or somehow requires running the whole program dynamically while typing, which just sounds painful. I tried PyCharm a while ago but it was clunky and incomplete. But in any case, I choose python+plain editor over java+eclipse for any project unless I know that java has an excellent library for something I need, which rarely happens.
(and just to defuse the compiler catches errors argument: unit tests + code checkers > compiler errors, especially given the horrible workarounds that are sometimes needed in Java to satisfy the typing system that enables the compiler to catch errors)
So, 6,000,000 orders per second on a single Java thread on commodity hardware isn't good enough for you?
http://martinfowler.com/articles/lmax.html
Java does major heavy lifting, and is extremely fast, if you know what you're doing.
You can try to make minor parts of the program faster by calling C++ via JNI, but you risk harming performance in the long run, because then the JIT compiler can't inline or otherwise optimise that part of the code.
Of course, you can make any language slow if you mess up enough.
Yeah but compare it to C# and .net. And Java libraries and tools are mostly open-source. I think you'll find it has libraries for almost any kind of interaction with other languages and they're often trivial to find. I feel dirty defending java, but i'm pretty confident it's actually the best tool for developing business apps in large-ish IT departments, all things considered.
That's not over-engineering so much as a lack of decent functionality in the JDK. Having things just work right out the box is one of the things I miss the most after I switched to java.
So does Java support unsigned integers (words) yet ?
Quite how anything can profess to be a "programming language" without the concept of an unsigned integer is simply beyond me.
I distinctly remember reading in Java's license terms that it may not be used in critical systems like nuclear plants, missile control systems, and, I suppose, medical aplications.
I don't know what you're talking about. Java has language bindings for every other major language. It's even standardized via the unified scripting API, with which you can call multiple scripting languages and exchange them under the hood without changing your Java program.
I very much like my debuggers, but I can't imagine why a few added print statements would make the program compile for 10 minutes, unless your whole codebase is in one file. (Or you have fetish for static linking.)
I agree that the available toolset and libraries are what makes a language great, and Java is the best supported development platform in the world. It has the greatest availability of tools and frameworks. The language itself is secondary - you can code for the Java VM in practically any language you like -or you plug in Xtext and create your own. There really isn't anything you can't do with Java, including programming micro controllers.
You need to see more java dev teams :)
I don't think there's much in Java the language that encourages over-engineering; it's more in the community that surrounds Java. It's in the tutorials, and books, and code examples and discussion groups . It's in the frameworks and libraries.
Indeed. The C++ world used to be like that. The sort of people who read the treat the design patterns pook not as a useful guide and taxonomy but as a way of life. They used to do the same stuff in C++ with massive class heirachies. I think they tend not to be very good programmers and they migrated en-masse to Java since it has fewer pitfalls. The C++ community has changed considerably since then and the modern style is very different.
I don't think that really says anything about the C++ language or the Java language. As a dyed-in-the-wool C++ programmer, going over to Java, I was firstly not at all surprised by the legendary overengineering, but was surprised that there seemed to be nothing in the language making people write overengineered code.
Don't get me wrong. It's not my favourite language: I find it a little dull and a little verbose, but it does not seem to be bad.
It is my understanding that since many of those programmers left perl for other languages perl has been remade as "Modern Perl" which is largely the same core language, just with a different and libraries, and is quite readable.
Much the same thing is happening in C++. The community (myself included) went mad with excessive template metaprogramming shortly after the mad with design patterns crowd left. It all seems to be calming down and the modern "Stroustrup style" (as it's known and given the name given to it is probably not all that new) of basically doing the sensible thing seems to be slowly taking over.
SJW n. One who posts facts.
Or anything else in COBOL.
-jcr
100 years? That's just about enough time to type in the ENVIRONMENT DIVISION.
And COBOL wouldn't be found in Purgatory. Look someplace lower.
I debugged with print statements.
Back before decent debuggers and IDEs were developed. Ran through miles and miles of Teletype paper over trivialities. Then had to make a 1-line change, recompile/link and do it all over again.
No thanks. I also have a carton or two of punched cards over in the corner and I'm not going back to THEM either.
Sure the classic discussion is in Mythical Man Month. Here (http://sequoia.cs.byu.edu/lab/files/pubs/Delorey2007a.pdf) is a paper from 2007 which has references to many of the classic discussion. And Brooks I believe cites the original FORTRAN vs. assembler tests.
When The Mythical Man-Month was written, IBM FORTRAN was compiled by brute force and depended on a sizeable (for its day) runtime support library.
These days, compilers are much, much better at code optimization and a lot of the things that required runtime support infrastructure for are now handled in the OS or even in basic hardware.
That's going to alter the equation a bit.
Java was a GOOD language, because before we had C++.
One of my favorite definitions: "Java is like C++. But without the mace and knives."
Hence Java 8.
So, 6,000,000 orders per second on a single Java thread on commodity hardware isn't good enough for you?
http://martinfowler.com/articles/lmax.html
Java does major heavy lifting, and is extremely fast, if you know what you're doing.
You can try to make minor parts of the program faster by calling C++ via JNI, but you risk harming performance in the long run, because then the JIT compiler can't inline or otherwise optimise that part of the code.
Of course, you can make any language slow if you mess up enough.
Benchmarks have been done and Java can often out-perform C (and C purists will point out that C++ has its own inefficiencies). The reason being that in addition to garbage collection, modern-day JVMs often "waste" time analysing code execution and re-optimizing dynamically, which is something that C cannot do.
A lot of things that are more efficient done small-scale become relatively less efficient when done large-scale. So much that the large-scale applications can actually benefit even further from processes that would be prohibitive on the small scale (such as on-the-fly re-optimization).
Even memory management can sometimes be more efficient when garbage-collected if the dynamic memory base is large enough and organized in the right way, replacing thousands of small memory transactions with one big one that reclaims whole blocks of memory at a swoop.
There's simply no one absolute answer. Only fools look for silver bullets or the One True Religion. But Java found its niche in high-performance, high-reliability backends and so it has received a lot of attention over the years towards making it handle that sort of stuff well.
You use what's available. Back when I still did websites, there were no clientside JavaScript debuggers other than alert() and document.writeln() statements and whatever you wired them up with.
And, please, no guff about it not being a real language or whatever. Again, you use what's available.
Il n'y a pas de Planet B.
1) That's not really a lot.
2) Did they meet the 5 9s requirements?
3) A lot of banking systems are build as layers after layer of ETL/batch. The systems often work but are grotesque in design and overall efficiency. They often would be no less efficient in Perl than Java.
Machine efficiency isn't the issue these days. The old equation where the machine was a major expense and programmers were relatively cheap has long since been reversed, even though we now expect programmers to be insanely cheap.
If you want cheap programmers, though, don't expect them to be working in Perl. Only APL ranks higher in terms of "write-only programming languages". At least go with Python or something that doesn't take 3 days to comprehend before making any changes to the code.
And I say that as a person who uses Perl as my preferred weapon - for short, one-shot regex-based tasks.
You could do that in Java 6.
That's not over-engineering so much as a lack of decent functionality in the JDK. Having things just work right out the box is one of the things I miss the most after I switched to java.
Java is over-engineered in large part because it's used on large-scale projects where the quick-and-dirty approach doesn't hold up. From time to time, I've had to chastise people for attempting to use J2EE for stuff that doesn't deserve to be written in anything more complex than PHP.
Then again, Sun made some really wretched design decisions. They're (as Oracle) now about to institute the third attempt to get dates, times, and calendars made easily usable. Although part of what made the first attempt so bad was that they DIDN'T over-engineer it. When you're programming for the World-Wide Web, you need support for multiple timezones and things like countries which use lunar calendars.
Have fun maintaining a million-line program in NotePad (or similar).
No colour or religion ever stopped the bullet from a gun
If your code base takes ten minutes to compile when you've added a print statement, you have an *extremely* shitty build system. There's simply no reason for it to take more than a few seconds (a minute if you have some recursive make-crap).
Just like Cobol, the definition of a terrible language?
To be fair, COBOL didn't have much competition in the early days (pretty much just FORTRAN and ALGOL).
No colour or religion ever stopped the bullet from a gun
A lot of real languages have been written with it too.
How are changes to compilers going to alter statistics on programmer efficiency?
It's like language development is stuck in a tarpit where stuff is bogged down in committees for years and then delayed (and potentially falls by the wayside) before a new version of Java turns up months or even years behind schedule. Look how long it took for Java 7 to appear and Java 8 is already delayed 6 months from its projected release. It wouldn't surprise me if some significant feature gets dumped between now and then.
But how it's compiled isn't part of the language, it's part of the tool-chain. PHP is an interpreted language, unless you work at Facebook, where they have this compiler that turns PHP into C, after which, you can easily compile it to a native executable. Which was kind of my point. When you say you want to use C, Assembly, Fortran or Ada for those applications, what you're really saying is you want a language where the existing tool chain supports compiling down to machine code. You're actually choosing based on the tool-chain, and not on the actual properties of the language itself.
Anthropic principle: We see the universe the way it is because if it were different we would not be here to see it.
No. The important part was:
For applications like industrial control systems, both in manufacturing, and, again in life support, such as the control systems in nuclear facilities - or even coal-fired facilities, if they happen to have their output powering a pediatric ICU, any garbage collected language is unsuitable, since there is very little control, without infinite memory available, on when a GC will run. You can not implement hard real time in a GC'ed language.
As someone who mainly does C++, I have to whole-heartly agree with you. There is no silver bullet when it comes to the world of high performance transaction processing systems. 9/10 times, it is not the actual speed of the system that really dictates which language should be used, it is peripheral requirements that can make one language over another a better choice (i.e. does your development/support staff have more experience in one language over another so minimal training required). 15 years ago, I would have said that Java was more than likely not the best choice (note: not the best but more than likely capable) but not any more. The JRE has improved sooooo much that it can run neck-n-neck with unmanaged code in most environments.
For a quality post such as yours, you really ought to login and attach a name to it.
Benchmarks have been done and Java can often out-perform C
Cite? I've often seen that claim but don't recall many benchmarks. Maybe somebody found a ten line loop that a JIT optimizes the hell out of, but I'm very skeptical that Java can regularly outperform C.
There is a subculture of programming in which the players write code (normally undocumented) in which they dare other programmers to understand it. These CryptoWriters can then sit back and laugh while other people try to figure it out. It's a game that I've seen played in all languages. It's like a riddle object wrappered in an enigma wrappered in a puzzle, with abstracted variables. I think people also sometimes play this game when they get bored.
If your code base takes ten minutes to compile when you've added a print statement, you have an *extremely* shitty build system. There's simply no reason for it to take more than a few seconds (a minute if you have some recursive make-crap).
well there are some extremely shitty build systems.
I'm inclined to think that debuggers wouldn't work with them anyways though - and I find debuggers cumbersome for finding complex problems(vs. strategic logging, even more so when more than one thread is involved), because in the debug logs I can choose to include the things I want.
I'm still not going to start writing haskell though. who would pay for it?
(anyhow, if you have to have nice gui debugger for debugging everything, what are you going to do when you can't? )
world was created 5 seconds before this post as it is.
Then start doing Python.
Of course they didn't invent lambdas and function pointers!
They did, however, invent async/await and the Metro UI. They didn't invent async programming, but they did invent the state machine rewriting mechanism that makes async/await so easy. They didn't invent the flat Metro look (the Seattle Metro did), but they did invent the UI around it. They didn't invent monads, but they did invent LINQ (a way to write DB queries natively in whatever language you're using, like C# or VB).
In this case, though, Java's not even copying the innovative features like async/await. They're adding features that have been around for decades, like lambdas. And even then, the lambda implementation doesn't include closures -- at best your lambda can access variables of the enclosing method that don't change, but they're just copying the values. Real closures actually include references to the variables so that they can change. The spec claims that it's to encourage concurrency, but really it's to address the shortcoming in the JVM that the escaping variable records are hard to create.
dom
dom
or Haskell. Scala has the advantage(?) of using the JVM. Of course, my personal preference is back to Fortran. For those still stuck in the Fortran IV/77 time warp, you might want to look at the 2003 specification (and the minor rev in 2008).
stuck in a tarpit where stuff is bogged down
A tarpit called Oracle?
Karma: Poor (Mostly affected by lame karma-joke sigs)
Yeah but compare it to C# and .net. And Java libraries and tools are mostly open-source. I think you'll find it has libraries for almost any kind of interaction with other languages and they're often trivial to find. I feel dirty defending java, but i'm pretty confident it's actually the best tool for developing business apps in large-ish IT departments, all things considered.
Compare what? C# makes it quite easy to call out to native code. Anything with a C api is most likely going to be easy to work with.
Oh, and with IKVM, anything Java is also .NET. It's mind-blowingly awesome.
Karma: Poor (Mostly affected by lame karma-joke sigs)
The financial services and banking industry that I work in -
You mean an industry that produces absolutely nothing of value and is only a parasite which ruins entire economies?
Benchmarks have been done and Java can often out-perform C
Cite? I've often seen that claim but don't recall many benchmarks. Maybe somebody found a ten line loop that a JIT optimizes the hell out of, but I'm very skeptical that Java can regularly outperform C.
Lies, Damn Lies, and Benchmarks, as they say. Actual mileage may vary. For short runs, the sheer overhead of setting up a JVM puts it out of the running. For server systems running more or less continuously, the startup time becomes negligible. Loop optimization is probably not one of the things that Java can optimize better than C. On the other hand, on a lot of systems, there's a significant difference in the amount of time that it takes a conditional branch instruction to take the branch versus going straight. A C compilation produces static code and if the worst-case optimization (branch taken) is selected, that's the end of the story. A JVM monitoring performance can detect this sort of thing and rewrite the code to minimize the number of times the branch is taken. Needles to say, a 10-iteration loop run once a day isn't going to benefit, but a routine that runs millions of times an hour will.
For some actual numbers, I asked my friend Google and managed to find some cases where people did a head-to-head with a greater or lesser degree of honesty (Lies, Damn Lies, ...).
Here's one:
http://keithlea.com/javabench/
A Wikipedia discussion, for contemplation by those who don't knee-jerk reject Wikipedia:
http://en.wikipedia.org/wiki/Java_performance
And something a bit more scholarly:
http://scribblethink.org/Computer/javaCbenchmark.html
And something from IBM on Java's memory-management performance:
http://www.ibm.com/developerworks/java/library/j-jtp09275/index.html
Something I read a while back and cannot recall now asserted that Java won most of their benchmarks except for those involving floating-point numbers. The reason being that C could use the processor's native FPU, but Java's "Write Once/Run Anyware" requirements forced it (unless overridden) to use IEEE Floating-point, which often had to be done in software.
IBM is a big Java proponent. The modern zSeries machines include 2 FPUs. One for the original, rather strange S/360 FP format and the other for IEEE. Not a co-incidence, I suspect. Reminds me of how a group of Honeywell engineers got together with an OS that had been written under government contract for NASA (thus available for public use), and designed a computer whose instruction set was optimized to run FORTRAN. They called they company Prime Computer.
If you'd been here any real time at all, you'd know that Slashdot's moderation system doesn't work at all.
Oracle has demonstrated through their Google lawsuit and their (mis) handling of OpenOffice & MySQL that they are not to be trusted and will screw former partners if they think it's financially beneficial.
Let me know when Java enters the real world with an open specification process and the spec is managed by an independent industry group. Until then there is horrible vendor lock-in with a vendor I don't trust to not sue me if I do something they don't like.
I accidentally clicked an Infoworld link again. :-(
That is big but not as big as what I work on. A market data system that handles 2 billion messages a second in real time. It is written in Java 6. With parts of it updated nonstop. It is totally paralleled, with each instance running on 32-40 core servers (many threads), and instances running on dozens of servers. It is amazing.
Dunno what you think you're telling me, but you're wrong ("machine efficiency is never an issue for anyone these days, ever"). We have organizations that are spending 10x more on power for compute than the entire personnel for their entire software stack and management.
I don't like cheap programmers.
I wasn't suggesting writing such systems in Perl.
Thanks.
I would almost agree, that any language is as good as any other. With a few exceptions, like "whitespace" which isn't meant to be a practical language anyway.
PHP doesn't fit your exceptions, and is objectively bad.
That's unfortunate given that Microsoft makes way more money as a company and for their investors and staff than Oracle does.
Java is per definition a programming langauge for amatuers
The definition of Amateur is unpaid, not too many people would use Java if they weren't being paid for it.
Really?
http://www.pipeline.com/~hbaker1/RealTimeGC.html
http://www.pipeline.com/~hbaker1/NoMotionGC.html
More recently:
http://researcher.watson.ibm.com/researcher/view_project_subpage.php?id=175
1MIL...? lol.. We do over 2.5 BILLION a day (in C#). Obviosuly you didn't talk about your hardwere. But, I deal with millions (pural) before breakfast. Not impressed.
Doctor: "Clear!"
...
...
... ... Oh, it's installing now... want to grab a coffee?"
Nurse: "Doctor, are you going to administer the shock?"
Doctor: "Hang on, the defibrillator is still booting... Ok." -BZZT!- "Has the EKG finished installing that JVM update yet?"
Nurse: "98%, 99%, 100%!
Account -> Discussions -> Disable Sigs
"The debuggers, the IDE, the profilers, is completly irrelevant to programming. I never used one before, I debug with print statements, I use emacs, which is stricly speaking to an IDE "
It says something about a person when they can waste this much time on programming. It says their time isnt all that valuable.
The is one and only one correct behaviour: 32-unsigned 0 minus 32-unsigned 1 = ArithmeticException — which is perfectly CPU independent. Obviously Gosling did not think far enough.
Of course it is cross platform. If you do it right instead of fast. Because when you do it right you raise ArithmeticException on overflows.
Java is a language that both enables and requires tooling. It is ridiculously over-weight language for small projects, but you really start to appreciate it when you work on a codebase shared by a hundred other developers of varying coding ability. It's a right tool for the job language that people too often use for the wrong job (see the poorly-sandboxed-in-browser version and associated APIs). It gets a lot of hate because it's been pitched as a panacea when it shouldn't have been. But it's a language that every serious developer should know and respect because it does things that no other language (that wasn't created as a knock-off) does as well. People too often myopically focus on only the technical merits of a programming language without considering the organizational flexibility it enables when used by large teams.
How about you need 0 … 255? Very common need in computing.
Java bytes go negative => mayor pain in the arse
short could be negative and 256 onwards => if (x<0 && x> 255) destroying all speed advantages. And you need twice as much memory.
BTW: The OP said unsigned bytes. As in 0 … 255. Honestly who needs a byte to go from -128 … 127 — that is the most useless data type in the known universe.
Working with Lisp in a C* based world is like driving a car in the ocean.
This is a lesson that I wish more language designers would grok. At this point, with everything that has been written in C, the first feature you implement beyond the basics of your language should be easy bi-directional C interoperability. And if you can use C calling conventions, that's even better. It's super frustrating to watch a promising language like Go waste years creating their own API when they could have gotten near instant adoptability if they'd just allowed us to use their language with our existing C/C++ code.
C is like email. Anything that seeks to replace it can't operate under the assumption that people will use the new solution instead of it. It has to be designed from the beginning to work with it and enable a gradual migration away from it.
"Don't blame me, I voted for Kodos!"
Spot on. And that is the reason I prefer Scala — which has operator overloading.
Only 100 years? Sweet, I can represent all my dates with only two digits for the year!
Go ahead, use "libgc" with your C code and you have all the benefits of GC.
What I find most painful in C is the lack of a standard SortedTree (it bugs Python as well). Of course, I have implemented them in both languages, but the programming community would benefit a lot if they were included in the standard C library.
Virtual tables are somewhat painful in C but less than I imagined.
The real problem is that you don't get to benefit from their strengths unless you live completely in their environment.
Ha, that's what I'd say about Java. JNI is frowned upon while Guile actively promotes integration with C.
Guile (as well as Perl and Python, for that matter) exposes the OS facilities to the application, while Java makes it virtually impossible to do system programming. How do you do "fork()" in Java? How do you get the your process ID in Java?
On modern transaction processing systems, if you're application is CPU-bound, you're doing something wrong. I/O is the modern-day bottleneck and both Java and C++ are on equal footing in that concern.
Don't believe me? Go find some articles from the mid-nineties. Java was *literally* sold with lines like "you cannot have a null pointer exception in Java". (right) And that it would make the programming backlog go away. (right) And it would be far easier to debug, and there'd be far fewer bugs. (Ever seen a tomcat trace, with 150-200 lines *every* *time*?)
No, thank you.
mark
Once again, Boost comes to the rescue! Provide a couple of operators, and it fills in the other ones you may want. Very well thought out, as most Boost libraries are -- for example, NaNs mean floating point numbers can't necessarily be given a strict ordering, so they provide "partially_ordered" if you need that.
When it comes to efficiency, compilers are remarkably capable these days. I just ran a test with GCC 3.4.5. It optimized "a < b || a == b" to the exact same as it generated with "a <= b" (at -O1). Source code available on request, but just try it yourself.
The lesson here: never make assumptions as to what is most efficient until you actually compile and see what happens. Instead, give the programmer the tools to make the code readable and maintainable, and then fix inefficiencies as you find them. "Premature optimization is the root of all evil." (Donald Knuth)
Oracle are not the only provider of JVM's and not all medical devices are life support systems.
A masterful troll, sir. Hats off.
Seriously, this entire thread is one of the best examples of why I hate both my industry and coworkers. It's just a horrible culture filled with petty superficial people.
I don't think it's necessarily industry. It's the anonymity of the internet that encourages petty behavior in otherwise normal people.
Ada gives a access to CPU unsigned types without “implementation defined”. Mind you Ada prescribes RANGE_ERROR on for overflows in signed types and modulo operations on unsigned types. Either way it is well defined.
Scala hides the difference between class Integer and primitive int behind a new type Int. The compiler decides automaticly if a class or primitive should be used. The quite old language SmallTalk does so as well. Primitives are only interesting when you JNI work. Worse case scenario: array of unsigned byte or short in to our out of a JNI call.
Also it should have been build into the compiler. A library is not good enough because Java has no operator overloading. Ada has, Scala has. Almost all other OO Languages have. But not Java.
Not good enough because Java is missing another important OO Feature: operator overloading. If I may expand the title of the Article “Love for the JVM and Hate For Java”.
Also: Arithmetic contains great potential for optimisation. But for this the compiler need to know what kind of type he is dealing with:
x + 1 + 2 should be optimized to x + 3
MAX_FOO + 4 should be evaluated at compile time
x < y || x = y should be optimized to x <= y
You can still have a library in background to be used by the compiler but the type must be part of the language. The SmallTalk approach that would be.
Anyway: For me the solution was to use Scala when ever I can.
True. CPUs do roll over.
And thinking of it (and correcting myself): Ada does for unsigned typed as well. Not for signed. There a RANGE_ERROR is raised. Strange but sometimes useful asymmetry.
But that does not invalidate my statement. All CPU I know of (there might be others, more exotic CPUs of course) set a carry and/or overflow flag on signed and unsigned roll-overs as well. One does not exclude the other here.
In 8 bit times those flags where extremely important to do 16 bit operation with only an 8 bit arithmetic logic unit. That is why it is called carry flag. And of course you can branch on the carry flag set or unset.
They don't have the same unsigned arithmetic.
That seems wrong to me. In fact it seem the wrong way around for me.
For signed binary arithmetic there are two option:
One-Complement: Where we have symmetric positive and negative ranges. Including a negative zero. Seldom used.
Two-Comlement: Where we have asymmetric positive and negative ranges. With the negative range having one extra number.
But for unsigned binary arithmetic I only know one way of doing it. 30 years of experience in the field. More then a dozen programming languages learned. Degree in computer science. I am hard pressed to even think of a different way to do unsigned binary arithmetic. Even on a purely abstract and academic level.
But one is never to old to learn something new and I a the curious type: Please enlighten me!
I think it's what people are really like on the inside.
You are either absolutely right or absolutely wrong. Or in between.
"I think this line is mostly filler"
Someone is using FORTRAN for life critical control systems? really? FORTRAN?
There are much more use cases that don't need that kind of hard real time constraint in today world. Even phones can run over more high level languages.
"I think this line is mostly filler"
In Java land, we've been waiting for lambda functions for a long time.
On vit, on code et puis on meurt.
Then again, Sun made some really wretched design decisions. They're (as Oracle) now about to institute the third attempt to get dates, times, and calendars made easily usable. Although part of what made the first attempt so bad was that they DIDN'T over-engineer it. When you're programming for the World-Wide Web, you need support for multiple timezones and things like countries which use lunar calendars.
It doesn't help that dates and times are genuinely hard, and the more exactly you try to get them right, the harder they get. I know of someone who wrote his own date handling library from scratch simply because he was fed up with dealing with different bugs in strftime/strptime on each platform he was building on; better to have just his own bugs than everyone else's.
Sane Java programmers use Joda-Time and don't worry about what's going on in C.
"Little does he know, but there is no 'I' in 'Idiot'!"
Something I read a while back and cannot recall now asserted that Java won most of their benchmarks except for those involving floating-point numbers. The reason being that C could use the processor's native FPU, but Java's "Write Once/Run Anyware" requirements forced it (unless overridden) to use IEEE Floating-point, which often had to be done in software.
IIRC, there's a way to change what Java does in that case which can get a reasonable speedup. Never needed it though; I don't write heavy numerics code.
More of an issue is that Java's evaluation order is much more strictly specified than C and C++'s. That rather strongly reduces the space of optimizations that can be applied. OTOH, Java's going to have fewer problems with aliasing; if two references say they're different, they really won't overlap. AIUI, that helps.
"Little does he know, but there is no 'I' in 'Idiot'!"
Yes and before that in Sun. Basically they both love their precious language so much that they've ended up stifling it. Though in some sense perhaps the reason there are so many 3rd party libs and an increasing number of rival languages running over the JVM may be due to the way the language has been handled. So innovation has happened, just not in the one place where it would benefit the most people.
Benchmarks have been done and Java can often out-perform C
ROFLMAO
All else being equal, your claim is so absurd, all I will do is laugh. There is no argument to be had. LOL
C is far more portable than Java.
Not true at all.
There is nothing on the underlying OS and hardware that you can't get to running an app on the JVM.
I have also written a few apps that run on the JVM, and the Java language is by far the least used in them. Even my JavaFX 2 code is not written in Java.
I have far more Ruby, C and Scala code that runs on the JVM.
I am not sure designing a language for the lowest common denominator is the best idea. Sure it results in the language being "popular" but that is not the same as being a good language. While Java is much better than PHP, both are crappy languages that target the LCD, and I will concede that unlike PHP, Java has legitimate uses, but things would be better if both languages never existed.
It is not like there didn't exist many good languages that had garbage collection before Java and Java is not really a C++ replacement ie pretty anything where C++ is a good choice, Java is better - that case doesn't really exist.
Java has terrible, verbose syntax.
Java was designed for the mediocre programmer. That is not even in dispute.
Rhino(which is JS on the JVM) has been around for over 10 years and part of the standard API since 1.5, IIRC.
This is not something new.
Martin Fowler actually wrote a book on DSL's using Java. I think he has officially lost it.