News for hackers. Stuff that matters.
Re:Learning from the Object Oriented Mania by palata on Wednesday May 15, 2024 @04:08AM (#40364312)
Is it a poor take against object oriented, or some half-hidden criticism of the use of masks during the Covid-19 pandemic?

For the former, then I would expect a computer science professor to do better than just bashing the concept. When is it good, and when is it bad? What did it bring to programming languages?

For the latter, I would expect a computer science professor to know that epidemiology is not their thing and they should refrain from concluding "stuff" from a scientific paper they found.

Re:Learning from the Object Oriented Mania by jjgreen on Wednesday May 15, 2024 @04:38AM (#40364514)
I'm curious, isn't the point of scientific papers for experts to give some information to non-experts?
Re:Learning from the Object Oriented Mania by palata on Wednesday May 15, 2024 @05:17AM (#40364712)
No. That would be "popularization", I believe, and that is not done by scientific papers.

The point of scientific papers is for experts to share observations with other experts. Given enough studies, a group of experts may reach a consensus. Believing that a single study "proves" anything at all is a big misunderstanding of how science works. A single study "suggests" something, but the goal is to reach a consensus.

In this particular case, a computer science professor who is (apparently) not at all an expert in epidemiology throws sarcasm against an emergency response to Covid-19 for no apparent reason (unless object-oriented was an emergency response to some virus, I don't know).

What this computer science professor could do (but doesn't), though, is bring insights related to their expertise (presumably "computer science"). I mean something other than "object oriented == baaaaad, believe me".

Re:Learning from the Object Oriented Mania by jjgreen on Wednesday May 15, 2024 @06:19AM (#40365042)
University libraries should take journals out of the main library and move them to the relevant departments, we'll put a stop to this interdisciplinary nonsense (A sociologist reading an engineering journal, imagine!)
Re:Learning from the Object Oriented Mania by palata on Wednesday May 15, 2024 @08:37AM (#40366100)
What you are doing here is called manipulation: you rephrase what I said ("a computer science professor should not throw a link to a study as a justification for unnecessary sarcasm in an article with an authoritative tone") and push it to the extreme ("universities should forbid people to read articles in domains where they are not experts").

I am pretty sure you understood what I meant: it is a poor take in terms of computer science (which I find disappointing coming from a "computer science professor") that includes unnecessary bashing at a completely unrelated measure.

Re:Learning from the Object Oriented Mania by mike_hearn on Thursday May 16, 2024 @04:13AM (#40376200)
> The point of scientific papers is for experts to share observations with other experts

If that were the case there'd have been no open access movement, and papers wouldn't even exist at all, just discussions in conference halls and private listservs. The point of scientific papers is to disseminate knowledge and findings as widely as possible. This is the first time I've seen anyone explicitly argue otherwise, in fact.

> Believing that a single study "proves" anything at all is a big misunderstanding of how science works

If a single paper is done correctly then it can in fact prove things. History is full of examples like that. Again, the idea that science is all about consensus is just wrong - it's an idea modern academics cling too far too regularly but it's simply not true. Einstein himself said that!

Re:Learning from the Object Oriented Mania by palata on Thursday May 16, 2024 @06:17AM (#40376768)
> If that were the case there'd have been no open access movement

Open access means that people don't need to be researchers at Harvard to have access to science. You can be an expert without being rich or without working in a rich university. I won't address the last part of the sentence because it is preposterous.

> The point of scientific papers is to disseminate knowledge and findings as widely as possible. This is the first time I've seen anyone explicitly argue otherwise.

Sure it is! But the target audience of a paper is quite obviously other experts in the field.

> If a single paper is done correctly then it can in fact prove things. History is full of examples like that.

Well of course, it can happen: a mathematical proof does not need consensus. But a study about the efficiency of masks in preventing Covid-19 is extremely different. If you are not convinced, try to read the study in question. The tone there explicitly shows that there is no certainty: they contribute valuable information, but it's not a definitive proof.

Not to mention that even if we could say today that masks were not effective, it does not mean that back then it was a ridiculous decision. Back then we did not know exactly how Covid-19 was propagating, so it seemed reasonable to wear masks.

Re:Learning from the Object Oriented Mania by mike_hearn on Thursday May 16, 2024 @08:22AM (#40377436)
> Open access means that people don't need to be researchers at Harvard to have access to science

It means they don't need to be in academia at all. That is the explicit goal of open access.

> But the target audience of a paper is quite obviously other experts in the field.

It doesn't matter who academics would like their audience to be, the actual audience is anyone who needs or wants to read it. That's why they get given grants and why the open access movement was created.

> Not to mention that even if we could say today that masks were not effective, it does not mean that back then it was a ridiculous decision

Remember that at the start, all the 'experts' were happy to say masks would have no effect! If you dig in and look at why they were saying that, it's because masks would have no effect (and didn't). Their step change came after political pressure to agree to masking both from within and without, which they just immediately acquiesced to apparently due to the strange belief that such things don't have any downsides. All this has been well documented.

I read a lot of mask and epidemiology papers during COVID. They were all terrible. Standards in computer science are much higher, so this belief that Lemire shouldn't be allowed to have opinions is kind of entertaining.

Re:Learning from the Object Oriented Mania by palata on Thursday May 16, 2024 @08:54AM (#40377757)
Open access means "people should not have to pay to access science". It does not mean that a 10 years old should be able to understand it all. I think we agree on this, I am not sure what point you are trying to make.

> Remember that at the start, all the 'experts' were happy to say masks would have no effect!

You are oversimplifying. At the start, we did not know if it was propagating with droplets or through the air. Masks do stop big droplets and are effective in that case. It seems like it was not so much droplets in the end, so the efficiency of the masks was limited (but I don't think you can conclude it was zero). But also let's not forget how stupidly people were behaving during the pandemic. It went further than just knowing how the virus was propagating: there was a whole part about people's behavior.

> I read a lot of mask and epidemiology papers during COVID. They were all terrible. Standards in computer science are much higher

Let's be honest: most papers are terrible. Maybe you're biased because you know how to select good papers in computer science (or maybe you understand epidemiology better than computer science :-)), but most papers are terrible everywhere. That's why it takes expertise to make sense of them: if you just blindly trust whatever you read because it looks like a scientific paper, then you're in a bad position.

> so this belief that Lemire shouldn't be allowed to have opinions is kind of entertaining.

I don't have any idea of the quality of Lemire's work. This particular article doesn't show anything interesting IMO, though. Also I did not say Lemire was not allowed to have opinions. Just that when you are in a position of authority (a professor in a university), you should know better than to just throw a link to a paper together with a half-baked opinion.

Re:Learning from the Object Oriented Mania by jqpabc123 on Wednesday May 15, 2024 @08:49AM (#40366213)
When is it good, and when is it bad?

Good question. OOP seperates software into isolated units called "objects". But in order to function as a cohesive whole, these units have to communicate somehow. And this is usually where the fun begins.

OOP intentionally turns all software into a distributed system --- even if it is not distributed.

Whether there is any real advantage to this is a matter of opinion --- it can't be proven one way or the other. But in my experience with distributed systems, it is often less efficient and more difficult to see and reason about the logic flow and harder to debug and test. Your mileage may vary.

Re:Learning from the Object Oriented Mania by palata on Wednesday May 15, 2024 @09:44AM (#40366881)
> OOP intentionally turns all software into a distributed system --- even if it is not distributed.

Could you elaborate on that? And would you say for instance that Rust suffers from the same problems? Because Rust offers many characteristics of OOP.

Re:Learning from the Object Oriented Mania by jqpabc123 on Wednesday May 15, 2024 @10:20AM (#40367315)
Could you elaborate on that?

Distributed systems typically rely on messaging passing to some sort of "interface" in order to communicate and coordinate actions with remote nodes. Objects work much the same way and are designed to mimic the characteristics of an independent, remote computer node.

This can be done in any language that offers encapsulation of data, methods and state.

Re:Learning from the Object Oriented Mania by kaba0 on Thursday May 16, 2024 @03:35AM (#40376047)
> OOP intentionally turns all software into a distributed system

OOP does have a message-passing version, but even though the coiner of the term prefers this version, no one in the industry used it that way.

The industry settled on method calls as the primary channel for these messages, which are most of the way a form of synchronous communication on the same thread, quite far from being a distributed system.

Object `a` calling a method from object b’s public API is not a distributed system at all. And while I do agree that this cohesive whole is not necessarily represented in OOP, one solution is to create an object over the whole, that itself upholds the necessary conditions/order/etc between its subcomponents, exposing only a higher level API to the outside world, and making those subcomponents otherwise inaccessible.

Re:Learning from the Object Oriented Mania by mrkeen on Thursday May 16, 2024 @05:05AM (#40376444)
I think there's more in common than you give credit for.

What is the fundamental difference between a 'method call' and a 'message pass'?

In both scenarios, you can be synchronous or asynchronous, blocking or non-blocking, remain on one thread (technically 2 if it's across a network) or fork out into multiple threads. You can wait for a result, or you can fire-and-forget (void). A networking problem is just another kind of Exception.

Even in a typical microservice codebase, it's not immediately apparent from reading the code whether userService.createUser() will call across a network, or just into another class.

The only fundamental difference I can think of right now is that in a non-networked system, you can be pretty sure your static typing holds for the whole program, whereas in a networked system, your types might drift between versions.

But again, more similarities than differences.

Re:Learning from the Object Oriented Mania by kaba0 on Thursday May 16, 2024 @05:17AM (#40376503)
I think the similarity is more like a mathematical/structural one, and doesn’t hold much water in a pragmatic sense. The possible error conditions for a network call are just insanely bigger than of a function call.

Also, Smalltalk and alia of the “real OOP” kind has some extremes with regards to messaging, like the number 3 being told to increase itself by one, which would not be done this way in today’s OOP languages and not just for performance reasons.

Method calls are more of a degenerate case of a distributed system, which is significantly easier to reason about.

Re:Learning from the Object Oriented Mania by piva00 on Thursday May 16, 2024 @04:45AM (#40376369)
Distributed systems have other issues that are unrelated to message passing. Message passing is just a protocol for them to communicate but it's not what creates most issues with distributed systems like networking, state management, etc.

OOP turns software into a message passing architecture, which definitely has its advantages if the software you need to write fits well into its compartmentalisation features.

Like you mention (and as with almost anything with software development) it's a trade-off, reasoning about the logic flow can be harder if the design of the OOP software is too convoluted but the same is absolutely true for a badly designed C code with function calls, I don't think OOP itself makes software harder to reason about but it has footguns with its features to make code unreadable through layers of indirection/delegation, badly designed inheritance models (which I tend to avoid nowadays, I really prefer composition over inheritance for most cases), etc.

Re:Learning from the Object Oriented Mania by polotics on Thursday May 16, 2024 @05:15AM (#40376490)
OOP implicitly says it is ok to have stateful information all over the place in your code: if it's in an object, then it must be OK...

This is my main beef with OO: a good design will have good clean statefulness, and getting there is completely orthogonal to how much object-orientation you got.

Re:Learning from the Object Oriented Mania by okaleniuk on Thursday May 16, 2024 @04:31AM (#40376294)
Neither.

"The lesson you should draw is not that object-oriented is bad, but rather that whatever is the current trendy technique and trendy idea, is likely grossly overrated."

Re:Learning from the Object Oriented Mania by palata on Thursday May 16, 2024 @07:07AM (#40377025)
Right ok. It's just two opinions: "be careful with trends" and "I don't like masks".

It just felt like it was meant as an analysis: "Learning from ..." and "The lesson you should draw is ...". But that is not what it is.

Re:Learning from the Object Oriented Mania by DeathArrow on Thursday May 16, 2024 @04:36AM (#40376323)
> Is it a poor take against object oriented

Why do you think it is a poor take? What are your views on OOP?

Re:Learning from the Object Oriented Mania by palata on Thursday May 16, 2024 @07:02AM (#40376988)
I think it is a poor take because it says almost nothing and it justifies nothing. It could fit in a tweet: "Beware of hypes. Oh and I was against masks during the pandemic".

It's called "Learning from the Object Oriented Mania", but what did we learn exactly? Would the industry be in a better place if all languages looked a lot more like C? Or maybe Haskell? Does Rust count as OOP or not? Was Object Oriented an unjustified trend, or was it a "natural" evolution of languages?

That last question is actually similar to the mask question: was it indeed stupid to ask people to wear masks, or did it make sense at the time, given our understanding at the time? But the article misses on this opportunity by just bashing at the masks without going any further.

> What are your views on OOP?

My view (which I wouldn't consider informed enough to be a blog post) is that modern languages like Rust mostly drops class inheritance, but other than that they look a lot more like Java/C++ than C. And that's the new "trend": dropping class inheritance, "Composition over inheritance". Which is a fair point: class inheritance can have issues. In some cases it actually does make sense, but languages like Rust decide not to allow it (I guess partly to avoid "footguns" and partly for performance reasons).

But the idea of encapsulation in an object is there in the most popular modern languages. If the concept of calling `my_list.is_empty()` instead of `is_empty(my_list)` is "OOP", then I think it is actually still very much in fashion and for good reasons.

Re:Learning from the Object Oriented Mania by Tomis02 on Thursday May 16, 2024 @09:19PM (#40385344)
> But the idea of encapsulation in an object is there in the most popular modern languages.

Encapsulation is not specific to OOP at all. C is not OOP and yet it has encapsulation just fine.

> If the concept of calling `my_list.is_empty()` instead of `is_empty(my_list)` is "OOP", then I think it is actually still very much in fashion and for good reasons.

You're absolutely right, it's fashion.

> And that's the new "trend": dropping class inheritance, "Composition over inheritance".

New trend, huh? You realise that that saying came out 30 years ago? It took that long for the brainwashed OOP masses to even acknowledge that inheritance is bad.

Re:Learning from the Object Oriented Mania by urduntupu on Thursday May 16, 2024 @06:00AM (#40376697)
It's his blog an his opinion. I liked his side kick on the masks mandate and thanked him for that via email.
Re:Learning from the Object Oriented Mania by EuAndreh on Saturday May 18, 2024 @09:21AM (#40398821)
A dog-whistle camouflaged by criticism of OOP since it is out-of-fashion.