Goto isn't used in Linux for performance reasons. It's used because C does not have exceptions and using goto to jump to clean-up code prevents code duplication. Any sufficiently experienced C programmer will encourage you to do the same.
Why not put the cleanup code in a well named function instead? Also, there are plenty of experienced C programmers who loathe gotos.
I might care about that for operational reasons. For example I don't want a bunch of objects to be collected when my application is otherwise busy, but that wasn't the point.
That I understand. Modern gc algorithms are pretty good, though.
I might have references to objects which I expect to be freed up. I would like to say "this object should be free now" so the VM can say "so, it won't".
That I don't understand. First, one can't possibly know for sure when an object is freeable. Moreover, how could one even say "free up this object"? If you can even say that, then you'd have a pointer to it, giving it a positive reference count! But, secondly, and this is really my question, why should one care? Even if an object is marked for deletion, that memory won't be made available until the VM is good and ready. (When swept.) So, what's the advantage?
By analogy, when I save a file to disk, I don't care what sectors it's written to. The dos worries about that for me, so that I can get on with writing software that addresses the business problem at hand.
But that doesn't stop people from doing really stupid things.
Oh, I hear that. The stories we could tell over beers!
But even when using Java's "native mechanism", things like filename case sensitivity can still bite you. And here's another example. When I start a Java thread, does that run in the same OS process or not? And if the answer is "that depends", then that has some serious implications for availability, testing, and even security.
Stroustrup famously quipped that Java is not platform independent -- it's a platform.
Seriously, unless you are doing something weird, reasonably OK written java app would run under any platform. There might be some small issues, but cross-platform apps with Java are much much much easier to write than cross-platform apps with anything else.
Sure. If I'm writing an email client or something. But if I'm composing a complex system, then there are performance and functional characteristics that vary, and these could very well make or break the product. I appreciate the desire to defer architectural decisions to the last responsible moment. But picking the OS can drive so many other design decisions, that one should get that right almost from the beginning.
With Java predominantly on the server side instead of in the browser, what exactly is the use case that WORA is supposed to solve? Or put another way, who is writing cross-platform apps?
I have been developing server-side code for about a decade, and I have always done my development and testing on Windows, but deployed to either Linux or Solaris, without any platform problems whatsoever.
I find that a little scary.
But I'm curious. Do you do that because as a developer you find Windows more productive for you?
I have no industrial experience with phone software, so I can't speak to that. But the research surely delivered for software in the large. In the same way that compilers can no longer optimize code as well as virtual machines can, it's a bit conceited to think we could hand-code memory management of complex systems better than the computer itself.
Also, in addition to app performance, the second metric to consider is programmer productivity, and gc's impact there is incalculable.
Not having unsigned types is probably the second dumbest decision in Java's design, after compulsory garbage collection.
If these things are important to you, then you are programming in an arena where Java is the wrong choice. These are not defects in Java's design, but Java is not the best language for, say, writing device drivers.
Which is also why I don't understand why programmers and IT usually put down other departments like sales and marketing.
Part of it might be because the sales guy drank and partied his way through college while the science majors were suffering through actual hard work. There just might be some resentment that somebody who made no actual contribution to a technical product just got a huge commission off it.
I agree, and it would be a better policy to define acronyms the first time they are used. The same could be said about the names of software packages in other summaries. I'm mystified that so many commenters are miffed that GPU is explained.
That's an unfair comment. Acronyms can stand for more than one thing, and a good writer's intent is not to show how much smarter they are than their readers.
Social interaction is education. Did any undergraduates actually learn anything from their professors? The only things I remember learning, I learned from my peers.
If you have more than a few years of experience you probably aren't willing to work 70 hour weeks for entry level pay, and therefore are overqualified.
It's nice that you can cite examples of casually dressed folks that have landed jobs, but why sabotage oneself? When an interviewee shows up without a suit it means (1) that they were too clueless to know that some interviewers would take that as a lack of respect, or (2) they knew it but felt that their skills were so awesome that they could deliberately do so anyway. Why hire the ignorant or the arrogant if there are alternatives?
Illegal or not, agedness is not "suspect class" in the U.S. if I recall correctly. This means that the burden of proof for age discrimination falls on the plaintiff, not on the company. Such lawsuits are therefore difficult for the prospective employee to win.
Copernican theory was picked up fairly quickly because it offered a simpler view of the cosmos. Astronomers bought into it largely because of its simplicity -- in effect, following Occam's Razor.
These are two very widely held beliefs, but they are false. The Copernican model of the solar system was not less complicated than Ptolemy's. It even had more epicycles, for example. It also never displaced the preeminence of the Ptolemaic model in the minds of many astronomers as you suggest. Basically, Ptolemy's model gave the right answers, so why abandon it?
Years later, Kepler's model was indeed simpler. But Copernicus was neither simpler nor more popular than Ptolemy. We remember him, though, because heliocentrism is essentially correct.
Thanks, that was a cogent answer.
As somebody said here - java is the platform, not OS.
That was actually me quoting Stroustrup.
I feel that you were trying to be insulting.
To restate my question, why are you developing your apps on a different os than you are deploying?
That is an interesting perspective. Thanks for explaining it.
Actually,
if (conditionImLookingForIsFound())
doFoundThing();
else
doOtherThing();
is most readable. Keep all the code in view at the same level of abstraction.
Goto isn't used in Linux for performance reasons. It's used because C does not have exceptions and using goto to jump to clean-up code prevents code duplication. Any sufficiently experienced C programmer will encourage you to do the same.
Why not put the cleanup code in a well named function instead? Also, there are plenty of experienced C programmers who loathe gotos.
I might care about that for operational reasons. For example I don't want a bunch of objects to be collected when my application is otherwise busy, but that wasn't the point.
That I understand. Modern gc algorithms are pretty good, though.
I might have references to objects which I expect to be freed up. I would like to say "this object should be free now" so the VM can say "so, it won't".
That I don't understand. First, one can't possibly know for sure when an object is freeable. Moreover, how could one even say "free up this object"? If you can even say that, then you'd have a pointer to it, giving it a positive reference count! But, secondly, and this is really my question, why should one care? Even if an object is marked for deletion, that memory won't be made available until the VM is good and ready. (When swept.) So, what's the advantage?
By analogy, when I save a file to disk, I don't care what sectors it's written to. The dos worries about that for me, so that I can get on with writing software that addresses the business problem at hand.
I also disagree with the claims that Scala is too complex. But I'm happy that the undiligent think it is.
Scala already is Java 9. Java the JVM remains relevant, but Java the language is no longer interesting.
But that doesn't stop people from doing really stupid things.
Oh, I hear that. The stories we could tell over beers!
But even when using Java's "native mechanism", things like filename case sensitivity can still bite you. And here's another example. When I start a Java thread, does that run in the same OS process or not? And if the answer is "that depends", then that has some serious implications for availability, testing, and even security.
Stroustrup famously quipped that Java is not platform independent -- it's a platform.
Seriously, unless you are doing something weird, reasonably OK written java app would run under any platform. There might be some small issues, but cross-platform apps with Java are much much much easier to write than cross-platform apps with anything else.
Sure. If I'm writing an email client or something. But if I'm composing a complex system, then there are performance and functional characteristics that vary, and these could very well make or break the product. I appreciate the desire to defer architectural decisions to the last responsible moment. But picking the OS can drive so many other design decisions, that one should get that right almost from the beginning.
With Java predominantly on the server side instead of in the browser, what exactly is the use case that WORA is supposed to solve? Or put another way, who is writing cross-platform apps?
I have been developing server-side code for about a decade, and I have always done my development and testing on Windows, but deployed to either Linux or Solaris, without any platform problems whatsoever.
I find that a little scary.
But I'm curious. Do you do that because as a developer you find Windows more productive for you?
We used to joke "write once run away".
Why do you care when the object gets freed?
I have no industrial experience with phone software, so I can't speak to that. But the research surely delivered for software in the large. In the same way that compilers can no longer optimize code as well as virtual machines can, it's a bit conceited to think we could hand-code memory management of complex systems better than the computer itself.
Also, in addition to app performance, the second metric to consider is programmer productivity, and gc's impact there is incalculable.
Not having unsigned types is probably the second dumbest decision in Java's design, after compulsory garbage collection.
If these things are important to you, then you are programming in an arena where Java is the wrong choice. These are not defects in Java's design, but Java is not the best language for, say, writing device drivers.
Which is also why I don't understand why programmers and IT usually put down other departments like sales and marketing.
Part of it might be because the sales guy drank and partied his way through college while the science majors were suffering through actual hard work. There just might be some resentment that somebody who made no actual contribution to a technical product just got a huge commission off it.
I agree, and it would be a better policy to define acronyms the first time they are used. The same could be said about the names of software packages in other summaries. I'm mystified that so many commenters are miffed that GPU is explained.
That's an unfair comment. Acronyms can stand for more than one thing, and a good writer's intent is not to show how much smarter they are than their readers.
Social interaction is education. Did any undergraduates actually learn anything from their professors? The only things I remember learning, I learned from my peers.
Why does it bother you to work for someone younger than you?
If you have more than a few years of experience you probably aren't willing to work 70 hour weeks for entry level pay, and therefore are overqualified.
This, this, a thousand times this.
It's nice that you can cite examples of casually dressed folks that have landed jobs, but why sabotage oneself? When an interviewee shows up without a suit it means (1) that they were too clueless to know that some interviewers would take that as a lack of respect, or (2) they knew it but felt that their skills were so awesome that they could deliberately do so anyway. Why hire the ignorant or the arrogant if there are alternatives?
Illegal or not, agedness is not "suspect class" in the U.S. if I recall correctly. This means that the burden of proof for age discrimination falls on the plaintiff, not on the company. Such lawsuits are therefore difficult for the prospective employee to win.
Um. The earth is not an inertial frame of reference.
It's not? I sure don't feel like I'm moving.
The forces causing the earth to orbit the sun, and not vice versa can be observed directy.
How exactly do I observe them? Are you sure that's what you meant to type?
Copernican theory was picked up fairly quickly because it offered a simpler view of the cosmos. Astronomers bought into it largely because of its simplicity -- in effect, following Occam's Razor.
These are two very widely held beliefs, but they are false. The Copernican model of the solar system was not less complicated than Ptolemy's. It even had more epicycles, for example. It also never displaced the preeminence of the Ptolemaic model in the minds of many astronomers as you suggest. Basically, Ptolemy's model gave the right answers, so why abandon it?
Years later, Kepler's model was indeed simpler. But Copernicus was neither simpler nor more popular than Ptolemy. We remember him, though, because heliocentrism is essentially correct.