DEV Community

Owen Gallagher
Owen Gallagher

Posted on

4 3

Define sinstructor

sinstructor (n)

Computer code in any object-oriented program that defines new members of an object instance outside of its constructor, resulting in unnecessary confusion and forgotten variables.

class Vehicle:
    # a happy constructor
    def __init__(self, wheel_count):
        self.wheel_count = wheel_count
    # end __init__
# end Vehicle

motorbike = Vehicle(wheel_count=2)

# CAUTION: SINSTRUCTOR AHEAD
motorbike.color = '#ff0000' 
Enter fullscreen mode Exit fullscreen mode
// a happy constructor (sort of)
function Vehicle(wheel_count) {
    this.wheel_count = wheel_count
}

let motorbike = new Vehicle(2)

// CAUTION: SINSTRUCTOR AHEAD
motorbike.color = '#ff0000'
Enter fullscreen mode Exit fullscreen mode

Is this a new term? I derived it by taking constructor (with) and switching it to sinstructor (without).

Top comments (0)

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free →

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay