mde / true

A JavaScript port of the Unix utility 'true'. Returns the Boolean value `true`
98 stars 26 forks source link

Not enough engineering #29

Closed alii closed 2 years ago

mde commented 2 years ago

I would be happy to have a look at a PR that properly implements sufficient engineering. It should probably use some sort of Factory, or IOC, at a bare minimum, to be enough.

tj-commits commented 2 months ago

What does engineering mean in the context of Node.js?

mde commented 2 months ago

I mean, it should at least implement three or four of these, minimum: https://www.amazon.com/Design-Patterns-Elements-Reusable-Object-Oriented/dp/0201633612/

tj-commits commented 2 months ago

@mde Okay, now that makes more sense. But I think such a crucial library should not be so big. Like, using Object Oriented Programming could make it look like this, which is too big.

class TrueValue {
  constructor () {
    this.value = true // or whatever we use for true value
  }
}
class ReturnTrue() {
  constructor(value) {
    this.t = () => value
  }
}

const trueValue = new TrueValue().value
const returnTrue = new ReturnTrue(trueValue).t

module.exports = returnTrue

Way too much code in my opinion.

tj-commits commented 2 months ago

It would affect performance.