Tuesday, 30 November 2010

Universities: Passing the Torch of Culture

«In this post I expose some thoughts about italian universities and italian politics. I hope to be not offensive, it's not my intention. I hope to stimulate a constructive dialog, giving my personal ideas and experiences as "experimental datas"»
Who wants to sit on my chair tomorrow?

In these days italian students are protesting against a new law for university. Googling a bit you can find some commentaries to the law (they're more understandable than law's text), wich can help you to get the more important features:

  1. universities could become foundations
  2. professors will give resignation when they'll become 70
  3. new professors will be recruit by a commission of 4 randomly choosen professors
  4. small universities will be encouraged to fuse themselfs

It doesn't sounds bad. But there are several "cut offs" in universities budgets, explicable only with a decision to reduce public financing. The "fight against barons" (this is a nickname used for more influents professors whom manage recruitings, balance, ecc.) will not be resolved in this way.
I appreciate these contestations, because they prove youths' interest about public life and public instruction. But these protests should be oriented to two more important points, instead to defend just the "status quo".

  1. Professors can be disheartened by University's Senate and could be fired
  2. New professors can be admited to a recruiting contest only if they are international figures (such as Andrew Tanenbaum, Dario Fo, Carlo Rubbia, ecc.) or they have a successfull 10-year curriculum in a company

Bruce Sterling wrote on its «The hacker crackdown» what he thinks what is universities' mission. Have you ever tried to think about it? What's the universities' mission? Sterling says it's «passing the torch of culture». It's true, but not complete. Universities must

  1. Prepare future managers
  2. Prepare future high technical staff
  3. Passing the torch of culture to future generations

In our universities, computer-science program isn't very updated: a new bachelor in CS, usally knows just Java and C/C++/PHP; knows just a bit about UNIX, doesn't know exactly what's a TCP/IP port; has difficulties to understand the differences between a process and a thread; he doesn't know how works ANT, Make and other usefull tools; he doesn't know anything about real-time systems and programming; he doesn't know anything about NO-SQL databases, sometimes neither they exist

This is unacceptable, because it's like an eletronic engeneer whom ignore microprocessors. This new bachelors have also difficulties to learn new languages and techniques.
There's many things to change in italian universities.
I hope this protest will not stop when money will return.

Friday, 26 November 2010

Sony snaps GNUStep and Objective-C

Again, I want to excuse me if I didn't write some news yesterday. Unluckly, there were some hard tasks to complete at work.

Are you serious?!
 A great news from Sony: its new project SNAP is launched and it will be based on the GNUStep framework. GNUStep is the free reimplementation of NeXTStep/OpenStep, a set of classes written in Objective-C back in the '90 by NeXT (Jobs's company which was later absorbed by Apple).
Why I'm so excited? Because Objective-C is a great language (I like it much than C/C++); OpenStep is a great framework (take a look to NSString; to NSArray and NSMutableArray. You'll like them); and because OpenStep is Cocoa's father... and Cocoa is Mac OS X's and iOS' base.

On SNAP's Manifesto I read that is focused to «modernize the framework and optimize it to target modern consumer electronic (CE) devices». But Sony says also

«These modern conveniences include such features as touch displays and 3D graphics»

This could means Sony will allow Objective-C/GNUStep also on their consoles, making easy to port a game from iPhone/iPad/Mac to PS3/PSP. Because, remember, bot PS3 and iOS use OpenGL EM as graphic library. It's a interesting prospective.
What will be the benefits of using Objective-C + GNUStep instead of C++?

  1. GNUStep is a wider standard library than C++
  2. Objective-C supports reflection
  3. Objective-C has a more elegant syntax
  4. Objective-C 2.0 has a garbage collector... if you want and where you want ;)

Obviously, there's also drawbacks:

  1. Objective-C is slower than C++ (just a bit, but it's slower)
  2. Many libraries are written in C++
  3. C++ has a better known syntax

Anyway it's another important step: Objective-C has a completely different way to think OOP (message passing, reflection) which is different (and more advanced) than C++. GNUStep is a big framework. I will be surprised if the Big Next Step (bad word joke ;)) in programming will be made by the "old" Objective-C instead than Java, C# or something else.

Wednesday, 24 November 2010

Meanwhile, in Microsoft Russia...

In USSR, Windows installs you

Nikolai Pryanishnikov, Microsoft Locale Director in Russia, says that

«We must bear in mind that Linux is not a Russian OS and, moreover, is at the end of its life cycle»

I am a bit disappointed by this statement: I always belived that Microsoft managers were smart enough to avoid some hazardous declarations. Says that «Linux is dieing» is a manifestation of ignorance.
Actually, GNU/Linux is a player to face in important environments such as

  • Embeded devices
  • Servers
  • Mobile phones with Android

I suppose mr. Pryanishnikov was talking about the desktop market, but he must understand that HIS statement is offensive for HIS company.
As president of Microsoft in Russia, Nikolai Pryanishnikov hasn't capacity to say everything he wants: he have to think well what he can he says and what he can't. A misunderstanding in business world can move billions of dollars. A good CEO will take the situation in his hands, to correct this clumsy sentence.
Mr. Pryanishnikov misses to report citations and, more important, to say something about the Google OS. It's right that it's not yet released and that its base (Google Chrome) is just at 8% of broswer market shares (source: Wikipedia). But wait: Android is at 25%, while Windows Phone is at 3% (source: Wikipedia) and mobile market is becoming more important than ever. If Mr. Pryanishnikov was a smart president, then he would know that HIS Chief Software Architect (Ray Ozzie) sent a memo less than a month ago where he talked about the new marked trends (mobile, cloud computing, ecc.). Ignore what says your Chief Software Architect is clearly self-defeating.
If GNU/Linux's zealots are annoying, then Microsoft's supporters aren't better. But a fanboy's rant is forgettable; a manager's rant in public is not.
Mr. Pryanishnikov must think very well where, when and what he says, giving some attention to the same market shares I found googling some minutes. If I can do, then he can too.

Tuesday, 23 November 2010

Chainsaw with Jigsaw

«Groovy!»
The Jigsaw Project is "java kernel"'s offspring: the idea of cutting off pieces from the JVM and from classpath to obtain a small "java kernel" able to download and install by itself all necessary packages and libraries.
We'll get Java with a 1M installer, no more. It will runs some small programs, such as a telnet client and clones of ls, cat, more, ecc. utilities. When you will create a Java application, the new JVM will automatically download all missing libraries.
I don't believe Jigsaw will resurrect the Java desktop, but there's some scenarios we must reflect about. In these days Apple is trying to integrate its desktop with its mobile solution. The Mac App Store and the iPhone App Store are similar ideas; the Mac Book's trackpad is the same multitouch device of iPhone's display; Mobile Me's services work as a glue between your different Apple devices. In this "extremely dynamic scenario", informations (e-mails, photos, music, calendars, ecc.) are always in your hand. Why no expand this scenario to applications? Why no expand this scenario to your copy and scores of Angry Birds, or your copy and save games of Rage, they'll runs everywhere, downloading just the necessary informations from the network? It's true you can't have a Crysis written in Java, but a «Monkey Island Series» yes. This concept of «Buy Once, Run Everywhere» could potentially kill a set of market stores (where's the difference between a PS3 and a XBOX 360 and a WII if a donwloaded game runs everywhere?) and makes me doubtful about this prospective. But there's some players that could be interested on platform indipendence.
I introduce you an example: I buyed "Diablo 2" some years ago for PC. Blizzard gives me the opportunity to dowload a version for Mac OS X spending no money. They did a good work and I appreciate its honesty. Porting a game is an hard work, but in Java is trivial. Game's world is moving from power-players to casual-gamers and casual games don't need high performances or fancy graphics.
Java Jigsaw Platform could be a big opportunity some years ago. Now, with this commercial pressure oriented to kill every kind of portability, I am non very confident that Java will emerge from desktop sea.

Monday, 22 November 2010

An interesting limit: for Mark->Steve, Ubuntu->Mac OS X

In an article reported on a italian website, I read an interesting comparison: can Mark Shuttleworth be the Steve Jobs Of Ubuntu?
It sounds like a provocation, but actually every Great Project (GNU, Linux kernel, Debian, Ubuntu, Slackware, KDE and even Apple and Microsoft) has a leader whom manages and guides all project's members. Debian had Ian Murdok; Slackware has Patrick Volderking; GNU has Richard Stallman; Linux has Linus Torvalds; OpenBSD has Theo de Raadt.
Steve Jobs is one of most famous CEO in the world: his keynotes are shows. He saved Apple from a deep hole (in 1997 it could be sold to Sun Microsystem) and transformed it to one of most powerfull companies in the world. Some "never-seen-before features" was already present in GNU/Linux (spaces - virtual desktops, e.g.) but with Job's personal touch, they become "new" and "amazing".
In FOSS (Free-Open Source Software) environments, Jobs sits on the Throne of Evil  once reserved to Bill Gates. With no doubts Apple's devices are much closed than other (iPhone is a small fortress); no doubts that an HTC with Android is more free and more open than an iPhone. But you can't classify Jobs just as "a tyrant", "a criminal" or "a shark".
Ubuntu is trying to earn space in the desktop market. It's a very competitive place, where command line is evil. I think Mark Shuttleworth MUST BE the "Steve Jobs of Ubuntu", a landmark for desktop developers and for desktop users. He's taking seriously this role since one year, with some revolutions on Ubuntu, such as window buttons on the left corner, Wayland to replace X.org and Unity instead Gnome Shell. This ideas have been criticized by Ubuntu comunity but their motivations sounds like a "zealot reaction", not as technical observations.
Mark Shuttleworth is becoming more influent. If his vision is right and clear as I hope, maybe Ubuntu could become more widespread. As every man, Steve Jobs has good things and bad things. But as a CEO, we must admit he's one of the best.
FOSS zealots must to understand that making Ubuntu more functionally, more actractive and less "integralist", will help the GNU/Linux desktop adoption. And if «Mark Shuttleworth will approach to Steve Jobs», could be a way to realize this dream (lim Ubuntu=Mac OS X).

Friday, 19 November 2010

The power of a "Singleton"

«Please, excuse me if I didn't update my blog in these days. I was so busy in some activities, both at work and for my movie. Yesterday, with Fabio, I looked for a good place to realize some scenes. We were lucky!»
A singleton doesn't need 1.5 GW
In this post I'll talk about singletons, last design-pattern I found. If they're necessary in Cocoa, they're also usefull in other programming contexts. What's a singleton, exactly? On wikipedia it's defined as «the instantiation of a class to one object» and well, it's right.By a programming point of view it looks like (in Java):

class MySingleton{
    private static MySingleton shared_singleton=null;
    private int counter;

    
/** * Private constructor */
private MySingleton(){ counter=0; }
/* * Increment counter */
private void Increment(){ counter++; }
/* * get the singleton */
private static MySingleton getSharedSingleton(){ if (shared_singleton==null) shared_singleton=new MySingleton(); return shared_singleton; } }

You see, when you're using a singleton, you have just one instance of this object (here it's called shared_singleton). You can get a reference to this object with the getSharedSingleton static method.
In Cocoa touch, singletons are the most confortable way to have a shared resource; global variables, (very used in C) aren't good as a singleton. In Java you can insert them easily in a multithreaded context, just adding the synchronized keyword. Singletons are very good to share read-only data and they can be used in every object-oriented programming language.

Singletons could be dangerous, because (if they're not well designed) they could know too much about other objects, can grow in functions if they're not well designed a can give throubles in a multi-threaded environment. A detailed description about dangers of singletons abuse is Use your singletons wisely by J. B. Rainsberger, employed at IBM. It's an interesting lecture if you are a programmer. Another good lecture is Singleton Pattern description, where there's also some example of "Singleton Abuse".

Tuesday, 16 November 2010

The Last of the Patriots

The Game
Paul Davis is a game designer and a programmer. He worked on "Manhunt" and "Grand Theft Auto" as level designer. Two years ago, following a link, I found his site, «Lastofthepatriots.com» (unlucky, now it's a dead-link), where mr. Davis hosted the omonimous project. In «Last of the Patriots» (I and II), he created a game engine from scratch, using OpenGL and Audiere as base. His main objective was to write a game focused on story, moral decision and player involvment. The result was «Last of the Patriots», which can be defined as a "Visual novel with a Zelda-Like visualization": you will not shot so much and there's no special-FX or 3D graphics. Last of the Patriots has a story, based on a movie script. You will be surprised about how your feelings will change playing with this game. "Last of the Patriots" is an interesting game experience and I suggest you to give it a try.

The Technical Notes
After a while, I sent an e-mail to Paul Davis, asking him some technical informations. I was really interested about indipendent video-game development and I recived his reply with enthousiasm. I was not disappointed: mr. Davis was exaustive and well prepared.
First: he used OpenGL for graphics and Audiere for the audio parts. A port to other operating systems, anyway, shouldn't be easy, because the input is managed by the win32 API (OpenGL hasn't a great input manager). All the graphics was realized using a 3D program to modelize and animate. Every frame is a shot done to this animated models.
Game logic is realized with an embeded scripting engine written by Davis. I can't say so much about that, because I didn't find any script.
The whole game engine it's coded using C (no C or Objective-C) for personal choice (he prefear to use C). He admits, anyway, for a similiar game, Java could work well.

Conclusion
I encurage to play with with «Last of the Patriots» and its sequel, because some misteries (first of all, the title) are explained. I don't know if the official website will go online again, but you can still download the binary from this link.
Last of the patriots is a very particular game. Give it a try: it could open to you new interesting prospectives. Mr. Davis said he write it to focusing on story instead on graphics.
He did it.

Friday, 12 November 2010

Welcome back, Firefox!

Yeah, we missed you, Firefox ;) Welcome back!
I was a great Firefox supporter. I work also in a public administration and I suggest always to install it: Zimbra works well under Firefox (we still use Windows 2000), but in last year I become less enthusiast. When Chrome and Safari entered the browser market, Firefox appeared disoriented. It introduced some new features (Persona, Jetpack), but nothing really interesting for the end-user; I never used extensions (never found one really usefull, maybe I'll search better) and Chrome and Safari beated Firefox in brute speed. But now I'm using Firefox 4 (Beta 7) and I find it really fast.
What's new on Firefox 4?
First: a the javascript engine uses a JIT compiler (J├ĄgerMonkey), just like Chrome.
Second: graphics it's rendered using DirectX (on Windows) of OpenGL (on Mac OS X and GNU/Linux)
This second feature means also Firefox can use the new WebGL standard.
Groovy!
I suggest you to give it a try if you passed to Safari/Chrome and you feel the lack of some extensions. You will have a surprise.
And a final joke: What  did Firefox so far? The playmate? Errr...!

Thursday, 11 November 2010

iPhone SDK Troubles - Web Services

«I'm sorry Dave. I'm afraid you have to write it by yourself»

Write a web service should be easier than implement a new protocol. The iPhone SDK is an endless source of surprises to me. I discovered there's no methods to encode a NSString in base64; no library to write easier data and HTTP headers; and just a small C-function to get a MD5 hash. Ok, it's enough to get an hash, but it's not well embedded on Cocoa-Touch.
Ok, I can still write them by my own. But I really can't understand how is possible a network-oriented platform as a smartphone doesn't have this basic functions. Do you think they're not "basic"? Well, Python and PHP have them as built-in modules. And on Android? I found the answer here.
Anyway, a web service on iPhone is just a NSMutableURLConnection, with HTTP headers setted with [theRequest addValue:@"text/xml" forHTTPHeaderField:@"content-type"], passed to a NSURLConnection.
But I will pass the night writting the other necessary functions.

Wednesday, 10 November 2010

Buy now your new iBrick!

Think heavy

A news from Ars Technica


I am (for work) a iPhone 3GS user. I like my phone, it works well and it has a large application store. ACTUALY I haven't troubles with my iPhone. But last Apple politics doesn't calm me down. When I bought my Macbook Pro I was convinced I could buy another PC after five or six years, maybe even more. I'm still convinced this is true, because Apple's tight integration between hardware and software is good. But his "tight integration" is becoming a hell on iOS devices.
Building a software good for a Mac G4 and a Mac-Intel isn't easy. Anyway, if I should have Mac G4, I will probably accept it's slower to launch a program than a new Mac-Intel. But a smartphone isn't a computer and it has a completly different "way of mind": when I compose a number, if I have to wait three seconds, I think something is going wrong; if I see a delay when scrolling my contacts list, then I think there's too many processes in background.

Apple forbids iOS downgrade to prevent users to pass to a jailbreakable version. I can understand this. But I can't understand how Apple can pretend that a user gently accepts to choose between a unusable "brick" or 500$ to buy a new iPhone 4. I can understand that supporting patches for three or four iOS versions (e.g. 2.x.x, 3.1.x and 4.1.x) to grant a unbreakable OS for different hardware isn't easy neither cheap. But these solutions aren't well accepted.
After the drop of XServe line, I expect more attention on its consumer products.

Tuesday, 9 November 2010

This is my Way (land)

This is "MY" way: AC/DC, no Sinatra!
 In these days, the FOSS world seems shaked by a earthquake called "Ubuntu". Mark Shuttleworth, founder of the most widespread GNU/Linux distribution, in a post on his blog, talks about the possibility to replace X.org and the whole X-Server architecture with the modern and clean Wayland display. Mr. Shuttleworth admits X.org is a living project, more active now than ever and he admits and it's die hard. But, also, he said

«[..] we don’t believe X is setup to deliver the user experience we want, with super-smooth graphics and effects.
[..] We’re choosing to prioritize the quality of experience over those original values, like network transparency.»

Yeah mr. Shuttleworth! This is the first time I heard statements like this since the Waldo Bastian's analysis about KDE[1]. Statements about the importance of user experience over technical decisions

Now, let's see differences between X.org and Wayland

X architecture (curtesy of Wayland's site)


As you can see in this graph, rendering a frame is a very long path of APIs. And this is because (from Wayland's site):

«In general, the X server is now just a middle man that introduces an extra step between applications and the compositor and an extra step between the compositor and the hardware.»

Now, let's look Wayland's architecture:

Wayland's architecture (curtesy of Wayland's site)


In this graph, you see that Wayland embeds the compositor. This reduces passages to render a frame and then, accelerate displaying speed. But, most important, Wayland embeds the detection of window whom recive an I/O message (such as a click). This task, in X, is done by the compositor: in Wayland is part of the display manager.

Wayland, also, it's smaller than X.org and less resources-hungry. These features makes it perfect also for small computers, such as netbooks and tablets. Furthermore, X can works as a Wayland client and this can help the passage to the new display manager.
It's true Wayland doesn't work on old hardware. But this means we'll never use it on a Pentinum I 233. About this, mr. Shuttleworth said

«The requirement of EGL is new but consistent with industry standards from Khronos»

And he's right. Now the bad news: NVidia (AaronP's words) say

«We have no plans to support Wayland.»

Does this means the end of Wayland project? Who knows? Actually NVidia just said ACTUALLY they have no plans, so in future this decision could change. Anyway, a passage to Wayland is a big step for FOSS world, at least as the begining of KDE project.

[1] I read this analysis on a italian magazine (Linux &C.), when KDE 3.0 was released. I can't find Waldo Bastian's post anymore, because all forums are now dead-links. Can you help me to find it?

Monday, 8 November 2010

Adieu XServe

I'm sorry too, XServe
Another move from Apple. XServe, the Apple-based server rack, will no more shipped from january 31 2011. It's a big delusion. I always dreamed to work on a XServe with Mac OS X Server. I was so curious to test its power, the usual tight integration between hardware and software and its user interface.
Will Apple exit from the servers makert? I don't know: is still possibile "convert" a Mac Pro or a Mac Mini into a server installing Mac OS X Server and this document shows how to do. Probably, they're just cutting unnecessary hardware. But, as you can read, to have the same power of a XServe you need from 3 to 30 MacMini; obviously, a MacPro is a bit bigger than a XServe.
In few words, Apple admits its big-iron line is no profitable. Apple is great for the client, but sysadmins with really big requests, still prefer to work with IBM or SUN servers with GNU/Linux or Solaris. Well, «this is business» (citing Lance Vance).
But, let's reflect: a Mac Mini costs 600€ and it's ready to work out-of-box if you install Mac OS X Server. Ok, it's not powerful as a SPARC T3-1 Server or a "home-build" server with GNU or *BSD, but for a small company whom needs a mail server, file server and a SVN it's enough. With the same price you can purchase another Mac Mini as "backup unit". If there's a system fail, with Time Machine it's easy to restore all services in an hour. Ok, it's not enough for a medium or big company. But there are more small companies and some of them already use Apple solutions. Apple isn't interested to face IBM or Oracle on the big-servers battlefield. But these small companies, with 8-20 employees, can't buy (and aren't interested) on big-irons: a Mac Mini or a Mac Pro are more affordable than a Blade Server and easier to configure and to mantain than a GNU/Linux or *BSD.
So, is this the end for Apple's servers? Who knows? Market is a strange beast. Maybe we'll see clusters of Mac Mini; maybe Mac OS X will allow to "assemble" some Mac Minis into a single system; maybe the Mac Pro will become an "ibrid" (iBrid?) between a big client and a medium-sized server. Let's see. I hope we'll enjoy the show.

Friday, 5 November 2010

Stop smoking

Wanna try to stop?

I'm thinking about my Facebook page. What I found there? Some interesting news (in Italy a politician, Nicky Vendola, updates his status at least two times at day). Some news posted by me (mainly blog uploads and shared links). And a lot of (useless) status uploads and a lot of not very interesting news (some are near to spam). I start thinking to unsubscribe from the "Blue Social Network", because all interesting news can be found with a good RSS reader, but soon I realize I can't.
Facebook isn't a "funny site" anymore: it's the "main street" of internet comunication. Your Facebook page is your business card to the world, more than your blog or your web site. It's the best place to put your advertising, 'cause it will be sent to all your Facebook contacts.
You ARE your Facebook page; you ARE the news you post and the links you share. All these informations draw your profile to the other Facebook users.
When someone is looking for you, he will go to Facebook. I can survive without Facebook, using just iChat connected to Facebook's jabber server; but all other social activities (publicize a movie, a post on my blog or just share a newspaper article) can be done only with Facebook.
Facebook is a powerful tool, but for some days I felt sad on last sessions. Why?
My answer (just my 5 cents) is simple. I feel like when I tried to stop smoking: I felt strange some days because I didn't know what to do. Smoking was like a "filler", a way to don't get bored while I didn't any activity.
When you're on a boring office, with no chance to talk about interesting things with your colleagues, what can you do? Connect to the blue site.
Well, I decide to stop "facebooking" with no reason. I stop using it with a precise idea about what to do in it: no "busy wait" for a chat, not looking all 200 demotivational posters 'cause I don't know what to do. I'll start to use it conscientiously, as the last BBSs' offspring.

PostScriptum
Take a look to this old soviet device. It was created three years before Photoshop 1.0. Interesting :)

Thursday, 4 November 2010

Unity and so be it


Is this a flame? Maybe. But I support Canonical's decision to use Unity instead Gnome Shell. Why? Because this "fork" is fundamental, not just for usability reasons, but mainly because it's a strong stance from the most widespread GNU/Linux distribution. Adopting Unity, Canonical did some decisions, oriented both to usability and development. Choosing Unity, Canonical show us its direction: the underlying technology is useless if user experience is poor. KDE 4 is on this way: great technology (C++, QT, Plasma, Phonon, ecc.) but the resulting desktop is not "sexy" as Gnome on Ubuntu.
Technology can't be the objective. Christopher Tozzi said


I put emphasis on some statements, expecially about "to borrow ideas": this is the base of Free Software, which is not (as many thinks) a "Hippy-Programmers Way of Life". Free Software is much more near to "Ideal Market" and "Concurrency" than other realities (such as Apple and Microsoft). Same ideas are implemented by different teams in different ways (e.g. EMACS vs VIM; Eclipse vs Netbeans; Gnome vs KDE; Firefox vs Konqueror and so on). This environment allows to many competitors to survive. But Canonical must monetize its work. And to do this it needs to follows user's desires. If Gnome shell isn't actractive enough, then welcome Unity.

Wednesday, 3 November 2010

Why EMACS is still important

«Hey you! Is that a VIM session?!»

Talking about EMACS in 2010 may seems stupid. But GNU's official text editor still maintains its charm, despite nearly three decades. Born from Richard M. Stallman's keyboard, EMACS is the editor of choice of different programmers scattered around the world, thanks to its main feature (it's programmable). I decided to try EMACS after a fight of years.
If you use EMACS enable immediatly the cua-mode The cua-mode sets the "copy-and-paste" and other controls with the keyboard shortcuts control-v, control-x, z-control, control-c, making more "human" the user interface and avoiding you to spend two hours on manual to understand what is a "region", the "yanc" command and the "kill" command. Using this "trick", I finally started using EMACS for real and not just for fun.

EMACS vs XCode vs Netbeans vs Eclipse vs...
EMACS can compete against an IDE?" No. It can't, at least not right now. It 's true EMACS is a text editor with a LISP engine then theoretically you can turn it into a IDE, but I've never seen anything like it. And I'm not interested to see it. The "universal solution" (or "silver bullet") does not exist. If I'm working a small project in C / C, a bash script or a python script, then I'll probably use EMACS; but to develop an iPhone App, a java servlet or a 3D engine I'll use a IDE to do object's methods analysis, to compile the project with ANT, to upload it to SVN, etc..

Why should I use EMACS?
Just for fun. To learn LISP. But the main reason is because EMACS is on any operating system. Well, if you're writing a shell script on a SSH session, then VIM is enough. But when you need to write some Python scripts, with C code, then EMACS is the choice. It's everywhere, has a huge library of macros, will work on Mac OS X, Windows and GNU / Linux and ALL EMACS macros (including "search and replace in selection "," Indent Code","open a shell","Open SSH session to server","Send a email to", ecc.) work on ALL systems which run EMACS . If you are a programmer, probably you will find difficult to use the C mode. Well, you have to configure the c-major-mode to work as you want. At the end of this post, I'll show my personal .emacs file.

EMACS isn't good as VIM
If you talk just about personal preferences, I don't say anything: everyone has his preferences. I was a VIM user, but I finally passed to EMACS after some days of XCode. Why? XCode indents wrong my Objective-C code if I forget some parenthesis (using Objective-C it happens very often). I felt the lack of this advanced feature and I realized that Emacs can do the same, changed my feelings on it.
There's some things I would like to see in next EMACS release: first, set the default use of cua-mode, because in 2010 just two or three nerds are comfortable with "kill and yank". Second, set UTF-8 as default encoding. Third, a modern configuration interface (the "Customization Macro" was useful in the '80, but now is a bit obscure).

My .emacs file
Somebody has a very large .emacs file, filled with his own macros. I just want to use the c-style called BSD, with tab character as indentation method and four spaces as tab width.

;C programming style
(setq c-default-style "bsd"
         c-basic-offset 4)
;for c-mode, use tabs instead of spaces.
;Set tab width as 4 spaces
(setq-default c-basic-offset 4
                  tab-width 4
                  indent-tabs-mode t)

Last advice
Take a look at the Emacs Wiki: I found it very useful.
Happy hacking :)

Tuesday, 2 November 2010

Oracle's short vision

Mr. Magoo, you are more fun

News of the day (october 29 2010). From Computer World I read «Oracle: Google 'directly copied' our Java code». In this article is exposed how and where Google did copy Java's code. From the article we read

«The infringed elements of Oracle America’s copyrighted work include Java method and class names, definitions, organization, and parameters; the structure, organization and content of Java class libraries; and the content and organization of Java’s documentation»

I organize this declaration in the following list
  1. Java's methods names;
  2. Java's class names, definitions, organization;
  3. Java methods' parameters;
  4. the structure, organization and content of Java class libraries;
  5. Content and organization of Java’s documentation;
Pay attention, this statements aren't so unfamiliar. Do you know where I (and probably you) did hear them before? When SCO accused Linux of copyright infringement. SCO was more prepared, saying mr. Torvalds copied directly UNIX code into his kernel (Linux). In the final chapter of this ridiculous theatre, SCO showed this famous pieces of code: few macro definitions of the errno.h header file. These macros look similar to this:

#define PI 3.14159265

The SCO-Linux controversies was more complex and still continue. Anyway, SCO showed some code and, on a computer-science lawsuit, gave some material to think about.
Let's return to Oracle's assertions. How much are they real? As a programmer with some knowledge in law and licensing, they seem ridicolous.

  1. You can't set a copyright for a "Function Name". Neither for a class name or a declaration. They're not "trademarks". The only trademark could be the "java" prefix in some cases (such as java.*), but I have doubts, because there are placed to grant the Java Standard Definition;
  2. Look point 1;
  3. Look point 1;
  4. As I say on point 1, I can understand Oracle dislikes the word "java" in a whole classpath, but this is placed to follow the Java Standard Definitions;
  5. This is more difficult: as you can read here, Oracle's documentation distribution isn't released under the GNU Free Documentation License.
If you think well, there's something else to say: Android is based on 3 things: a Virtual Machine (Dalvik), a language (Java) and a classpath (Harmony). Google never said Android runs Java and they're right, because Dalvik is very different to Hotspot; Harmony is a java classpath reimplementation released under the Apache License.
By the way, "Java" was released under GPL by Sun Microsystems just before it was purchased by Oracle and just some pieces are still under a non-free license. So, Oracle's charges to Google seems inconsistent to me. If the problem is documentation, then Google can pay a team to rewrite it.

I think the main reason to start this lawsuit campaign is the lesser importance of the Java Micro Edition platform. How Oracle (a server provider) could be afraid on losing the mobile market? The answer is Oracle feels threatened by the decreasing importance of selling licenses to use the Java Micro Edition. Sun Microsystems earned selling to smartphone producers (Nokia, Erikson, Motorola, ecc.) the autorization to include a JME on their products. I think this was the only profittable Java client platform. Now that JME is going out  of market (killed by iOS and Android), maybe Oracle is playing dirt to give new life to this project.