r/programming • • Feb 22 '15

Java Makes Programmers Want To Do Absolutely Anything Else With Their Time

http://www.forbes.com/sites/quora/2015/02/21/java-makes-programmers-want-to-do-absolutely-anything-else-with-their-time/
35 Upvotes

636 comments sorted by

View all comments

Show parent comments

0

u/[deleted] Feb 22 '15

[deleted]

3

u/yogthos Feb 22 '15

With Clojure everything is immutable by default and functions are pure. I only need to understand the specific of the code I wish to change in order to know that the change works.

In Java pretty much everything is mutable and you're dealing with references. It's much harder to tell what the scope of a particular change is without knowing every other place in the application that might reference the same data. Any time you call a function with side effects it might be changing something in an unexpected way.

2

u/afrobee Feb 22 '15

Any time you call a function with side effects it might be changing something in an unexpected way.

Alleging thing without giving a concrete context of your claims,

And what is this something that your are talking about, how this something is gonna affect the rest of the program running if it state is changed?

Is this "something", immutable?

How big is the program?

What are the side effects?

Are best practice applied on the overall architecture to avoid or predict the effects that cause this type of change?

Are we talking about global variable?

How the data represented?

How much is the complexity of data?

The cost of copying data vs mutate it is viable for this program?

I could go on. But I think that you are sensationalizing your claims a little bit too much and baking them up with the most convenient scenarios for their sake.

3

u/yogthos Feb 23 '15

Alleging thing without giving a concrete context of your claims,

What context could that statement possibly need.

And what is this something that your are talking about, how this something is gonna affect the rest of the program running if it state is changed?

That's my whole point. Your changes can only affect things within the scope they're made. You can explicitly see what is affected. The way functional programs are written is predominantly by chaining functions together to transform data. When I want to change a result I trace back through the chain to the point where I need to make the change and do it. I'm guaranteed that the change will only have the effect that's explicit.

How big is the program?

My current project has been in development by 4 people for 3 years now. So, not exactly what I would call tiny.

What are the side effects?

Any changed to shared mutable data that are done implicitly. Pretty much how everything works in Java for example. Any time you call a function that doesn't return an explicit value you've got side effects, any time you call a function that does return a value you might have side effects. Mutability is an insane default in my opinion.

Are best practice applied on the overall architecture to avoid or predict the effects that cause this type of change?

You can either have an honor system that you refer to as best practice or have the language do that work for you. I certainly prefer the latter myself.

I could go on. But I think that you are sensationalizing your claims a little bit too much and baking them up with the most convenient scenarios for their sake.

I could go on as well. I'm not sensationalizing anything, but giving my personal experience working in both types of languages. Vast majority of people who have prefer the functional approach. Pretty much the only people who argue against it are the ones who've have little to no experience working with FP.

1

u/afrobee Feb 23 '15

What context could that statement possibly need.

So pretty much you don't even consider the scope of your claims. Because you are alleging things like they where the absolute true for every possible context, and not your experienced context, which is the rational thing to assume. My view.

My current project has been in development by 4 people for 3 years now. So, not exactly what I would call tiny.

So in conclusion, you are basing your claims on your own individual context, yet you express them as there were absolute and irrefutable applicable out of your own scope to everyone else(How do I know this? I see your propaganda even on my soup).

You can either have an honor system that you refer to as best practice or have the language do that work for you. I certainly prefer the latter myself.

What is this holy grail, that magically happens to enforce best practices upon inexperience people? I want to know, but I think I already know the answer, Ain't I?

I could go on as well. I'm not sensationalizing anything, but giving my personal experience working in both types of languages. Vast majority of people who have prefer the functional approach. Pretty much the only people who argue against it are the ones who've have little to no experience working with FP.

Who are this people and in what is context they belong so I can get a reference if they are really the "the vast majority"?

Mutability is an insane default in my opinion.

I would be less confused if you suffix all your statement with that or something alike.

2

u/yogthos Feb 23 '15

So pretty much you don't even consider the scope of your claims. Because you are alleging things like they where the absolute true for every possible context, and not your experienced context, which is the rational thing to assume. My view.

The claim is very general and simple to understand. Reasoning about local scope is easier than reasoning about global scope. I honestly cannot understand how anybody could find this statement controversial.

So in conclusion, you are basing your claims on your own individual context, yet you express them as there were absolute and irrefutable applicable out of your own scope to everyone else(How do I know this? I see your propaganda even on my soup).

Of course I'm basing these claims on my subjective experience, and if that's where things ended then it would be a pretty weak claim. However, plenty of other companies are using Clojure and overwhelmingly have same feedback. Here's one such example for you. A quick google will show plenty of others.

I honestly do not understand why this is making you upset. If you don't like Clojure nobody is forcing you to use it, and Java is not going to go away either. You can use whatever language you like, it's not a zero sum game.

What is this holy grail, that magically happens to enforce best practices upon inexperience people? I want to know, but I think I already know the answer, Ain't I?

Wow great straw man there. Nobody claims FP is a silver bullet here, but yes it would make it easier for an inexperienced person to write better code. In fact one of the most common things people say after working with FP is that it makes them think about state more carefully, something even experienced imperative developers often fail to do.

Who are this people and in what is context they belong so I can get a reference if they are really the "the vast majority"?

Do you even google?

I would be less confused if you suffix all your statement with that or something alike.

I figured people would understand minimal context, but maybe that's too much to expect from imperative developers. :P

1

u/afrobee Feb 23 '15

The claim is very general and simple to understand. Reasoning about local scope is easier than reasoning about global scope. I honestly cannot understand how anybody could find this statement controversial.

Yeah, I agree with you, but I didn't know that using global scope was the default mantra in OOP design or other paradigms.

I honestly do not understand why this is making you upset. If you don't like Clojure nobody is forcing you to use it, and Java is not going to go away either. You can use whatever language you like, it's not a zero sum game.

I'm not, you should see this as free entertainment, an amusement and a opportunity to learn more for myself. Even I really like Clojure. There is not need to bring up Java here ;)

In fact one of the most common things people say after working with FP is that it makes them think about state more carefully, something even experienced imperative developers often fail to do.

As with most OOP and DOD programmers then to learn too. Also, I don't why you have this idea that declarative style is exclusive to FP languages.

Do you even google?

I wouldn't even know which keywords to search for such data :( Any insight?

I figured people would understand minimal context, but maybe that's too much to expect from imperative developers. :P

As with most of your statements, their base is composed by your own selective and invented assumptions. I then to prefer more declarative style. Regardless of that, where you trying to bug on me with that comment? Cute :)

0

u/yogthos Feb 23 '15

Yeah, I agree with you, but I didn't know that using global scope was the default mantra in OOP design or other paradigms.

The problem is specifically with passing around references to shared mutable data. There is no way to know whether calling a method will produce side effects or not. Maybe the method call was safe or maybe it wasn't I have no way to tell without looking inside and tracing exactly what it's doing.

My experience is that this quickly leads to subtle bugs in non-trivial applications. Somebody calls a method and thinks it does one thing while it does another. It might even appear to work as expected until you find out that another part of the application starts behaving oddly.

I wouldn't even know which keywords to search for such data :( Any insight?

Oh I don't know clojure success stories might be a good one. Clojure underbudget, using Clojure at MixRadio, Why Prismatic goes faster with Clojure, CircleCI Clojure, Clojure at Netflix, and so on and so forth.

As with most of your statements, their base is composed by your own selective and invented assumptions. I then to prefer more declarative style. Regardless of that, where you trying to bug on me with that comment? Cute :)

They're not assumptions, they're my direct experiences working with the language. I just linked you a whole bunch of experiences from others working with it as well.

1

u/afrobee Feb 23 '15

Oh I don't know clojure success stories might be a good one. Clojure underbudget, using Clojure at MixRadio, Why Prismatic goes faster with Clojure, CircleCI Clojure, Clojure at Netflix, and so on and so forth.

Hahaha, oh my goodness, I request about FP in general, you are pretty much a Clojure head which is something that I already knew, but is cutest and funny thing ever.

They're not assumptions, they're my direct experiences working with the language. I just linked you a whole bunch of experiences from others working with it as well.

On that endpoint, I was talking about the assumption that you had about my persona (programming style preference).

My experience is that this quickly leads to subtle bugs in non-trivial applications. Somebody calls a method and thinks it does one thing while it does another. It might even appear to work as expected until you find out that another part of the application starts behaving oddly.

Now we are having a better manners. And your theory as anything else will be distilled to the ambiguity of the phrase "it depends".

1

u/yogthos Feb 23 '15

I'm not sure what point you're making here really. It's like a big discovery for you that people's views are subjective, nobody's ever been pretending otherwise.

I think your persona is pretty clear, trolling is your true calling. :)

→ More replies (0)