Archive for the 'Programming Languages' Category

The early history of Smalltalk

Today I wanted to comment a text, in my opinion, a “must be read” by all those of us dedicated to software development. It is a writing of Alan Kay, about the early history of Smalltalk:

Smallhistory.pdf

It is an excellent text to read, and that has influences simply beyond Smalltalk. It is a history of how some ideas were arising, within the American community of software development. How the programming with objects was arising, and how the form to interact with the present computers was taking form.

Read, for example, how Kay detects  some germinal ideas (data along with behaviour) in developments of the Air Force, that today we would see very remote of the OOP. Read on his contact with Lisp, and Seymour Papert. Read on the internal problems of Xerox, the competition with DEC, how some ideas were almost generated by chance. Read on Simula, Euler, IPL predecessor of Lisp. Read on the Sketchpad of Sutherland (who I found by first time in some historical revision of the Scientific American). It is a delicious and enlighten reading, at least for me.

Kay has been having an idea for years, that I share: the idea that the machine, and computing in general, must serve to us to expand our human capacities. Excellent idea. It is what of some form also today we are reaching using Internet. Today, branches of the knowledge and human actions, have been leveraged by software, the hardware and everything what it has happened in our profession in the last decades.

Years ago, people guessed that the space trips were going to revolutionize human history. That has still not happened. But of some form subproduct of the cold war and the space race, the development of the computing science (we remember its modern beginnings in the second war, and the appearance of the cybernetics impelled by military subjects) and of Internet, is what it has caused a change, that is reaching to great part of the humanity.

To read the history of Kay is indispensable to be understanding what it has happened. Somebody that has said ” the best form to dominate the future, is inventing it” (approximated phrase, reads the text, to see where it arose exactly).

Angel ” Java” Lopez
http://www.ajlopez.com/en

QCon London 2008

I’ve received an email, from Floyd Marinescu, announcing this “mega” conference. They’ll cover all-about-software-development: agile, DSLs, SOA, SaaS, Cloud computing (I guess grid computing related), .NET, Java, Ruby, Rich Client, Scrum, XP, F#, REST…. It will be the DisneyWorld of all software developers! ;-)

Here’s the announce:

You are receiving this email because you opted-in to receive notifications related to QCon London, from the QCon London website. QCon London is taking place in just 8 weeks, March 12-14 and the conference editorial is nearing final. Since our last update in December, a number of important changes have been made to the conference:

  • Google, Yahoo!, Amazon, Salesforce.com now presenting in the Cloud Computing Track
  • MySpace.com, eBay, Magus confirmed in the Architectures you’ve always wondered about Track
  • XP founder Kent Beck, and Analysis Patterns & Refactoring Author Martin Fowler keynoting
  • Banking Architectures Track adds sessions from Merrill, Betfair, Credit Suisse
  • GoF Patterns Author & Eclipse Architect Erich Gamma presenting
  • and much more…

QCon is an enterprise software development conference for team leads, architects, and project managers covering Architecture & Design, Java, .NET, Ruby, SOA, Agile methodologies and other timely topics such as DSLs, cloud computing, and bank/finance architectures. Last year’s QCon London had almost 500 registrants, and was covered very heavily in blog space see QCon London blogger coverage & key take aways).  

The track themes for QCon London & track hosts are as follows:
Architectures You’ve Always Wondered About -  Hosted by Redmonk’s James Governor
The last 2 QCon’s featured: Amazon, Linked-In, Yahoo!, eBay, Second Life, and Orbitz architecture case studies
Domain Specific Languages in Practice - Hosted by ThoughtWorks’ Neal Ford
Takes DSLs to the next level by practical applications and tools that are useful today.
Effective Design
Translate a set of abstract ideas into working and functional software in an effective way.
Architectures in Agile - Hosted by POSA author Kevlin Henney
How to integrate the trade-offs related to aspects such as performance, security, scalability and modifiability into an agile process
Banking: Complex high volume/low latency architectures  - Hosted by John Davies & Alexis Richardson
The latest innovations as well as time-proven best practices that architects of banking & finance systems need to know.
The Cloud as the New Middleware Platform - Hosted by EAI Patterns Author Gregor Hohpe
Is the internet becoming the computer?
Implementing Scrum and XP- Hosted by Patterns Almanac author Linda Rising
Leading practitioners will present and explain how Scrum and XP are implemented in the most effective way.
Java Emerging Technologies - Hosted by Java Concurrency Author/spec lead Brian Goetz
The previous QCon covered: JRuby, Grails, Server-side OSGi, DSL development, Batch Processing
.NET in the Enterprise - Hosted by Matt Deacon
.NET has brought Microsoft’s platforms into many business-critical applications, back-office, and server-side solutions.
Programming Languages of Tomorrow
Erlang, F#,, Intentional and Scala. How can we best leverage them in our next software project?
SOA, REST and the Web - Hosted by InfoQ’s Lead SOA Editor Stefan Tilkov
REST & SOA, Internet Scale Integration, REST & WS Myths
Browser & Emerging Rich Client Technologies - Hosted by InfoQ lead RIA/Java editor Scott Delap
Silverlight vs. JavaFX/Consumer JRE vs. Adobe Flex/AIR vs. Google’s Ajax RIA stack
The Rise of Ruby
Learn how to best take advantage of what Ruby has to offer
The first two QCon were well received, below are some comments from bloggers who attended our most recent QCon:

  • David Forbes - Exhilirated after gorging on brain candy this week, I have a moment to reflect on what just happened. QCon was the right place to be. I can’t imagine where else I would have rather been. If I had the week to do again, I would probably march right down to the Westin…again.
  • Denis Bregeon - I was very happy with it. Most of the talks tickled my imagination and that is the primary thing I was looking for. Many others gave me details on more technical subjects that I wanted to learn about.
  • Srini Penchikala - I was at the QCon conference in San Francisco last week. It was a great experience to be there. I learned a lot not only from the presentation speakers and panelists but also from the attendees who came from different countries (England, Syria, Australia to name a few) and companies.
  • Alex Olaru - Great conference: excellent speakers, very relevant topics, just enough product pushing without it becoming annoying. All in all a conference I would highly recommend to any architect or project manager.
  • Ola Bini - Last week I attended QCon San Francisco, a conference organized by InfoQ and Trifork (the company behind JAOO). It must admit that I was very positively surprised. I had expected it to be good, but I was blown away by the quality of most presentations.
  • Martin van Vliet - All in all, this was a good conference and more than enough reason to look forward to the next QCon, next year in London.
  • Pete Lacey - A wonderful conference made better by being able to meet many people face to face for the first time…

See also past QCon/JAOO talks available online on InfoQ:

Registration for the 3 day conference is 1180£ until Feb 22nd, and 1220£ after March 11th. The conference will be held at the Queen Elizabeth II Center, like last year.  Join us at QCon London!

Angel “Java” Lopez
http://www.ajlopez.com/en

What’s new in Visual Basic.NET (Part 2)

I wrote about some new features in the new version of VB.NET 9, that is integrated inside the Visual Studio 2008. I’m working with the Beta 2. You can read:

What’s new in Visual Basic .NET (Part 1)

For this post, I wrote an example, that can be downloaded from VbNetNew2.zip

As in the previous example, I’m using a class Supplier. In a module named Extensions, I put two new extension methods:

Imports System.Runtime.CompilerServices 

Module Extensions 

    <Extension()> _
    Public Function Append(Of T)(ByVal a As T(), _
ByVal b As T()) As List(Of T)
        Dim result = New List(Of T)(a) 

        result.AddRange(b) 

        Return result
    End Function 

    <Extension()> _
    Public Sub Show(ByVal suppliers As IEnumerable(Of Supplier))
        For Each supplier As Supplier In suppliers
            Console.WriteLine("Supplier {0} {1} ({2})", _
supplier.SupplierId, supplier.Name, supplier.City)
        Next
    End Sub 

End Module

Remember: extension methods can be attached to instances of existing classes, extending it functionality. This is a new feature, that can be used to enhance the behaviour of any framework class. LINQ is an example of extension methods: it adds many new functions to list, collections, dictionaries, without the need of change the framework.

In VB.NET, extension methods are defined as methods inside a module, and they are marked with the attribute <Extension()> . The type of the first parameter is the class to be extended.

The above Append method, uses generics. It’s a method to be applied to any array, of any given type T. And it returns a typed list of T items.

The Show method is used in any IEnumerable of Supplier elements.

This is an example of the flexibility of extension methods. Really, it is a powerful way to change and enhance any class, type, and generic type.

In the Main method, the Append is used to obtain the union of two list, and then, the Show method prints the resulting list:

 1     Sub Main()
 2         Dim suppliers() As Supplier = New Supplier() { _
 3             New Supplier(1) With {
.Name = "John Madison", .City = "Washington"}, _
 4             New Supplier(2) With {
.Name = "Ann Arbor", .City = "Ohio"}, _
 5             New Supplier(3) With {
.Name = "Don Johnson", .City = "Miami"}, _
 6             New Supplier(4) With {
.Name = "Bill Clinton", .City = "Washington"} _
 7         }
 8 
 9         Dim suppliers2() As Supplier = New Supplier() { _
10             New Supplier(5) With {
.Name = "John Smith", .City = "New Jersey"}, _
11             New Supplier(6) With {
.Name = "Mary Dupinsky", .City = "Los Angeles"}, _
12             New Supplier(7) With {
.Name = "Ronald Reagan", .City = "Washington"}, _
13             New Supplier(8) With {
.Name = "Brad Shapiro", .City = "Dallas"} _
14         }
15 
16         Dim allsuppliers = suppliers.Append(suppliers2)
17 
18         Console.WriteLine("All Suppliers")
19         allsuppliers.Show()
20 
21         Dim suppliers3 = allsuppliers.FindAll(
Function(s) s.City = "Washington")
22 
23         Console.WriteLine()
24         Console.WriteLine("Suppliers In Washington")
25 
26         suppliers3.Show()
27 
28         Dim suppliers4 = From s In suppliers _
29                              Where s.City = "Washington" _
30                              Select s
31 
32         Console.WriteLine()
33         Console.WriteLine("Suppliers In Washington")
34 
35         suppliers4.Show()
36 
37         Console.ReadLine()
38     End Sub
39 

At line 21, an extension method from LINQ is applied to find any element in the list that satisfies a predicate. This predicate can be defined inline, as an anonymous method, with the new keyword Function.

At line 28, LINQ is used directly in the language. As in C Sharp, the  from is written before the select. This “strange” order  is used by the IDE to determine what kind of data is selected, information that it infers with the from clause.

Angel “Java” Lopez
http://www.ajlopez.com/en

What’s new in Visual Basic .NET (Part 1)

In previous posts:

What’s new in C Sharp (Part 2)
What’s new in C Sharp (Part 1)

I wrote about some new features in C Sharp 3, integrated in Visual Studio 2008 (I’m using the Bete 2).

Now, I have an example, in VB.NET 9 (the new version of the language), to download from VbNetNew1.zip

It’s a simple console application, that has a class Supplier:

Public Class Supplier
    Private mSupplierId As Integer
    Private mName As String
    Private mCity As String   

    Public Sub New(ByVal id As Integer)
        mSupplierId = id
    End Sub   

    Public Property SupplierId() As Integer
        Get
            Return mSupplierId
        End Get
        Set(ByVal value As Integer)
            mSupplierId = value
        End Set
    End Property   

    Public Property Name() As String
        Get
            Return mName
        End Get
        Set(ByVal value As String)
            mName = value
        End Set
    End Property   

    Public Property City() As String
        Get
            Return mCity
        End Get
        Set(ByVal value As String)
            mCity = value
        End Set
    End Property
End Class

I didn’t found any support in the new VB.NET for automatic properties, as in C Sharp. So, in this example, the class code has no new feature.

At subroutine Main:

 1     Sub Main()
 2         Dim suppliers() As Supplier = New Supplier() { _
 3             New Supplier(1) With {.Name = "John Madison", 
.City = "Washington"}, _
 4             New Supplier(2) With {.Name = "Ann Arbor",
.City = "Ohio"}, _
 5             New Supplier(3) With {.Name = "Don Johnson",
.City = "Miami"} _
 6         }
 7 
 8         For Each supplier As Supplier In suppliers
 9             Console.WriteLine("{0} {1}",
supplier.SupplierId, supplier.Name)
10         Next
11 
12         Dim c = New With {.Name = "John Doe",   

.City = "Everywhere"}
13 
14         Console.WriteLine("{0} lives in {1}", c.Name, c.City)
15 
16         For Each supplier As Supplier In suppliers
17             supplier.Print()
18         Next
19 
20         Console.ReadLine()
21     End Sub
22 

there are some new features in use. At line 2, you see the creation and initialization of an array, using brackets. At lines 3, 4, and five, the creation of objects uses With. Using this word, we can call a constructar, as Supplier(1), and then complete the properties, using point and the property name.

At line 12, a variable is created with an implicit type. The new doesn’t refer to any class, but using with the properties can be defined.

Then, IDE “makes”, infers the type of variable c, and we can use  c.Name and c.City as at line 14.

At line 17, Print is not a method of class Supplier. It’s defined in other “class”:

Imports System.Runtime.CompilerServices   

Module Extensions   

    <Extension()> _
    Public Sub Print(ByVal supplier As Supplier)
        Console.WriteLine("Supplier {0} {1}", _
supplier.SupplierId, supplier.Name)
    End Sub   

End Module

This is an extension method: a method that can be defined to all instances of a class, out of this class definition. In CSharp, we use static classes to this purpose. Here, in VB.NET, we use modules. To be an extension method, in CSharp a this is used in the first argument. Here, an attribute <Extension()> is attached to the method definition. That attribute is defined inside namespace System.Runtime.CompilerServices.

Angel “Java” Lopez
http://www.ajlopez.com/

Interview preparation

Augusto Alvarez (a good guy that shares his knowledge, and who deserves to be in the NBA, he’s doubles me in height…. ;-), sent me this interesting link:

http://interviewhelper.blogspot.com/

a blog that contains most common interview questions from different fields:

SQL Server Interview Questions
.NET Interview Questions
JAVA Interview Questions
Database
SQL Server
Software Testing
Basic .NET Framework
SAP Interview Questions
ABAP Interview Questions
C++ interview Questions
C Interview Questions
PHP Interview Questions
ASP.net Interview Questions
Java Interview Questions

I liked the “less technical” posts:

Points to remember
Salary Negotiation
Resume Preparation Guidelines

In my opinion, you must prepare a blog, where you must post about your knowledge, researchs, studies, interesting things you found, and more. You are you and your blog.

Just curious:

The Bloggers Business School

Angel “Java” Lopez
http://www.ajlopez.com/en

What’s new in C Sharp (Part 2)

I’m still playing with some new features of CSharp 3.x, that I’m testing with Visual Studio 2008 Beta 2. In a previous post What’s new in C Sharp (Part 1) I wrote about Extensions Methods. Now, in this example, I explore some of the possibilities and application of such feature.

The tiny example can be downloaded from CSharpNew2.zip

It’s a console application, with the beggining:

1 using System;
2 using System.Collections.Generic;
3 using System.Linq;
4 using System.Text;
5 

Visual Studio puts that beginning, in the .cs file. Note that System.Linq is included. That enables the use of new method (implemented as extension methods) on many classes of the framework.

Remember: extensions methods are written inside static classes.

In the example, that class is Extensions:  

 1 static class Extensions
 2 {
 3     public static List<T> Append<T>(this List<T> list1,

           List<T> list2)
 4     {
 5         List<T> result = new List<T>(list1);
 6         result.AddRange(list2);
 7
 8         return result;
 9     }
10
11     public static void Show(this IEnumerable<Supplier> suppliers)
12     {
13         foreach (Supplier supplier in suppliers)
14             Console.WriteLine("Supplier {0} {1} ({2})", 

                 supplier.SupplierId, 

                 supplier.Name, 

                 supplier.City);
15     }
16 }

The Append method reveices two typed lists (typed via generics), that manipulate elements of type T, and returns a new list with the sum of those elements. You can see the use of this to indicate that the first parameter is the object to which apply the new  Append method.

The Show method could be applied to any IEnumerable over  Supplier elements.

In the Main method:

 1 class Program
 2 {
 3     static void Main(string[] args)
 4     {
 5         List<Supplier> suppliers =
 6             new List<Supplier> {
 7                 new Supplier(1) { Name = "John Madison", 

City = "Washington" },
 8                 new Supplier(2) { Name = "Ann Arbor", 

City = "Ohio" },
 9                 new Supplier(3) { Name = "Don Johnson", 

City = "Miami" },
10                 new Supplier(4) { Name = "Bill Clinton", 

City = "Washington" }
11             };
12
13         List<Supplier> suppliers2 =
14             new List<Supplier> {
15                 new Supplier(5) { Name = "John Smith", 

City = "New Jersey" },
16                 new Supplier(6) { Name = "Mary Dupinsky", 

City = "Los Angeles" },
17                 new Supplier(7) { Name = "Ronald Reagan", 

City = "Washington" },
18                 new Supplier(8) { Name = "Brad Shapiro", 

City = "Dallas" }
19             };
20
21         var suppliersall = suppliers.Append(suppliers2);
22
23         Console.WriteLine("All Suppliers");
24         suppliersall.Show();
25
26         var suppliers3 = suppliersall.FindAll(

                    s => s.City == "Washington");
27
28         Console.WriteLine();
29         Console.WriteLine("Suppliers In Washington");
30
31         suppliers3.Show();
32
33         var suppliers4 = from s in suppliers
34                          where s.City == "Washington"
35                          select s;
36
37         Console.WriteLine();
38         Console.WriteLine("Suppliers In Washington");
39
40         suppliers4.Show();
41     }
42 }
43 

At line 21, I use the Append method applied on a List<Supplier>. At line 25, you see that supplierall has available the Show method.

The FindAll method enables the use of an anonymous predicate s => s.City == “Washington”, a function that receives a function that receives an s parameter and returns a boolean, true or false, depending on the city of the supplier.

At line 33, there is a LINQ query, integrated in the language, that generates the same result that the produce the same result that the FindAll method. The from is coming first, and select is in last position: this order enables the environment to discover the type of result, to use during the select specification (Intellisense is available).

Angel “Java” Lopez
http://www.ajlopez.com/en

What’s new in C Sharp (Part 1)

I want to write a short post about some new features I was using of the new flavor of C Sharp language: its version 3.0. Now, in a class declaration, you can define properties, without the internal variables declaration: this feature is called implicit properties. Its a welcome capability, that simplify the writing of components to use in WCF, web services, and business entities (short code example to download from CSharpNew1.zip):

 1 public class Supplier
 2 {
 3     public int SupplierId { get; private set; }
 4 
 5     public string Name { get; set; }
 6     public string City { get; set; }
 7 
 8     public Supplier(int Id)
 9     {
10         SupplierId = Id;
11     }
12 }

Other feature: now, you can create objects and specify its properties, with the same command:

1     List<Supplier> suppliers =
2         new List<Supplier> {
3             new Supplier(1) { Name = "John Madison", City = "Washington" },
4             new Supplier(2) { Name = "Ann Arbor", City = "Ohio" },
5             new Supplier(3) { Name = "Don Johnson", City = "Miami" }
6         };

It’s possible to create implicit objects: objects without an explicit class: you must specify the properties “on the fly”::

1     var c = new { Name = "John Doe", City = "Everywhere" };
2 
3     Console.WriteLine("{0} lives in {1}", c.Name, c.City);
4 

Some times, you need to extend the functionality of an existing class, with new methods. In an static class, you can write the new methods: it must be used a first parameter with this <TargetClass>:

1 public static class Extensions
2 {
3     public static void Print(this Supplier supplier)
4     {
5         Console.WriteLine("Supplier {0} {1}", supplier.SupplierId, supplier.Name);
6     }
7 }
8 

In the above fragment, all objects in the class Supplier will have a new method Print, to use:

1     foreach (Supplier supplier in suppliers)
2         supplier.Print();

This feature is used a lot in the .NET framework 3.x, for example, in LINQ, to extend the behavior of lists, collections, dictionaries and preexistent classes.

VB.NET 3.x has similar features, but that deserves another post.

Thanks to Southworks and the Tamesis team, for the help and support to write this post.

Angel “Java” Lopez
http://www.ajlopez.com/en

Smalltalk Archeology

Aaron Reichow posted a message to Squeak development mailing list. He published a page with old versions of Smalltalk. You can download these oldies, too:

http://bitquabit.com/rev/old/
http://bitquabit.com/rev/old/download

 Look and feel of Digitalk Methods 1.1 (old good times… :-):

 

I remember such windows, popularized via Borland products…. I want my Sidekick!!… :-)

The original message:

> Hey Squeakers!
>
> I and others have discussed old versions of Smalltalk a few times on  the
> list in recent months.  Something I mentioned was putting up a  page with
> screenshots of various old versions of Smalltalk.  I  recently got a few
> of these old Smalltalks running and tonight I put  together a simple page
> with a few screenshots and some basic info.
>
> Check it out at:
> http://bitquabit.com/rev/old/
>
> Right now I’ve got some info and screenshots up for: Apple  Smalltalk-80
> for Mac OS Classic, Digitalk Methods 1.1 (text-mode) for  DOS, and
> Digitalk Smalltalk/V 286 R3 (graphical) for DOS.
>
> Thanks to all those who made this thing we love: Smalltalk! And  thanks to
> those who have helped me out with this lil project.
>
> Regards,
> Aaron
>