Data: fields vs properties Boilerplate Getters and Setters Cutting the boilerplate, and the impact Beyond the boilerplate for getters and setters Data: fields vs properties Classes have both functions called methods and instance data or fields. Python also uses the term properties, for data that has an explicit getters function and optionally setter a setter… Continue reading Class data: Getters, Setters & Properties
Defining, Construct & Init for Classes
defining classes: constructors and init python vs kotlin Syntax Hopefully the above python code is self explanatory. Example 2 adds a base class. I do not deal with multiple inheritance at this time, and will devote a specific page at some future time as for python it gets complex, and for kotlin it requires additional… Continue reading Defining, Construct & Init for Classes
Background & History of OO Languages
Background Python, Kotlin or Java, which best supports Object Oriented Programming (OOP)? History. Simula 67 (in 1967) was probably the first Object Oriented Language. It was a great language, but wow was it slow! And slow even on the massive mainframe computers it lived on. The origin of C++ was to add the power of… Continue reading Background & History of OO Languages
Python dataclasses: A revolution
Python data classes are a new feature in Python 3.7, which is currently in Beta 4 and scheduled for final release in June 2018. However, a simple pip install brings a backport to Python 3.6. The name dataclass sounds like this feature is specifically for classes with data and no methods, but in reality, just… Continue reading Python dataclasses: A revolution
Python Class vs Instance Variables
Python class variables offer a key tool for building libraries with DSL type syntax, as well as data shared between all instances of the class. This page explains how Python class variables work and gives some examples of usage. Class & Instance Variables Instances vs the class object Instance Variables Class Variables Using Class and… Continue reading Python Class vs Instance Variables