Hacker News new | ask | show | jobs
by deltasevennine 1304 days ago
You did argue for everything is the same. Basically by "same" I mean everything is "equally good" depending on context. The whole hammers are for hammering and screwdrivers are for screwing thing... I explicitly said your argument was that everything was a tool in a toolbox and you exactly replicated what I said.

My point is: something can be truly bad and something can be truly good EVEN when considering all possible contexts.

You can't prove definitively whether this is the case for FP or OOP or any programming style for that matter. You can't know whether someones "side" is a cargo cult or not when there's no theoretical way for measuring this.

The cultish following may even be correct in the same way I cargo cult my belief that the world is ROUND and not flat.

2 comments

> My point is: something can be truly bad and something can be truly good EVEN when considering all possible contexts.

No, that's impossible. "Truly good" or "truly bad" are moral categories. Something closely related to religion, BTW…

> You can't know whether someones "side" is a cargo cult […]

Of course I can.

If it objectively makes no sense (in some context), and is only blindly copied from somewhere else without understanding why there things were done the way they were done, this is called "cargo cult". That's the definition of this term.

How can I tell whether there is no understanding behind something? If the cultists would understand what they are actually copying they wouldn't copy it at all. ;-)

Replacing methods with free standing functions is for example on of such things: In Haskell there are no methods. So free standing functions are all you have. But imitating this style in a language with methods makes no sense at all! It complicates things for no reason. This is obviously something where someone does not understand why Haskell is like it is. They just copy on the syntax level something that they think is "functional programming". But surface syntax should not be missed for the actual concepts! Even it's easy to copy the syntax instead of actually adapting the ideas behind it (only where it makes sense of course!).

>No, that's impossible. "Truly good" or "truly bad" are moral categories. Something closely related to religion, BTW…

Wrong. Good and bad is used in a fuzzy way here, I'm OBVIOUSLY not talking about morality OR religion. What I am talking about are things that can be potentially quantified to a formal theory. For example we know the shortest distance between two points is a line. We have formalized algorithmic speed with computational complexity theory. O(N) is definitively more "good" then O(N^2).

Right now we don't have optimization theory or formal definitions on logic organization. We can't quantify it so we resort to opinionated stuff. And the whole thing goes in circles. But that is not to say this is impossible to formalize. We just haven't yet so all arguments go nowhere. But the shortest distance between two points? Nobody argues about that (I hope some pedantic person doesn't bring up non-euclidean geometry because come on).

All we can say right now is because there is no theory, nothing definitive can be said.

>Of course I can. >If it objectively makes no sense (in some context), and is only blindly copied from somewhere else without understanding why there things were done the way they were done, this is called "cargo cult". That's the definition of this term.

You can't. The definition of bias is that the person who is biased is unaware of it. You can talk with every single religious person in the world. They all think they arrived at their beliefs logically. Almost everyone thinks the way they interpret the world is logical and consistent and it makes sense. They assume everyone else is wrong.

To be truly unbiased is to recognize the possibility of your own fallibility. To assume that your point of view is objective is bias in itself. You ask those people who "blindly" copy things if they did it blindly, they will tell you "No." They think they're conclusions are logical they don't think they're blind. The same way you don't think your blind, the same way I don't think I'm blind. All blind people point at other blind people and say everyone else is blind except for them.

The truly unbiased person recognizes the possibility of their own blindness. But almost nobody thinks this way.

Nobody truly knows who is blind and who is not. So they argue endlessly and present factoids to each other like this one here you just threw at me:

"Replacing methods with free standing functions is for example on of such things: In Haskell there are no methods. So free standing functions are all you have. But imitating this style in a language with methods makes no sense at all! It complicates things for no reason. This is obviously something where someone does not understand why Haskell is like it is. They just copy on the syntax level something that they think is "functional programming". But surface syntax should not be missed for the actual concepts! Even it's easy to copy the syntax instead of actually adapting the ideas behind it (only where it makes sense of course!)."

I mean how do you want me to respond to this factoid? I'll throw out another factoid:

Forcing people to use methods complicates things for no reason. Why not just have state and logic separated? Why force everything into some horrible combination? If I want to use my method in another place I have to bring all the state along with it. I can't move my logic anywhere because it's tied to the contextual state. The style of the program itself is a weakness and that's why people imitate another style.

And boom. What are you gonna do? Obviously throw another factoid at me. We can pelt each other with factoids and the needle doesn't move forward at all.

> Forcing people to use methods complicates things for no reason.

No, it doesn't.

All functions are in fact objects and most are methods in JavaScript, and there is nothing else.

Methods (== properties assigned function object values) are the natural way to express things in JavaScript.

Trying to pretend that this is not the case, and trying really hard to emulate (free) functions (which, to stress this point once more, do not exist in JavaScript) makes on the other hand's side everything more complicated than strictly needed.

> Why not just have state and logic separated?

That's a good idea.

This is also completely orthogonal to the question on how JavaScript is supposed to be used.

JavaScript is a hybrid langue. Part Small Talk, part Lisp.

It's common in JavaScript since inception to separate data (in the form of objects that are serializable to and from JSON) from functionality (in the form of function objects).

JavaScript was never used like Java / C++ / C#, where you glue together data and functionality into classes, and still isn't used like that (nevertheless they've got some syntax sugar called "class" at some point).

> Why force everything into some horrible combination?

Nobody does that. At least not in JavaScript.

Still that does permit to use methods.

Functions themself are objects. Using objects is the natural way for everything in JavaScript as there is nothing else than objects. Everything in JavaScript is an object. And any functionality the language provides is through methods.

Working against the basic principles of a language is a terrible idea! (In every language, btw). It complicates everything for no reason and has horrible code abominations as a consequence.

> If I want to use my method in another place I have to bring all the state along with it.

No, you don't. You need only to bring the data that you want to operate on.

The nice thing is: You get the functionality right at the same place as the data. You don't need to carry around anything besides the data that you work on.

The alternative is needing to bring the modules that carry the functionality that you want to apply to the data you need also to have around… As an example: `items.map(encode)` is nicer to write and read than `List.map items encode`.

You don't need to carry around the `List` module when the method can already be found on the prototype of the data object. Also it's more clear what's the subject and what's the object of the operation.

> I can't move my logic anywhere because it's tied to the contextual state.

That's just not true in JavaScript.

Nothing is easier then passing functions objects around, or change the values of properties that reference such function objects.

JavaScript is one of the most flexible languages out there in this regard!

You can even rewrite built-in types while you process them. (Not that I'm advocating for doing so, but it's possible).

> The style of the program itself is a weakness […]

You did not present any facts that would prove that claim.

> […] that's why people imitate another style.

No, that's not the reason.

You don't need to imitate Haskell when you want to write functional programs in a Lisp derived language… ;-)

People are obviously holding some cargo cult ceremonies when trying to write Haskell in JavaScript.

Your other opinions are based on wrong assumptions. I'm not going into that in detail, but some small remarks:

> For example we know the shortest distance between two points is a line.

In Manhattan¹? ;-)

> O(N) is definitively more "good" then O(N^2).

Maybe it's more "good"…

But it's for sure not always faster, or even more efficient, in reality.

Depending on the question and your resources (e.g. hardware) a brute force solution may be favorable against a solution with a much lower complexity on paper.

Welcome to the physical world. Where practice differs from theory.

> But the shortest distance between two points? Nobody argues about that (I hope some pedantic person doesn't bring up non-euclidean geometry because come on).

You don't need to look into non-euclidean geometry.

Actually, even there the shortest distance between two points is a "straight line". Only that the straight line may have some curvature (because of the curved space).

But you didn't even consider that "distance" is actually something² about that one can actually argue…

> You can't. The definition of bias is that the person who is biased is unaware of it.

No, that's not the definition³.

> Nobody truly knows who is blind and who is not.

Nobody truly knows anything.

What's the point?

What was actually the point of your comment, btw?

---

¹ https://en.wikipedia.org/wiki/Taxicab_geometry ² https://en.wikipedia.org/wiki/Distance ³ https://en.wikipedia.org/wiki/Bias

>No, that's not the definition³.

It is, I just worded it differently. See the "cognitive biases" part on your citation. They use "reality" in place of what I mean by "unaware". If you think something incorrect is reality, then you are "unaware" of how incorrect your thinking is, because you think it's reality. These are just pedantic factoids we're throwing at each other.

>What was actually the point of your comment, btw?

The point is that FOR PROGRAMMING, nobody truly knows which camp is the cargo cult. Everyone is blind. Stick with the program.

>Welcome to the physical world. Where practice differs from theory.

This is called pedantism. Like did you really think you're telling me something I'm not aware about? Everyone knows this. But the pedantic details of the optimizations the compiler and the CPU goes through to execute code is besides the point, obviously I'm not referring to this stuff when I'm trying to convey a point.

>In Manhattan¹? ;-)

Your again just being pedantic. I'm perfectly aware of non-euclidean geometry, but you had to go there. I had a point, stick to the point, pedantism is a side track designed to muddy the conversation. Why are you muddying the conversation?

Is it perhaps that you're completely and utterly wrong and you're trying to distract me from that fact?

>Trying to pretend that this is not the case, and trying really hard to emulate (free) functions (which, to stress this point once more, do not exist in JavaScript) makes on the other hand's side everything more complicated than strictly needed.

Bro, my little paragraph arguing against you was just a random factoid. I don't care for your argument and I don't even care for mine. The whole main point is to say that we can endlessly spew this garbage at each other the needle doesn't move forward at all. Nobody can win, because we have no way of establishing an actual winner. Thus with no way of knowing who's right there's no POINT in it.

All I am saying and this is the heart of my argument, is that YOUR topic, your team of "don't be a cargo cult" is no different from all the other teams.

I thought I made that obvious that my factoid was sarcastic, but you fell for that quick and instantly retaliated with your own factoid. Man Not gonna go down that rabbit hole.

> Is it perhaps that you're completely and utterly wrong and you're trying to distract me from that fact?

I think you miss the whole point of this website!

I've had never before to flag here something. Now you force me to do it again. That makes me really sad right now.

But you're constantly only trolling. Continue elsewhere, please.

The point is to learn. You know I'm not trolling.

What I said was true. You were going off on tangents. It's the only logical conclusion.

"You did argue for everything is the same."

I do not see where he did that. He argued simply that context matters. (And yes a "bad" tool can be the right tool, if it is the only tool avaiable.)

"My point is: something can be truly bad and something can be truly good EVEN when considering all possible contexts."

And diving deeper into philosophy here, can you name one example?

Not deltasevennine, but giving the CPU fewer things to do sounds good to me (in any context), even if it is currently unpopular. Some cults are popular and some aren't.
"Not deltasevennine, but giving the CPU fewer things to do sounds good to me (in any context)"

Ah, but what if you are freezing and that CPU is your only heat source ...

>I do not see where he did that. He argued simply that context matters. (And yes a "bad" tool can be the right tool, if it is the only tool avaiable.)

Well I see it. If you don't see it, I urge you to reread what he said.

A bad tool can be the right tool but some tools are so bad that it is never the right tool.

>And diving deeper into philosophy here, can you name one example?

Running is better then walking for short distances when optimizing for shorter time. In this case walking is definitively "bad." No argument by anyone.

Please don't take this into a pedantic segway with your counter here.

"Running is better then walking for short distances when optimizing for shorter time"

Yeah, but then the context is optimizing for shorter time. You said context does not matter. But it always does. And depending on the greater context, there would be plenty of examples where running is not adequate, even when optimizing for short time, because maybe you don't want to raise attention, you don't want to be sweaty when you reach the goal, or then your knee would hurt again, etc.

Is this pedantic, well yes, but if you make absolutistic statements then this is what you get.

But again, no one here ever said, it is all the same. It was said that it is always about context, to which I agree.

When you only have a low quality tool avaiable, or your people only trained in that low quality tool(and no time to retrain), than this is still the right tool for the job.

What's wrong with absolutist statements? Nothing.

I made an absolutist statement which is definitely true. You failed to prove it wrong. Instead you had to do the pathetic move of redefining the statement in order to get anywhere. You weren't pedantic, you changed the entire subject with your redefinition.

As for context I am saying I can make absolute statement about things and this statement is true for all contexts.

My point for this entire thread is that I can say OOP is horrible for all contexts and this statement cannot be proven wrong. Neither can the statement OOP is good for all contexts or OOP is good for some contexts. All of these statements are biased.

If you were to be pedantic here you would be digging into what context means. You might say if the context was that everyone was trained on OOP and not fp then oop is the superior choice. To which I respond by context I mean contexts for practical consideration. If you can't figure out what set of contexts lives in that set for "practical consideration" then you are just too pedantic of a person for me to have a reasonable conversation with.

There are shit paradigms out there, shit design patterns and shit programming languages. But without proof this is an endless argument. You can't prove your side either, you're just going to throw me one off examples to which I can do the same. No point. I'm sorry but let's end it here, I don't want to descend further into that rabbit hole of endless qualitative arguments.

"I made an absolutist statement which is definitely true."

Well, if you think so, then consider yourself the tautological winner.

In your universe nobody wins. Nothing is true, nothing is false. Consider yourself the ultimate loser.