I'm currently reading the book "The Joy of Clojure". This is a rare kind of book - the kind you don't want to end. It explains Clojure - but not in a "do this to get that" kind of a way, which is the way most technical books are. It does it differently, by almost telling a story that reveals Clojure layer after layer. It does so while keeping the Clojure motto of "no unneeded overhead" - exactly what's needed, no more no less.
Still, if it was just for that, I wouldn't rush to write this short review - there's something else in the way that this book is written, its style is some sort of a combination between an Arthur Conan Doyle novel in the way that it glues you to the page, and a late night show monologue that provides you fun every 30 seconds.
A must read for every software developer - regardless if you ever plan to write a single line of Clojure code, it would just make you think clearer about code in general and specifically about your code.
Tuesday, September 13, 2011
Saturday, September 3, 2011
A function, JavaScript engine and the single var pattern to declare variables walk into a pub
Addy Osmani had published a very nice post that summarizes various problems found when doing JavaScript code review. Most of the points there worth paying attention to. However, there is one point there that he got completely wrong. When he discussed the problem of variables declared all over the place within a function scope, he suggested to use the "single var pattern to declare variables", basically write the variables declarations like this:
var someData = "testing",
otherData = "data1",
moreData = "data2";
This kind of coding will get you into trouble. Try to find the difference between the code above and the code below:
var someData = "testing"
otherData = "data1",
moreData = "data2";
var someData = "testing",
otherData = "data1",
moreData = "data2";
This kind of coding will get you into trouble. Try to find the difference between the code above and the code below:
var someData = "testing"
otherData = "data1",
moreData = "data2";
Found?
let's add to the first snippet the scope of each variable:
var someData = "testing", // local within the function
otherData = "data1", // local within the function
moreData = "data2"; // local within the function
otherData = "data1", // local within the function
moreData = "data2"; // local within the function
Now let's do the same for the second snippet:
var someData = "testing" // local within the function
otherData = "data1", // global
moreData = "data2"; // global
Big difference, but why?.
Answer: Take a look at the "testing" string. In the first snippet it is followed by a comma, whereas it is not there in the second snippet. That's all, one comma.
Both snippets are valid JavaScript code, it just happens that even though JavaScript has a C like syntax, it does not require to have a semi-colon at the end of each line, the JavaScript engine will add it if missing.
So the second snippet is actually:
var someData = "testing"; // local within the function
otherData = "data1", // global
moreData = "data2"; // global
(note the semi-colon after the "testing").
One more thing to know about JavaScript: when declaring a variable inside a function without the var keyword, it is defined as a global variable.
Now go and find that little comma somewhere in your code, at 1:00 am , a few hours before delivery.
I prefer the simpler approach to define variables, and do the following:
var someData = "testing"; // local within the function
var otherData = "data1"; // local within the function
var moreData = "data2"; // local within the function
You can say that it is less elegant, but it is much less error prone, much more descriptive of what you want, can save hours of looking for a comma and simply put, it is just a simpler code. Just remember that beauty is in the eyes of the beholder, and to me, in code, simplicity is beauty .
otherData = "data1", // global
moreData = "data2"; // global
Big difference, but why?.
Answer: Take a look at the "testing" string. In the first snippet it is followed by a comma, whereas it is not there in the second snippet. That's all, one comma.
Both snippets are valid JavaScript code, it just happens that even though JavaScript has a C like syntax, it does not require to have a semi-colon at the end of each line, the JavaScript engine will add it if missing.
So the second snippet is actually:
var someData = "testing"; // local within the function
otherData = "data1", // global
moreData = "data2"; // global
(note the semi-colon after the "testing").
One more thing to know about JavaScript: when declaring a variable inside a function without the var keyword, it is defined as a global variable.
Now go and find that little comma somewhere in your code, at 1:00 am , a few hours before delivery.
I prefer the simpler approach to define variables, and do the following:
var someData = "testing"; // local within the function
var otherData = "data1"; // local within the function
var moreData = "data2"; // local within the function
You can say that it is less elegant, but it is much less error prone, much more descriptive of what you want, can save hours of looking for a comma and simply put, it is just a simpler code. Just remember that beauty is in the eyes of the beholder, and to me, in code, simplicity is beauty .
Thursday, August 18, 2011
What's next in the mobile arena
Apple has complete control both on the software and the hardware of their mobile devices. Moreover, they have a huge client base (all the iPXXXX people)
Google now also has complete control both on the software and the hardware of their mobile device (assuming that the deal with Motorola Mobility is approved). Moreover, they have a huge client base (all the android people)
RIM has complete control both on the software and the hardware of their devices, but nobody buys their products and they are loosing their share in the mobile market.
Microsoft controls its software and wants to increase their share in this market.
When will Microsoft buy RIM?
Google now also has complete control both on the software and the hardware of their mobile device (assuming that the deal with Motorola Mobility is approved). Moreover, they have a huge client base (all the android people)
RIM has complete control both on the software and the hardware of their devices, but nobody buys their products and they are loosing their share in the mobile market.
Microsoft controls its software and wants to increase their share in this market.
When will Microsoft buy RIM?
Saturday, August 13, 2011
The effects of the software patents war
There's a software patents war raging. It is fought between all the players, big and small: Google, Apple, Microsoft, Oracle and IBM are just a few names in the list of the war participants.
It is all over the news now, Google buys more then a 1000 patents from IBM and fails to buy 6000 other patents, of Nortel. These 6000 patents were bought by Apple, Microsoft and Ericsson. The undertaker of silicon valley claims that nowadays, what's left of a company that is closing down is the IP (whereas during the 2000 bubble bust servers were what a dying company could sell).
This leads me to ask about the effect of this war on the recruitment process. I guess that companies in the high-tec industry will start looking for people who know to develop software (transform innovation into code) as well as know how to develop IP (transform innovation into patents).
Would an ad for a software developer include not only the set of technologies / domains that a possible candidate should know, but also how many patents are on the candidate's belt?
Update
The patents war is now going to the next level - Google bought Motorola Mobility and its portfolio of about 17,000 patents. Now Google has a patent arsenal which can be used to really fight the rest of the big players.
It is all over the news now, Google buys more then a 1000 patents from IBM and fails to buy 6000 other patents, of Nortel. These 6000 patents were bought by Apple, Microsoft and Ericsson. The undertaker of silicon valley claims that nowadays, what's left of a company that is closing down is the IP (whereas during the 2000 bubble bust servers were what a dying company could sell).
This leads me to ask about the effect of this war on the recruitment process. I guess that companies in the high-tec industry will start looking for people who know to develop software (transform innovation into code) as well as know how to develop IP (transform innovation into patents).
Would an ad for a software developer include not only the set of technologies / domains that a possible candidate should know, but also how many patents are on the candidate's belt?
Update
The patents war is now going to the next level - Google bought Motorola Mobility and its portfolio of about 17,000 patents. Now Google has a patent arsenal which can be used to really fight the rest of the big players.
Wednesday, July 27, 2011
Programming and softwaring
Programming is creating functional components from code atoms (such as a programming language keywords or library calls). It is structuring a code molecule with defined input and output.
Softwaring is the composition of code units (atoms and molecules), functional components and other software to create an entity that has code organs (such as UI or communication layer), processes and life cycle.
Programming is chemistry.
Softwaring is biology.
Softwaring is the composition of code units (atoms and molecules), functional components and other software to create an entity that has code organs (such as UI or communication layer), processes and life cycle.
Programming is chemistry.
Softwaring is biology.
Thursday, June 30, 2011
Google discovers a new gender
I was pretty sure that humans are either male or a female. I guess that other genders were discovered by Google
Tuesday, June 28, 2011
A different, simpler, approach to visually design business processes
About a year ago, I co-authored a paper called "What You See And Do Is What You Get: A Human-Centric Design Approach to Human-Centric process". It was accepted and presented at the BPD workshop (BPD here stands for "Business Process Design") which was part of the BPM conference (BPM here stands for "Business Process Management").
The paper describes a new way to design processes. The key idea there was to reuse the WYSIWYG ("what you see is what you get") design approach (which is used usually for user interface design) in process design, where static page design is not sufficient, but there's also a need to design the dynamic nature of the process.
I just noticed that the proceedings are now published, so it is possible to read the paper here.
Section 2 there describes in more details the WYSADIWYG approach.
The paper describes a new way to design processes. The key idea there was to reuse the WYSIWYG ("what you see is what you get") design approach (which is used usually for user interface design) in process design, where static page design is not sufficient, but there's also a need to design the dynamic nature of the process.
I just noticed that the proceedings are now published, so it is possible to read the paper here.
Section 2 there describes in more details the WYSADIWYG approach.
Labels:
business process,
publications,
usability
| Reactions: |
Sunday, June 26, 2011
Comparing programming languages to boats
See here, a nice comparison of programming languages to types of boats. Very funny, some of it even makes sense (even though I'd say that Java is the Titanic rather then a cargo ship...)
Monday, June 13, 2011
Brain-mapping the Dallas Mavericks
Dallas Mavericks just won the NBA title. Watching them was a true enjoyment due to the diversity of the playing styles that this team showed.
When combining together all these playing styles it is easy to see the resemblance of this team to another remarkable machine - the brain. Here is a short list of the key players and their role / playing style as if they are regions in the brain:
Jason Kidd - Prefrontal Cortex: This region is responsible for planning and decision making (amongst other things). This is the type of basketball that Jason Kidd is playing - very smart and focused on taking the right decisions while planning two moves in advance.
Dirk Nowitzki - Cerebellum. This region is responsible for repetitive motorical tasks, such as climbing stairs all the way to doing calligraphy. Dirk Nowitzki's game is all about doing several things over and over again, regardless of their complexity - jump backward on one leg, re-balance in mid-air and then throw the ball accurately to the hoop. from the outside it seems complicated, it is if you stop and think about every step. It isn't if done automatically.
Jason Terry - Amygdala. This region's key functionality is handling the limbic system, i.e. emotions. Jason Terry's game is all about emotions - if he feels that he needs to shot, he'll shoot, no fear, no stress, it can be a win or loose shot, if he feels it, he'll do it.
Jose Barea - Brainstem - This region is responsible for the basic bodily functions - breathing, temperature control, etc. Jose Barea's game is just as primal as this region- no, thinking, just doing - you are faced with a higher, stronger defender (or two), run into them and throw the ball.
Sean Marion - thalamus - This region is the communication relay system, just in the middle of so many processes. Sean Marion's game is similar, he is everywhere, does not start anything, may end plays and glues numerous processes together.
Tyson Chandler - Astrocytes - this is the "skeleton" of the brain - it give structure and holds everything in place. Does not do any calculation, but everything would collapse without it.
When combining together all these playing styles it is easy to see the resemblance of this team to another remarkable machine - the brain. Here is a short list of the key players and their role / playing style as if they are regions in the brain:
Jason Kidd - Prefrontal Cortex: This region is responsible for planning and decision making (amongst other things). This is the type of basketball that Jason Kidd is playing - very smart and focused on taking the right decisions while planning two moves in advance.
Dirk Nowitzki - Cerebellum. This region is responsible for repetitive motorical tasks, such as climbing stairs all the way to doing calligraphy. Dirk Nowitzki's game is all about doing several things over and over again, regardless of their complexity - jump backward on one leg, re-balance in mid-air and then throw the ball accurately to the hoop. from the outside it seems complicated, it is if you stop and think about every step. It isn't if done automatically.
Jason Terry - Amygdala. This region's key functionality is handling the limbic system, i.e. emotions. Jason Terry's game is all about emotions - if he feels that he needs to shot, he'll shoot, no fear, no stress, it can be a win or loose shot, if he feels it, he'll do it.
Jose Barea - Brainstem - This region is responsible for the basic bodily functions - breathing, temperature control, etc. Jose Barea's game is just as primal as this region- no, thinking, just doing - you are faced with a higher, stronger defender (or two), run into them and throw the ball.
Sean Marion - thalamus - This region is the communication relay system, just in the middle of so many processes. Sean Marion's game is similar, he is everywhere, does not start anything, may end plays and glues numerous processes together.
Tyson Chandler - Astrocytes - this is the "skeleton" of the brain - it give structure and holds everything in place. Does not do any calculation, but everything would collapse without it.
Subscribe to:
Posts (Atom)
