In the Functional Programming (FP) realm monads are very useful. In fact you may have already used one without knowing it. If you’ve ever used jQuery, even under the hood, you’ve used a monad, but in this article I’m going to show you how to use one particular monad to handle errors in an efficient […]
Smallworld
The Need for Functional Programming in Smallworld GIS
The Magik programming language is imperative and leans heavily toward the Object Oriented Programming (OOP) paradigm. It relies on mutation, hidden state, side-effects and tight coupling between data and behavior. Code-reuse is achieved primarily through inheritance. The Functional Programming (FP) paradigm, on the other hand, is declarative and relies on immutable objects, minimizes side-effects and […]
The Value of Logging in Smallworld GIS
Logs. I know. Logs are boring. The mere thought of scanning through hundreds or thousands of lines of a log is enough to bring even the most diligent among us to tears. Yet logs are one of the most valuable sources of information when we need to determine why something isn’t working in an application. […]
Smallworld GIS Magik Observables
It’s common knowledge that loose coupling within an application leads to lower- maintenance systems and fewer bugs. To that end there have been numerous techniques and paradigms developed to achieve the loosely-coupled goal. The Observer Pattern One such design pattern is the Observer, also called Publish-Subscribe in some circles (let’s break into a small sidebar […]
Magik Closures
Most Magik developers have never heard of a Closure, yet Functional Programming languages frequently use it to do powerful and useful things. And Magik supports Closures. However, practically all Magik developers are taught to use the Object Oriented Programming (OOP) paradigm when they first learn Magik. Then as they start working on existing code, it’s […]