Tag Archives: programming

Introducing Kids To Programming

So way back in elementary school we had a computer lab that we visited once in awhile. Last night it dawned on me that those sessions were my first exposure to programming. In a flood of memories I began to recall all this.

Wait let me back up. So a few years ago a book came out, that was interesting, “Hello World! Computer Programming for Kids and Other Beginners” I tried to walk my stepdaughter through it remotely but it was a dismal failure. I really liked the book but she had way to many issues getting things setup and she stopped before she started. Not the best intro. This weekend I was talking to my 8 year old daughter and she wanted to learn programming. Now I wasn’t going to make the same mistake twice, so I poked around and found Small Basic. This is a fantastic tool. It’s straight forward and simple. Here’s the kicker. The first example we went through was this silly turtle drawing a box. Yep that Logo Turtle from years ago is still around.

Funny thing is it really is a great intro to programming. The discussion started with how computer language is backwards from the way we talk. We say “Show the turtle” but computers want the noun first “Turtle Show”. We quickly got to Turtle.move(50), Turtle.turn(90) and other supper complex commands.

What I was really impressed with is how Small Basic keeps things really simple. The interface is straight forward and easy to use. There is a nice inspector tool that allows you to browse through the available objects and functions to see what you might want to use.

There is also a site with recipes to work through. These modules ask you to work through problems step by step. The interesting part is that you can easily import the lesson into Small Basic by just typing in the module ID.

I know there are many other options out there. All in all this was a great introduction to programming for my daughter. She saw immediate results with very little effort. In no time we were working with variables making simple MadLib stories.

Best part is she wants me to teach her more.

OK secretly I’m hoping she learns enough so I…I mean SHE can get Lego Mindstorm sets J


Coffee Notes: Seven Wastes of Software Development

Seven Wastes of Software Development Here’s an interesting article on the Seven Wastes of Software Development

In the article, Matt Stine, discusses the concepts of eliminating waste, first as it was presented in the Toyota Production System then expanding the idea into the world of software development. This series discusses Mary and Tom Poppendieck’s mapping of Shigeo Shingo’s “Seven Wastes of Lean Manufacturing” into the software development world.
Stine proposes the seven Wastes of Software development include:

  1. Partially Done Work
Waste
  2. Extra Features
Waste
  3. Relearning
Waste
  4. Handoffs
Waste
  5. Delays
Waste
  6. Task Switching
Waste
  7. Defects

It’s really a good read. You should take a moment to check it out:

http://mattstine.com/2010/11/10/the-seven-wastes-of-software-development/


Layers of Architecture

There are tons of architects out there today. It seems when you’ve spent enough time as a developer, you end up becoming an architect.  Architecture is not just the next step in a developers career. There are whole new disciplines and methodologies applicable to architecture. That said here are the common levels of architecture.

Enterprise Architecture (planner)

Enterprise architecture is a high level field that concentrates on how the various domains or subject areas interact. This layer spends even more time focusing on how technology will be utilized in the future, and governing how it is used today. Enterprise architects work to create technology roadmaps and work with the business to plan for the implementation. Enterprise architects create technology projects. It is at this layer where frameworks like TOGAF and taxonomies like Zachman come into play. This layer view the enterprise as a holistic entity.

 

Solution Architecture (designer)

A solution is an answer to a question. The question in this case is typically an IT project. The solution architect’s primary objective is to design a solution that meets the projects requirements and also falls in line with the domain and enterprise architecture guidelines. The solution architect is responsible for coordinating with multiple domain architects to design the most appropriate solution. A solution architect may interact with domain architects in infrastructure, web services, data management, and so on. During the course of the project a solution architect will typically create many work products either for communicating the solution to a governance board, to explain the implantation to a developer and various other uses. These work products are eventually owned by the domain architect as codified knowledge of the system after the project implementation.

 

Domain Architecture (owner)

A domain is an area of focus. Domain architects are primarily focused on maintain a specific area of technology or a specific application. These architects are the owners and gatekeepers for a specific area. The work in this area is primarily concerned with the current state of the system. These architects are charged with managing the knowledge for their area. These architects are also responsible for keeping up to date on future projects related to the domain and guiding the designs to meet the overall objectives of the domain. A successful domain architect will know that a future project will require x functionality. When an active project is debating between two possible implementations, the domain architect will be able to guide solution toward the best of the two solutions that meet the future goals.

 

Application or System Architecture(builder)

The application or system architect is primarily focused on the implementation at hand. This is the most detailed level of architecture. An application architect, for instance, would be concerned with the most appropriate design pattern to use in a certain programming situations. These tend to evolve from the most advance developers and engineers. The primary focus here is to implement the best solution for a specific task. Work products that may be produced during this layer are primarily used to communicate to the developers or implementers. In many co-located environments a lead developer often fills this role and very few work products are actually produced. Instead the team may utilized whiteboards or code stubs to communicate the implementation. For larger more dispersed projects, or for outsourced solutions, the application or system architect has a more demanding role for providing detailed implantation instructions. 

 

Conclusion

The various layers of architecture are not meant to be isolated entities. In most situations one architect will fill multiple roles at various levels. Each layer has a unique focus. Understanding the layers helps clarify responsibilities, activates and deliverables. From a career development standpoint individuals can use the layers as the basis for a personal gap analysis and learning plan.

 

I look forward to reading your thoughts and comments.

 

Best of luck in all your endeavors.


Code Quality with Eclipse Plugins

image Tech leads are continually challenged with identifying and governing code quality. The common response is to look to test coverage as a measure of quality. Previously I was challenged to monitor code and architectural quality for over 50 developers both on and offshore. The shear amount of code made manual reviews a nightmare. While had reports on coverage it became apparent that the quality of the tests themselves  was also in question. It was time for a more automated review of quality.

After reviewing a series of tools and working through various industry best practices, here is the list of tools I ended up relying on regularly.

Automatically Format on Save

The standard fare

Often Overlooked

Code Coverage

Focus on the important code

There are a few really good articles to help you get up and running with these

Check out:

Andrew Glover: In Pursuit of code quality

Metrics

Use the tools available to analyze faster and make your code stronger.

FEEDBACK: Let me know if there are other tools or resources that make your life easier.


Bite Size: Object Oriented JavaScript

JavaScript is typically thought of as a procedural scripting language, however it contains many aspects that allow for Object Oriented style scripting. Below you will find a few examples of how to script JavaScript in an Object Oriented style.

Before you start
The best way of studying this tutorial is to have Firefox with Firebug handy. This way you can test the tutorial examples immediately.

Install both of them if you haven’t already done so.

Also review the tutorial on using Firebug and additional tips on debugging with firebug

{tip}

The Firebug command line, found at the bottom of the Console tab, is no different than any command line you’ve used in UNIX, DOS, or Windows—except that it accepts commands written in JavaScript.

The command line is more than just a place for one-liners. You can expand it to become a full-size editor. When you’re working in your external editor, you can quickly copy-and-paste code into the Firebug editor to execute them immediately and how they effect the live page. Once you’ve gotten the result you’d like, copy the finished code and paste it back into your editor.

{tip}

Variables
Global variable definition

var myVariable = "myVar";

function visibilityExample(){
	/* visibility: public */
	this.publicVar="";
	/* visibility: private */
	var privateVar="";
}

Methods
Simple method with return

function MyMethod1() {
    var rtnVar1 = null;
    this.pubVar1 = "1";
    rtnVar1 = this.pubVar1
    return rtnVar1;
}
alert(MyMethod1()); // returns 1

Static Objects
Demonstrates Object with static methods foo and bar

var MyObject2 = {
    foo: function() {
        var rtnVarFoo = null; //private variable
        this.pubVar2 = "2"; //public variable
        rtnVarFoo = this.pubVar2;
        return rtnVarFoo;
    },  // notice the comma
    bar: function() {
        var rtnVarBar = "2";
        return rtnVarBar;
    }
}
alert(MyObject2.bar());  //returns 2

Basic Object Instantiation
Demonstrates basic object instantiation

function MyObject3(r,g,b)
{
  this.Red = r;
  this.Green = g;
  this.Blue = b;

  this.bar = function(){
        var rtnVarBar = "3";
        return rtnVarBar;
  }
}
myNewObj3 = new MyObject3("red","green", "blue");
alert("Bar: " + myNewObj3.bar());  //returns 3

Basic Prototype Example

/* Base object */
function MyObject4() {
    // constructor code goes here
    this.myVariable4 = 5;
    this.bar = function(){
        var rtnVarBar = "4";
        return rtnVarBar;
  }
}
/* Adds method to Base object */
MyObject4.prototype.memberMethod = function()
{
    return this.myVariable4;
}
myNewObj4 = new MyObject4();
alert(myNewObj4.memberMethod());

Basic Inheritance Example
prototype = base object type (think extends)
objects not defining a prototype are thought to extend Object
(think extends Object)
objects (objA) that have their prototype set (to objB) are thought to extend the second object (objA extends objB)

// Base Object
function Employee () {
    this.name = "";
    this.dept = "general";
}

// Manager extends Employee
function Manager () { // defines initial Manager constructor
    this.reports = "Bob, Jane";
}
Manager.prototype = new Employee;  // sets Manager as an extention of Employee

// WorkerBee extends Employee
function WorkerBee () { // defines initial WorkerBee constructor
    this.projects = "SalesProj, MarketingProj";
}
WorkerBee.prototype = new Employee;  // Sets WorkerBee as extention of Employee

myManagerJohn = new Manager();
myManagerJohn.name="John";
alert("Name: " + myManagerJohn.name + "\nDept: " + myManagerJohn.dept + "\nReports: " + myManagerJohn.reports);

myWorkerBeeBob = new WorkerBee();
myWorkerBeeBob.name="Bob";
myWorkerBeeBob.dept="Sales";
alert("Name: " + myWorkerBeeBob.name + "\nDept: " + myWorkerBeeBob.dept + "\nProjects: " + myWorkerBeeBob.projects);

Extending the base prototype
Adds to base object AFTER child objects have been created aka. Dynamic Inheritance

// Base Object
function Employee () {
    this.name = "";
    this.dept = "general";
}

// Manager extends Employee
function Manager () { // defines initial Manager constructor
    this.reports = "Bob, Jane";
}
Manager.prototype = new Employee;  // sets Manager as an extention of Employee

// WorkerBee extends Employee
function WorkerBee () { // defines initial WorkerBee constructor
    this.projects = "SalesProj, MarketingProj";
}
WorkerBee.prototype = new Employee;  // Sets WorkerBee as extention of Employee

myManagerJohn = new Manager();
myManagerJohn.name="John";
alert("Name: " + myManagerJohn.name + "\nDept: " + myManagerJohn.dept + "\nReports: " + myManagerJohn.reports);

myWorkerBeeBob = new WorkerBee();
myWorkerBeeBob.name="Bob";
myWorkerBeeBob.dept="Sales";
alert("Name: " + myWorkerBeeBob.name + "\nDept: " + myWorkerBeeBob.dept + "\nProjects: " + myWorkerBeeBob.projects);

Employee.prototype.hourlyRate = "50"; // << Dynamic Inheritance

alert("Name: " + myManagerJohn.name + "\nDept: " + myManagerJohn.dept + "\nReports: " + myManagerJohn.reports + "\nHourly Rate: " + myManagerJohn.hourlyRate);
alert("Name: " + myWorkerBeeBob.name + "\nDept: " + myWorkerBeeBob.dept + "\nProjects: " + myWorkerBeeBob.projects + "\nHourly Rate: " + myWorkerBeeBob.hourlyRate);

Working With Constructor Parameters

/**
 * Base Person object with empty constructor
 * @constructor
 */
function Person(){
    this.name="Name: ";
}
/**
 * Base Person object with 1 element constructor
 * @constructor
 */
function Person(name){
    this.name="Name: " + name;
}

bob = new Person("Bob");
alert(bob.name);

/**
 * Extended object with constructor
 */
function Teacher(name, subject){
    this.base = Person;
    this.base(name);  // Think super(name) from java
    this.subject="Subject: " + subject;
    this.toString = function(){
        return this.name + "\n" + this.subject;
    }
}
Teacher.prototype= new Person;  // Ensures dynamic inheritance

jim = new Teacher("Jim", "Math");
alert(jim);

/**
 * Using ".call" for parent rather than ".base"
 * for a 'cleaner' implementation
 * .call was implemented in: JavaScript 1.3
 */
function Janitor(name, shift){
    Person.call(this,name); // Think super(name) from java
    this.shift="Shift: " + shift;
    this.toString = function(){
        return this.name + "\n" + this.shift;
    }
}
Janitor.prototype= new Person;  // Ensures dynamic inheritance

stan = new Janitor("Stan", "Night");
alert(stan);

Coffee Notes: Scrum’s, Common sense?

One of the best things about agile methodology is the communication between everyone. At the root of that communication are the daily scrum sessions the teams have to discuss status, plans and issues. These brief meetings each day help keep everyone on tap with the details of the project at hand.

So my question is, is the concept of a daily status meeting that new and unique or just a reiteration of some basic common sense?

I think historically developers have had the leeway of not being truly accountable for their work. Effort and quality were rather subjective. With daily, open communication and open reports noting code quality, the development process can reduce the overall degree of bravado and focus on production.


Money well spent

An interesting thing happens when you get married and have kids, you start evaluating your purchases more. While I’m still trying to convince my wife that “The View” would be so much better on a High-Def Plasma TV, I have made some purchases I have no regrets on. Top on my list is my monthly subscription to Safari Books Online. Safari is an invaluable resource. I can read any number of tech books whenever I want, and with the amount of topics I’m interested in purchasing every book from the store would seriously cut into my Plasma TV fund. When I’m done with a book online I just remove it from my shelf and grab another one. I would highly suggest Safari Books Online if you do any technology reading.

http://my.safaribooksonline.com


Follow

Get every new post delivered to your Inbox.