On 09 Nov 2013, at 09:53, btc@openinworld.com wrote:
Bahman Movaqar wrote:
Hi all,
A new episode is availabe: Spec - Part II: The Layout (http://www.bahmanm.com/blogs/spec-part-2-layout)
I'd appreciate any comments/hints. TIA,
Some minor nit-picks...
"please do so as we are going to iterate over what was done there." I don't understand what you mean by 'iterate over'? Do you me 'build on'?
"let's first settle for a target design. For the rest of this episode, we will try to achieve the following design. " I get to the bottom and the last snapshot it doesn't look the same as the one at the top. At the top you should mention that your target design is achieved over several posts (if that is the case).
"Note lines 9, 10, 17 and 18." "Note new lines 9, 10, 17 and 18."
* At the top you should specify what version of Pharo the tutorial relates to. Information on the web hangs around for a very long time and someone could get trapped later trying your tutorial on a later version of Pharo.
* Regarding #defaultSpec, I happen to like what is used in PharoLauncher specLayout <spec: #default> ^ SpecLayout composed â¦etc
The pragma should be preferred :) Actually the check is done like this: - take the first method found with defaultSpec (if multiple, te first found is used) - if none, and there is only one method with the pragma spec, use it - otherwise look for defaultSpec (this should be deprecated soon) - DNU the defaultSpec is a relic of the first version of Spec :)
Overall it a nice next step introducing just a bit more functionality. It reads very well. I look forward to the next one.
cheers -ben
P.S. Some questions for Spec gurus...
* looking at #defaultSpec from this episode, if the pattern is always... mainColumn newRow: [ :aRow | aRow doStuff; otherStuff... ] what is gained over a pattern like... mainColumn newRow doStuff ; otherStuff.
As I understood your question, you answered it :) I use block here so one can easily have a pointer to the row to do some magic here :) It also represents the columns/rows hierarchy
* is #defaultSpec always going to return a SpecLayout? In which case #defaultSpec feels like is should be #defaultSpecLayout.
Even if it returns a SpecLayout most of the time, it could as well return an array with a spec structure. Actually, when you return a SpecLayout, it is converted into an array before wing interpreted :) (try to inspect one of your favorite SpecLayout and look at myLayout asArray ^^)
cheers -ben