Enum is an abbreviation for 'enumerated'. The overall concept is processing information where each value is one of a very limited set of values. This is a look from the basics to the more advanced in how a dynamic language like python treats enum, through the advanced treatment available in kotlin. TLDR; Just read the… Continue reading Enum & Sealed Classes
Category: 2-Code
Lists, Dictionaries, Iterations & More
Python uses dictionary, list and tuple to hold collections information, with set also available (but not used as quite as often). Kotlin provides List and Map as collections, and their mutable forms, MutableList and MutableMap as the main solutions for collections equivalent to Python. Further, Set and MutableSet are available matching the python 'set'. 'List'… Continue reading Lists, Dictionaries, Iterations & More
Data Classes: The end of ‘Faux Objects’?
This page introduces the concept of 'Faux Objects': the use of a collections to avoid need to declare a class to represent data, and data classes, the solution that makes removes the barrier to declaring a class for storage as an object. Subtopics: When is a collection actually a 'Faux Object?'The Dual Nature of Data:… Continue reading Data Classes: The end of ‘Faux Objects’?
Lambdas: what do you mean I will use them?
Python has lambdas, but with python, the lambda is a very reduced lambda that Guido even hesitated about calling lambda. I would suggest that with python, almost everything that can be done using lambdas, will be easier to understand if rewritten without the lambda. Main Points of the page: Background What is a Lambda again?… Continue reading Lambdas: what do you mean I will use them?
var, val and Immutability
Why 'var' or 'val' at all? TL;DR: adding the 'var' (or val) is clearer than python syntax Python programs traditionally just set variables to a value, not fuss no extra step. Creating the variable by giving it a value uses the same syntax as setting an existing variable to a new value. Using the same… Continue reading var, val and Immutability