Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #39820 > unrolled thread

OOP....

Started byThe Natural Philosopher <tnp@invalid.invalid>
First post2021-04-01 14:13 +0100
Last post2021-04-03 14:31 +0100
Articles 4 — 4 participants

Back to article view | Back to comp.lang.javascript


Contents

  OOP.... The Natural Philosopher <tnp@invalid.invalid> - 2021-04-01 14:13 +0100
    Re: OOP.... JJ <jj4public@gmail.com> - 2021-04-01 22:15 +0700
    Re: OOP.... "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2021-04-02 13:30 -0700
    Re: OOP.... John G Harris <niam@jghnorth.org.uk.invalid> - 2021-04-03 14:31 +0100

#39820 — OOP....

FromThe Natural Philosopher <tnp@invalid.invalid>
Date2021-04-01 14:13 +0100
SubjectOOP....
Message-ID<s44gt1$12s$1@dont-email.me>
https://suzdalnitski.medium.com/oop-will-make-you-suffer-846d072b4dce

https://thenewstack.io/why-are-so-many-developers-hating-on-object-oriented-programming/

-- 
If you tell a lie big enough and keep repeating it, people will 
eventually come to believe it. The lie can be maintained only for such 
time as the State can shield the people from the political, economic 
and/or military consequences of the lie. It thus becomes vitally 
important for the State to use all of its powers to repress dissent, for 
the truth is the mortal enemy of the lie, and thus by extension, the 
truth is the greatest enemy of the State.

Joseph Goebbels


[toc] | [next] | [standalone]


#39823

FromJJ <jj4public@gmail.com>
Date2021-04-01 22:15 +0700
Message-ID<8eckc15ouzg7.css36e0jwiez$.dlg@40tude.net>
In reply to#39820
On Thu, 1 Apr 2021 14:13:04 +0100, The Natural Philosopher wrote:
> https://***/oop-will-make-you-suffer-846d072b4dce
> 
> https://***/why-are-so-many-developers-hating-on-object-oriented-programming/

This isn't a general programming newsgroup.

[toc] | [prev] | [next] | [standalone]


#39846

From"Michael Haufe (TNO)" <tno@thenewobjective.com>
Date2021-04-02 13:30 -0700
Message-ID<1939b84f-cb4d-448f-9930-44a97493f60an@googlegroups.com>
In reply to#39820
On Thursday, April 1, 2021 at 8:13:14 AM UTC-5, The Natural Philosopher wrote:
> https://suzdalnitski.medium.com/oop-will-make-you-suffer-846d072b4dce 
> 
> https://thenewstack.io/why-are-so-many-developers-hating-on-object-oriented-programming/ 
> 

A JJ mentioned, this is off-topic for the group. You should have replied to the original thread.

With that being said the linked articles are Not Even Wrong[1].

Bashing C++ or Java is a poor substitute for criticizing OOP.

I wouldn't judge functional programming poorly because XSLT is such a pain in the ass.

Show me a comparable criticism of Smalltalk, Eiffel, or Self.

Also instead of echoing someone else's ignorance, present your own perspective on the topic.

More importantly, if you present it here, keep it relevant to JavaScript

An example of what that might look like if I played Devil's Advocate is below.

<EXAMPLE>

OOP is terrible. Look at the following TypeScript code and see what I mean:

// Exp.ts
abstract class Exp {
  abstract evaluate(): number
}

export default Exp

// Add.ts
import Exp from 'Exp'

class Add extends Exp {
  constructor(
    readonly left: number, readonly right: number
  ) { super() }
  evaluate(){ return this.left + this.right }
}

export default Add

When I add a Mul expression that's easy enough:

// Mul.ts
import Exp from 'Exp'

class Mul extends Exp {
  constructor(
    readonly left: number, readonly right: number
  ) { super() }
  evaluate(){ return this.left * this.right }
}

export default Mul

What happens when I want to add a print method? I can't do that without modifying all of my modules!
Some of them could be third party that I can't control!
OOP is terrible. How can I follow best practices in my code if I can't do something so simple?

</EXAMPLE>

[1] <https://en.wikipedia.org/wiki/Not_even_wrong>

[toc] | [prev] | [next] | [standalone]


#39848

FromJohn G Harris <niam@jghnorth.org.uk.invalid>
Date2021-04-03 14:31 +0100
Message-ID<verg6ghj7tbiu960p3k90csc0rt9sdplt0@4ax.com>
In reply to#39820
On Thu, 1 Apr 2021 14:13:04 +0100, The Natural Philosopher
<tnp@invalid.invalid> wrote:

Here's another way to make it closer to On Topic.

>https://suzdalnitski.medium.com/oop-will-make-you-suffer-846d072b4dce

This says spaghetti code is bad.

That includes ECMAScript which doesn't prevent you writing spaghetti
code, as some people here have demonstrated.


>https://thenewstack.io/why-are-so-many-developers-hating-on-object-oriented-programming/

That says the features of a language can be used badly.

That includes ECMAScript which doesn't prevent you doing things badly,
as some people have demonstrated.

It also praises ECMAScript for being able to write functions with no
side effects.

It also says you mustn't tell a user what today's date is, which
rather dims its message.

  John

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.javascript


csiph-web