natureofcode.blogspot.com
Exploring the Nature of Code: November 2013
http://natureofcode.blogspot.com/2013_11_01_archive.html
Exploring the Nature of Code. 8212; 0 comments. Tetris Analyzer in Clojure - part 2. A short introduction to Clojure. In my initial Clojure implementation of Tetris Analyzer I chose to represent the board as a one-dimensional vector, then in my second attempt I tried a two-dimensional vector. The result for both was disapointingly ugly, and when it's ugly - then it's wrong! Ugly code is often complex. The first met all my criterias of complex code:. Code that is hard to read and understand. Defn board- s...
natureofcode.blogspot.com
Exploring the Nature of Code: August 2011
http://natureofcode.blogspot.com/2011_08_01_archive.html
Exploring the Nature of Code. 8212; 2 comments. The Context Switcher Pattern. What is your relationship to encapsulation. Do you belong to the group who always start with setting all of the class's internal attributes to private, but who often end up needing to add getters because they couldn’t see a better solution? Or perhaps you belong to the group that has given up on encapsulation and who let their IDEs generate all the getters when the class is created? Let us say that you create the class Car.
natureofcode.blogspot.com
Exploring the Nature of Code: September 2011
http://natureofcode.blogspot.com/2011_09_01_archive.html
Exploring the Nature of Code. 8212; 4 comments. The Chained Creator Pattern. The purpose of this pattern is to simplify a very common occurrence, the creation of class instances, by making the code cleaner and more readable. It can be used to create ordinary class instances and also replace long parameter lists (if you can't avoid them) with a "parameter class". Most of the deficiencies this pattern addresses can also be resolved by named parameters. The upsides are more numerous:. Instead of new Car().
natureofcode.blogspot.com
Exploring the Nature of Code: Using State Guard in GUI
http://natureofcode.blogspot.com/2011/10/using-state-guard-in-gui.html
Exploring the Nature of Code. Using State Guard in GUI. Pattern works very well with the patterns Builder. But here we will demonstrate how it can be used all by itself in a graphical user interface to handle validation and transition to a valid state. The example is written in Java and uses Swing. With the layout manager SpringLayout. The source code is hosted at GitHub. Lets say we want to create this GUI:. The program starts by executing the class Main. Package nu.tengstrand.stateguard.gui...Package n...
natureofcode.blogspot.com
Exploring the Nature of Code: A short introduction to Clojure
http://natureofcode.blogspot.com/2013/11/a-short-introduction-to-clojure.html
Exploring the Nature of Code. A short introduction to Clojure. Clojure was released in 2007 and is a dialect of Lisp. Which is an old langauge from the 50s that is based on lambda calculus. The real challange when it comes to learn Clojure is not to get used with the syntax but to switch from an imperative. Mindset to a functional. One (if you come from the OO. Why should you care? There are a lot of reasons why you should care about Clojure:. That is used in other languages to create internal DSL. Subsc...
natureofcode.blogspot.com
Exploring the Nature of Code: October 2013
http://natureofcode.blogspot.com/2013_10_01_archive.html
Exploring the Nature of Code. 8212; 0 comments. Context Driven Developent was an experiment to see if object orientation could be improved by separating state and behavior. While working with CDD. Some years ago I was at the JFokus. Conference and listened to Neal Ford. He was excited about a relatively new functional language called Clojure. When he showed us the syntax of the language, I thought "That can't be right! Because it differed too much from what I was used to (assembler, C, C , Java and Scala).
natureofcode.blogspot.com
Exploring the Nature of Code: Going Functional
http://natureofcode.blogspot.com/2013/10/going-functional.html
Exploring the Nature of Code. Context Driven Developent was an experiment to see if object orientation could be improved by separating state and behavior. While working with CDD. Some years ago I was at the JFokus. Conference and listened to Neal Ford. He was excited about a relatively new functional language called Clojure. When he showed us the syntax of the language, I thought "That can't be right! Because it differed too much from what I was used to (assembler, C, C , Java and Scala). Then I realised...
natureofcode.blogspot.com
Exploring the Nature of Code: January 2013
http://natureofcode.blogspot.com/2013_01_01_archive.html
Exploring the Nature of Code. 8212; 0 comments. Context Driven Development (CDD) summarizes in many ways the design ideas I have previously written about in this blog:. Pattern adds the concept context to OO. This pattern is now improved in CDD so that state and behaviour are fully separated. Pattern is used in CDD to improve the way state is built. CDD has been inspired by the State guard. When I came up with the idea to let the code generator Laja. Read more about the CDD design paradigm here.
natureofcode.blogspot.com
Exploring the Nature of Code: The Chained Creator Pattern
http://natureofcode.blogspot.com/2011/09/chained-creator-pattern.html
Exploring the Nature of Code. The Chained Creator Pattern. The purpose of this pattern is to simplify a very common occurrence, the creation of class instances, by making the code cleaner and more readable. It can be used to create ordinary class instances and also replace long parameter lists (if you can't avoid them) with a "parameter class". Most of the deficiencies this pattern addresses can also be resolved by named parameters. The upsides are more numerous:. Instead of new Car(). The problem here i...
natureofcode.blogspot.com
Exploring the Nature of Code: Tetris Analyzer in Clojure - part 2
http://natureofcode.blogspot.com/2013/11/tetris-analyzer-in-clojure-part-2.html
Exploring the Nature of Code. Tetris Analyzer in Clojure - part 2. A short introduction to Clojure. In my initial Clojure implementation of Tetris Analyzer I chose to represent the board as a one-dimensional vector, then in my second attempt I tried a two-dimensional vector. The result for both was disapointingly ugly, and when it's ugly - then it's wrong! Ugly code is often complex. The first met all my criterias of complex code:. Code that is hard to read and understand. Code that is hard to change.