Hickey is great at trash-talking other languages. In the case of Car you might build a set of builders where you write Car.builder().make(“Buick”).model(“LeSabre”).build()
Or in a sane world code generate a bunch of constructors.In the field of ontology (say OWL and RDF) there is a very different viewpoint about ‘Classes’ in the objects gain classes as they gain attributes. :Taylor_Swift is a :Person because she has a :birthDate, :birthPlace and such but was not initially a :Musician until she :playsInstrument, :recordedTrack, :performedConcert and such. Most languages have object systems like Java or C++ where a Person can’t start out as not a Musician but become one later like the way they can in real life. Notably in a system like the the terrible asymmetry of where does an attribute really belong is resolved, as in real life you don’t have to say it is primary that Taylor Swift recorded the Album Fearless or that Fearless was recorded by Taylor Swift. It’s a really fascinating question in my mind how you create a ‘meta object facility’ that puts a more powerful object system on your fingers in a language like Java or Python, for instance you can have something like taylorSwift.as(Musician.class)
which returns something that implements the Musician.class interface if taylorSwift.isA(Musician.class)
where TaylorSwift instanceof MetaObject.class
|
White your code to work on Musicians, pass Taylor Swift in.
If she's not a musician, your code won't compile.