Challenges for Software Engineers

Software Engineering is the youngest of all the professions, being born around 50 years ago, but since then it has been continually improved. Practicers have fiercely debated upon it through the years, given the extremely fast pace of the innovations in the field, and the extremely difficult and inherently dynamic nature of software. Many trends have appeared and vanished, and many others will come.

In this article I will provide a short overview of two kinds of challenges that I consider that software engineers will have to confront in the next 20 years: the human and the technical. Continue reading

The beauty of Cocoa

(Highly geeky post ahead. You’ve been warned!)

I have found the very message that summarizes the beauty of Cocoa in a single word; see by yourselves, hereunder in line 47:

[source:c]

import

// The interface of a person @interface Person : NSObject { NSString* firstName; NSString* lastName; int age; } @end

// The implementation of the Person @implementation Person -(id)init { if (self = [super init]) { firstName = @”"; lastName = @”"; age = 0; } return self; }

-(void)dealloc { [firstName release]; [lastName release]; [super dealloc]; }

-(NSString*)description { return [[NSString alloc] initWithFormat:@”Name: %@ %@, %d years old”, firstName, lastName, age]; } @end

// Some code using the Person class int main (int argc, const char * argv[]) { NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];

NSMutableDictionary* dict = [[[NSMutableDictionary alloc] init] autorelease];
[dict setObject:@"Teto" forKey:@"firstName"];
[dict setObject:@"Rodriguez" forKey:@"lastName"];
[dict setObject:[[NSNumber alloc] initWithInt:34] forKey:@"age"];
Person* person = [[[Person alloc] init] autorelease];
// The beauty of Cocoa can be resumed to this very line:
[person setValuesForKeysWithDictionary:dict];
// Now sit back and relax:
NSLog([person description]);
[pool drain];
return 0;

} [/source]

Basic vs. Digest

In the series of highly boring posts ;) here’s another one; in this case, a simple explanation of two different authentication protocols available in the HTTP standard.

HTTP Basic Authentication Protocol

This is the simplest HTTP Authentication protocol available:

  1. The browser sends a request to a protected resource: GET /index.html
  2. The server looks for the “Authenticated” header in the request; since it does not find it, it replies back with a response with the 401 code (“Unauthorized”). The response contains a “WWW-Authenticate” header, with the value “Basic”. This response is called a “challenge”, and it also contains a “realm” text, which describes the protected resource in clear text (the “realm” is shown in the pop-up window that usually appears for you to type your password when this protocol is used).
  3. The browser creates a new request GET /index.html that contains an HTTP_AUTHORIZATION header, whose value is the word “Basic” followed by the ‘username:password’ string encoded in base 64. This algorithm is a two-way algorithm: you can retrieve the username and password from the base 64-encoded string.
  4. The server receives this response, and since base 64 is a two-way algorithm, it compares the MD5 (or SHA1) password hash to the one stored in the database. If they are the same, the request is processed. Otherwise, the user gets a 401 again.

Continue reading

Pastrami Sandwich

I find many similarities between an event like WWDC and a similar one I’ve attended at Redmond long ago; both are big (huge!) events, with thousands of (men) engineers from around the world (and very few women), with a keynote by the founder, lots of events every morning and afternoon, and merchandasing stuff all over the way. And of course, in both cases you get food boxes for lunch.

However, there is one basic difference between both events. Apple not only has interesting technologies to show up, even bleeding edge ones, more often than not on the open and public domain (many of which I can not write about, and boy they are going to make a difference!), but even better than that, it has a vision.

And passion. Cocoa developers are among the most passionate I’ve ever met, and you just can’t find that in a Microsoft event. You can feel that in the (conditioned) air of the Moscone center, almost touch it. New projects everywhere. People discussing about their ideas. Lots of collaboration, openness and willingness to go further. Microsoft’s stuff is, well, boring at best; dull and gray. Enterprise IT is no fun, believe me, but there’s no reason to try to look at it in a different way. And faithful to its own way, Apple is precisely doing that, right now; and what’s about to come will reshape the industry forever. Continue reading

Pourquoi pas?

Pourquoi ne peut-on pas avoir des conférences comme celle-ci, avec des mini-events comme celui-ci en parallèle en Romandie? Ou encore comme celle-ci? Ou bien comme cette autre! Ou celle-là!

Pourquoi pas? Est-ce que le marché est trop petit? Y a-t-il un manque d’intérêt général? Je pense que le problème est important, et qu’une grande partie de l’élan technologique local est étouffé par ce manque d’une grande conférence technique chez nous.

Après tout, le web a été inventé à Meyrin. Continue reading

On the Need of Minimalist Polyglots

Many companies, at some point of their history, ask themselves a simple question: what programming language should I use? The answer to this question is tricky, and has big, big consequences, for every single line of code of your future products will be written, read and suffered by it. This single choice defines the level of salaries you will have to pay, the skills of programmers you will have to deal with, the relative length and performance of your systems, the availability of tools (or lack thereof), the kind of support you will get (or not), the number of operating systems your code will work in, etc.

Given the fact that Web Development equals Software Development, this discussion will be of interest to those building the smallest websites, as well as old desktop-intensive apps. It will not be a “Tell me what programming language you use, and I will tell you who you are” type of article, though it may look like one, because that is something you have to figure out all by yourself.

If you take a look at the list of programming languages, any business person would have an instant headache. There are lots of them. With the strangest names. You cannot possibly guess which one to pick from such a list, obviously. So, how do companies choose the languages they use? There are some straightforward methods that I have seen so far, in no particular order:

  • Looking at what other companies use (typically Google, Microsoft, Apple or Sun, but it could be 37signals too).
  • Following the advice of the CIO, the Lead Architect or some other politically-powered person, which might or might not have read this article ;)
  • Looking at what the current pool of programmers in the company know how to use. Rinse, wash, repeat.
  • Following hype.
  • Because there is a market plenty of available, cheap programmers that I could use for this project.
  • Taking into account the characteristics of the languages themselves (static vs. dynamic, etc).
  • Following the company’s history of past projects (successful or not).
  • Following what your the client suggests (or mandates).

I think that it is a very bad idea to take any of the above methods in isolation, without considering other factors. Doing so is a path to self-destruction in the medium to long term, even if you succeed in the short term.

Continue reading

Steve Yegge on Apple APIs

A comment at the bottom of his own lengthy but otherwise interesting article:

One more important point: I’m surprised that some people seem to think I’m implying some programming studliness from my little 3-day excursion. Not so: any first-year college student or intern, or heck, self-taught dude in his basement, could have done exactly what I did. I failed utterly to convey the right point here, by unfortunately being way too subtle about it. The recounting of total hours spent was a hats-off compliment to Apple for having written such great APIs, documentation, and tools. Let me be clearer about it, then: Apple’s development environment is nothing short of amazing, which I fully expected, knowing it derived originally from NeXTStep and has had fifteen or twenty years of innovations piled on. The APIs are _clean_. This is why I was able to narrow down the APIs I needed so quickly. The whole thing I got working was no more than 50 lines of code, most of it error-handling. That’s C code, so it’s impressive how much it accomplishes in so little space. The takeaway here is that more programmers ought to jump in and start playing with OS X. You get results faster than you’d think.

Templates

Did you knew this is possible in C++? I didn’t.

[source:c] void Fun() { class Local { //… member variables … //… member functions … };

// ... code using Local ...

} [/source]

This feature is called “local classes” and is part of the standard; the limitations are that these local classes cannot have static member variables and cannot access nonstatic local variables. But, as Alexandrescu points out (page 28), you can use them in template functions:

[source:c] class Interface { public: virtual void Fun() = 0; // … };

template Interface* makeAdapter(const T& obj, const P& arg) { class Local : public Interface { public: Local(const T& obj, const P& arg) : obj_(obj), arg_(arg) {}

    virtual void Fun()
    {
        obj_.Call(arg_);
    }
private:
    T obj_;
    P arg_;
};
return new Local(obj, arg);

} [/source]

Not only that, but partial template specialization and template-based compile-time verifications just blew me away. The second chapter of the book was realizing I just haven’t had the slightest clue about all the cool things you could do with C++!

symbol

(original en castellano)

the word “symbol” is the result of the union of “syn” (I think this is how you write it) which means something like “together” (syn-chronic, which means at the same time, I suppose syn-thesis, etc) and “bol” which, as far as I understand, is related to the action of throwing (I do not remember the greek word, but it’s the word which “bullet” derives from). my point is that symbol contains the idea of throwing two things together, that is, the relationship between two things being thrown to the same place. I think it’s much more interesting the idea of throwing something in a semantic area than the idea of establishing exactly a single reference. it speaks, in any case, about the reference of a semantic matter, extensible to everything that could be thrown in the same direction. there’s no more of a signification and an institutionalized significant, both so rigid as objects from a mathematical formula, but places and entities related together. and the symbolic signification is not only what has been thrown, but also everything that has been thrown with it. form is an existential modus, it’s a manifested modus. form is symbol. and aesthetic as logos of the form, cares about being thrown as existential fundament, like what we could call, maybe in another context, content.

hernún.