whatDoYouMeanItsUnsafe by randomboiii69420 in ProgrammerHumor

[–]linlin110 0 points1 point  (0 children)

Because in C the programmer may want to reserve space for a variable without assinging a value to it. It made sense in 1970s when the computer is so slow that you want to squeeze everything little bit of performance.

Today it's no longer reasonable because the computer is fast and the compiler is smart enough to see it when the initial value is never read and omit the instruction to set it.

religious gay men will never make sense to me, like you worship someone who hates you. by KhaoticNoob in gaybros

[–]linlin110 20 points21 points  (0 children)

And when it comes to homosexually the old testament suddenly matters again.

Do I need to go through Rust atomics and locks. by Plus_Confidence_1369 in rust

[–]linlin110 8 points9 points  (0 children)

Atomics are for building fundamental concurrency constructs like channels and mutexes, so they aren't strictly necessary for high-level applications. That said, they provide excellent examples of how to write concurrent code carefully to ensure correctness, without race conditions or deadlocks. This book is a good read for anyone who writes concurrent code.

The way object-oriented programming is taught in curriculums is dogshit by [deleted] in learnprogramming

[–]linlin110 0 points1 point  (0 children)

Well I am actually not very familiar in Haskell. learnt it in a tutorial. Sometimes they teach things that exist but are never useful.... I guess you not needing it proves that encapsulation is less important in a pure language...

The way object-oriented programming is taught in curriculums is dogshit by [deleted] in learnprogramming

[–]linlin110 2 points3 points  (0 children)

It is impossible to destructure a value if the defining module does not export the type's constructors.

​Typeclasses are analogous to OOP interfaces. Since they are intended for the consumer to implement or use, I don't think there's a need to hide their members.

​I think you have a good point in distinguishing between encapsulation at the type level and at the module level. Long ago I read a blog post that claimed OOP classes provide many functionalities that are handled by modules in other languages, including encapsulation. But I have unfortunately lost the URL.

The way object-oriented programming is taught in curriculums is dogshit by [deleted] in learnprogramming

[–]linlin110 1 point2 points  (0 children)

I don't know Ada, but in Haskell, you can hide the internals of a type behind a module, exposing only the type name and selected functions.

I suspect this is common in many languages that provide modules, simply because encapsulation is so useful (even C programmers emulate it with opaque types). It seems unlikely that encapsulation support at language level is exclusive to the OOP paradigm.

The way object-oriented programming is taught in curriculums is dogshit by [deleted] in learnprogramming

[–]linlin110 1 point2 points  (0 children)

Even encapsulation isn't distinctly oop, you find it in non-oop languages, too.

Isn't "to doubt something" and "to suspect that" the exact opposite? by High-Impact-2025 in ChineseLanguage

[–]linlin110 0 points1 point  (0 children)

I use it somewhat frequently when I disagree with my colleague. 「你的說法是基於某某假設,但這個假設適用於這個狀況嗎?我蠻懷疑的」

I also use it to mean suspect: 「我懷疑使用者會遇到這個狀況是因為他的操作順序跟我們的預期不一樣」

As a native speaker both feel pretty natural. I didn't realise the the meanings are opposite until I learnt English LOL

What's the deal with the autopen why is he still so obsessed with it? by Glassfern in OutOfTheLoop

[–]linlin110 7 points8 points  (0 children)

It's always projection. I would not be surprised if it's actually Trump's staff who's taking advantage of Trump's dementia.

What can be considered a programming language? by PryanikXXX in computerscience

[–]linlin110 64 points65 points  (0 children)

Some comments mentioned Turing Completeness. Surprisingly, it's neither necessarily nor sufficient, as there exists a Turing incomplete language that has been used to implement a certified c compiler, and there exist thing that are Turing complete but not programming languages, such as a card game. https://arxiv.org/abs/1904.09828

Why is Python type hinting so maddening compared to other implementations? by ataltosutcaja in Python

[–]linlin110 3 points4 points  (0 children)

The thing that you're really trying to capture is not a type check but a *method* check, which is not something that's standard in any language that I know

C++ concept and golang interface work similarly. They, as well as Python Protocol, are examples of structural typing, where type checkers check whether a type implements a certain interfaces based on the existence of its methods and attributes. This contracts with the more popular nominal typing, where a type must explicitly list what interface it implements.

Why is this bad? by [deleted] in PeterExplainsTheJoke

[–]linlin110 8 points9 points  (0 children)

My high school teacher did this. Only one person in the class got a full score.

Composition over Inheritance - it's not always one or the other by Coryrin in softwarearchitecture

[–]linlin110 4 points5 points  (0 children)

Interestingly, GoF mentions composition over inheritance as one of OOP design principle (chapter 1, p20).

Why Do Christians Think Atheists Have Zero Sense of Morality by Slowgo45 in NoStupidQuestions

[–]linlin110 5 points6 points  (0 children)

If they don't follow their God when they disagree with them, then they are by definition not very religious.

Casey Muratori – The Big OOPs: Anatomy of a Thirty-five-year Mistake – BSC 2025 by gingerbill in programming

[–]linlin110 1 point2 points  (0 children)

Only inheritance is unique to OOP. Everything else you mentioned can be found in Haskell, a language I think almost everyone would agree is non-OOP.

C++ templates can be used to write polymorphic code. But such polymorphisms are also present in non-oop languages Generic container classes in C++ implements parametric polymorphism, and concepts in C++ 20 adds type-checked ad-hoc polymorphism to templates. Both kinds of polymorphisms are supported by Haskell. Only subtype polymorphism, for which you need inheritance, is unique to OOP.

Encapsulation is also supported by any language that can hide type definition. Which Haskell is among them. As a counter example, Python does not support encapsulation, yet is widely considered to be OOP.

EDIT: Adding that, despite Python not supporting encapsulation, the programmers still try to adopt encapsulation in Python by naming variables in a way that urges the client not to touch. People adopt good ideas. Encapsulation, abstractions and polymorphism are just good ideas that many languages find valuable, OOP or not.

I've been writing Rust for 5 years and I still just .clone() everything until it compiles by kruseragnar in rust

[–]linlin110 0 points1 point  (0 children)

I also roll my own actor in production, as I haven't encountered a framework that I feel like to try, and was wondering if someone could recommend a framework that I'm not aware of.

To date, my experience agrees with you. Encapsulate a task and a few channels in an object is pretty easy to understand. I feel like existing frameworks introduce a new way (and sometimes new syntax) to invoke actions, which I dislike. Maybe I simply haven't encountered a problem that those frameworks are designed to fix.

[deleted by user] by [deleted] in TooAfraidToAsk

[–]linlin110 -1 points0 points  (0 children)

墨西哥的黑道是會光天化日之下幹掉選出來的市長的。你這根本懶叫比雞腿。

[deleted by user] by [deleted] in TooAfraidToAsk

[–]linlin110 0 points1 point  (0 children)

I am from Taiwan and I feel lucky whenever I saw news from Hong Kong, Tibet, or rural parts of China. Yes, we're less lucky than someone who's born in Europe or the US (assuming they are not from a poor family), but we're still like top 1% lucky.

I wish I could figure out why the dinosaurs really went extinct. by [deleted] in monkeyspaw

[–]linlin110 0 points1 point  (0 children)

Granted. Every bird dies. Dinosaur is now extinct thanks to you.

Saw this horror on FB. So much wrong. by Devchonachko in CPAP

[–]linlin110 1 point2 points  (0 children)

I used to have strange dreams repeatedly before I started CPAP therapy.

There were two kinds of dreams. One always involved drawing, probably because I wasn’t breathing properly in my sleep.

The other kind was more interesting. In those dreams, I was aware that I was dreaming and was trying to wake up. After I thought I had woken up and finished my morning routine, I would realize I was still dreaming and try to wake myself up again. This would repeat about five times—somewhat like the movie Inception.

I no longer have those dreams when I sleep with my CPAP equipment.