Yobject-2

Couple years ago, I posted about "Yobject", an IO-style pattern of prototypical inheritance. This is how it works:

var Yobject = {  
  clone : function (name) {
    var F = function() {};
    F.prototype = this;
    var instance = new F();
    if(name) {instance.type = name;}
    return instance;
  },
  type : "Yobject",
  slotNames : function(){
    var keys = [];
    for(var key in this){
      if (this.hasOwnProperty(key)) {
        keys.push(key);
      }
    }
    return keys;
  }
};

console.log(Yobject.type);  
console.log(Yobject.slotNames());  
console.log("------------------------------------------------------");

//-------------------------------------
var User = Yobject.clone("User");

User.greeting = "Hello";

User.init = function(options){  
    this.name = options.name;
};

User.sayHello = function(){  
    console.log(this.greeting + ", " + "my name is " + this.name);
}

console.log(User.type);  
console.log(User.slotNames());  
console.log("------------------------------------------------------");

//-------------------------------------
var u1 = User.clone();  
u1.init({name: 'Bob'});  
u1.sayHello();

console.log(u1.type);  
console.log(u1.slotNames());  
console.log("------------------------------------------------------");

//-------------------------------------
var EnglishUser = User.clone("EnglishUser");

EnglishUser.greeting = "How do you do";

EnglishUser._userInit = EnglishUser.init;  
EnglishUser.init = function(options){  
    this._userInit(options);
    this.name = options.title + " " + this.name;
};

console.log(EnglishUser.type);  
console.log(EnglishUser.slotNames());  
console.log("------------------------------------------------------");

//-------------------------------------
var u2 = EnglishUser.clone();  
u2.init({name: 'Geoff', title: 'Sir'});  
u2.sayHello();  
console.log(u2.type);  
console.log(u2.slotNames());  

And the output is:

Yobject  
[ 'clone', 'type', 'slotNames' ]                                                                    
------------------------------------------------------                                              
User  
[ 'type', 'greeting', 'init', 'sayHello' ]                                                          
------------------------------------------------------                                              
Hello, my name is Bob  
User  
[ 'name' ]                                                                                          
------------------------------------------------------                                              
EnglishUser  
[ 'type', 'greeting', '_userInit', 'init' ]                                                         
------------------------------------------------------                                              
How do you do, my name is Sir Geoff  
EnglishUser  
[ 'name' ]

Building a fanless Haswell

After a long pause I got bitten by the PC builder bug again, this time it was a fanless one. Here is what I ordered today:

  • ECS H87H3-TI -- this is an LGA1150 (=Haswell-compatible) motherboard in Thin mini-ITX form factor, $110 + $12 shipping.
  • Core i7-4770T Haswell processor, $324 + $10 shipping
  • Akasa Euler fanless Thin mini-ITX case, $113 + $10 shipping
  • 19V / 150W power brick - $30 + $5 shipping
  • Crucial 16GB (2 x 8GB) DDR3 1600 SO-DIMM, $113
  • Samsung 840 Pro SSD 256GB, $207 + $8 shipping

The total comes up to about $950.

So, what's the point? Why is this cool? This, children, is a desktop-grade PC with no moving parts! Not even the customary CPU fan. How is this possible? The case itself is made of aluminium and acts as a giant heatsink! Of course, I will have to get a processor that never exceeds 45 watt of heat output, which is why I got the T version.

Here is how it works: because all Thin mini-ITX boards have CPU in the same place, the case is designed to take advantage of this, by having a heatsink bolted right to the upper lid, touching the board in the exact spot the CPU is at. We only need to apply some thermal paste and voila, 100% passive cooling:

Of course, this lacks a real videocard and a DVD reader, so not exactly a gamer's machine, but should be just perfect for my humble coding needs, like running three Visual Studios at once. Perhaps I can even try and sell it on Ebay for profit? Hmm...

Technical Capability Maturity Matrix

Something I wrote on a piece of napkin today:

Area Immature Developing Mature
Software releases to production Big-bang quarterly releases with hundreds of ad-hoc “hotfixes” in between Regular monthly or weekly releases Fully automated weekly releases
Development methodology Bottom-up. Database is developed first, then UI Top-down. User interface is developed first, then backend Whiteboarding. Technology and business understand each other well enough to effectively iterate on a whiteboard.
Demos None. Software is demoed to the business during the UAT. One weekly demo for all projects in the firm Separate demos for each product, with business doing hands-on test-drives.
Relationship between the business and technology Business is a  customer of technology, demanding precise execution of its requirements.  Business makes promises without engaging technology.  Technology is akin to a consultant/outsource. The business is a responsible product owner, accountable for vision, strategy, prioritization and continuity of their product.The vision is well-communicated to technology. Common language and understanding of both the business’ as well as the technology’s vision. The business and technology work as partners, co-defining the future together.
HR strategy Hire anybody as long as they can write code Hire senior developers, and let them make hiring decisions Design a talent retainment strategy targeted at retaining the senior talent.
Process Ad-hoc (disguised as a waterfall) cyclic (e.g. Scrum) Continuous delivery (e.g. Kanban)
Team vibe and communication Individually assigned tasks, no stable teams Stable teams, with team accountability Supermind – deliberate focus on making team members operate as a group mind.
Scoping, prioritization Random; Loudest squeaking  wheel gets the grease. Prioritization is done in favor of client requests and executives’ whims. Minimalistic –barebone fundamentals first. Both middle management as well as developers are not afraid to say no to the business. Goal-driven. Well understood goal and common vision helps focus. The mutual trust allows certain degree of freedom at all levels.
The flow of initiative 100% top-down. Projects are initiated only by executives. Technology is trusted enough to have its own projects, even if the need is not well-understood by the business. Grass root initiatives are encouraged. The teams of peers come up with spinoff initiatives and are trusted enough to drive their own staffing pace.
Technology stack Conservative, one-vendor technologies (Microsoft) Using latest and greatest of what the industry has to offer – open-source libraries, non-Microsoft-based products etc. Stable technology stack with ROI-driven innovation
Work-life balance and overtime Overtime is expected to support deadlines, off-hour releases and bug investigations Good work-life balance, with occasional off-hour work required, compensated by the free workday schedule Dedicated paid off-hours staff for Support-Desk and Technical Emergency activities
Relationship between the IT (including IT audit!) and the development IT does whatever they think is right IT works closely with development, to minimize the negative impacts on productivity Dev-ops: Fully integrated IT and development with no artificial boundaries, working together for the most efficiency
Technical debt The concept is unknown Well-understood, and minimized Responsible strategic acquiring of technical debt on the first version of a system, fully cleaned on the first rewrite.
Relationship between developers and BAs/PMs Developers report to BAs/PMs Developers and BAs/PMs report separately as two silos Developers and BAs/PMs report together, with BAs working on development teams as peers
Multitasking There are more projects than people. Multitasking is prevalent. The people outnumber the projects. Each team has one main project they work on, plus very low burden support of old projects. The role of multitasking in reducing the global efficiency is well understood. The teams are formed as needed to provide focus and avoid the waits on dependencies associated with multitasking.

Ela language: sequential-2

open console

main =  
  let fname = prompt "What's your first name?"
  in
  let name = (fname, prompt "What's your last name?")
  in
  print_greeting name
  where
    print_greeting fn ln = printf "Hello, {0} {1}" fn ln
    prompt msg = writen msg `seq` write ">" `seq` readn()
open console

main =  
  let
    fname = prompt "What's your first name?"
    name = (fname, prompt "What's your last name?")
  in
    print_greeting name
  where
    print_greeting (fn,ln) = printf "Hello, {0} {1}" fn ln
    prompt msg = writen msg `seq` write ">" `seq` readn()

Ela language: sequential program

open console string

prompt msg =  
  writen msg `seq`
  write ">" `seq`
  readn()

greeting name =  
  format "Hello, {0}" name

prompt "What's your name?" |> greeting |> writen  
open console string

prompt msg =  
  writen msg
  `seq` write ">"
  `seq` readn()

greeting name =  
    format "Hello, {0}" name

name = prompt "What's your name?"

message = greeting name

writen message  
open console

prompt msg = writen msg `seq` write ">" `seq` readn()  
prompt "What's your name?" |> printf "Hello, {0}"  
open console

greet_the_user

greet_the_user = printf "Hello, {0}" user_name

user_name = prompt "What's your name?"

prompt msg = writen msg `seq` write ">" `seq` readn()  
open console

printf "Hello, {0}" user_name  
 where user_name = prompt "What's your name?"
        where prompt msg = writen msg `seq` write ">" `seq` readn()
open console string

prompt msg = writen msg `seq` write ">" `seq`  readn()

greet_the_user  
 where greet_the_user = writen greeting
        where greeting = format "Hello, {0}" name
               where name = prompt "What's your name?"
greet_the_user =  
  let greeting = format "Hello, {0}" name
      name = prompt "What's your name?"
      prompt msg = writen msg `seq` write ">" `seq`  readn()
  in writen greeting
open console

let name = prompt "What's your name"  
  in printf "Hello, {0}" name
  where prompt msg = writen msg `seq` write ">" `seq`  readn()
open console

greet_the_user =  
  let fname = prompt "Enter first name"
      lname = prompt "Enter last name"
  in printf "Hello, {0} {1}" fname lname
  where prompt msg = writen msg `seq` write ">" `seq`  readn()
open console

prompt msg = writen msg `seq` write ">" `seq`  readn()

greet_the_user =  
  printf "Hello, {0} {1}" fname lname
  where fname = prompt "Enter first name"
        lname = prompt "Enter last name"
greet_the_user =  
  let fname = prompt "Enter first name"
      lname = prompt "Enter last name"
      greeting = format "Hello, {0} {1}" fname lname
      prompt msg = writen msg `seq` write ">" `seq`  readn()
  in writen greeting
greet_the_user =  
  let fname = prompt "Enter first name"
      lname = prompt "Enter last name"
  in printf "Hello, {0} {1}" fname lname
  where prompt msg = writen msg `seq` write ">" `seq`  readn()
open console

greet_the_user =  
  printf "Hello, {0} {1}" fname lname
  where fname = prompt "Enter first name"
        lname = prompt "Enter last name"
        prompt msg = writen msg `seq` write ">" `seq`  readn()
open console

greet_the_user =  
  let fname = prompt "Enter first name"
      lname = prompt "Enter last name"
  in print_greeting fname lname
  where print_greeting f l = printf "Hello, {0} {1}" f l
        prompt msg = writen msg `seq` write ">" `seq`  readn()
open console

main =  
  let
      fname = prompt "What's your first name?"
      lname = prompt "What's your last name?"
  in 
    greet fname lname
  where 
    greet fn ln = printf "Hello, {0} {1}" fn ln
    prompt msg = writen msg `seq` write ">" `seq` readn()