Showing posts with label Rant. Show all posts
Showing posts with label Rant. Show all posts

Wednesday, September 5, 2012

Models of human skills: gaussian, bimodal or power-law?

The first thing I have to say is that this post actually contains my own reflections. I have not found clear scientific facts that actually prove these ideas wrong or right. On the other hand, if you have evidence (in both directions) I'd be glad to have it.

On of my first contacts with probability distributions was probably around 7-8th grade. My maths teacher was trying to explain to us the concept of gaussian distribution, and as an example, he took the grade distribution. He claimed that most of the students get average results and that comparatively fewer students got better or worse grades (and the more "extreme" grades were reserved for a few).

I heard similar claims from many teachers of different subjects and I have not been surprised. It looks reasonable that most people are "average" with fewer exceptionally good or exceptionally bad exemplars. The same applies to lots of different features (height, for example).


201209051915.jpg

Lots of years later, I read a very interesting paper claiming that, instead the distribution of programming results usually has two humps. For me, the paper was sort of an epiphany. In fact, my own experience goes in that direction (but here, I may be biased because I have not collected data). The paper itself comes with quite lot of data and examples, though.

So apparently there are two models to explain the distribution of human skills: the bell and the camel. My intuition is that for very simple abilities, the distribution is expected to be a gaussian. Few people have motivation to become exceptionally good, but the thing is simple enough that few remain exceptionally bad either. On the other hand, sometimes there is simply some kind of learning barrier. It's like a big step that not everybody is able to make. This is common for non-entirely trivial matters.

In this case, the camel is easily explained. There are people who climbed the step and people who did not. Both groups are internally gaussian distributed. Another example could be an introductory calculus exam. If the concepts of limit and continuity are not clear, everything is just black magic. However, some person may still get decent marks because of luck or a lower level form of intuition. Among those that have the fundamental concepts clear there is the usual gaussian distribution.

However, both models essentially assume that the maximum amount of skill is fixed. In fact, they are used to fit grades, that have, by definition, a maximum and a minimum value. Not every human skill has such property. Not every human skill is "graded" or examined in a school like environment. And even for those that actually are, usually grades are coarse grained. There is probably a big difference between a programming genius (like some FOSS super stars) and a regular excellent student. Or between, say, Feynman and an excellent student taking full marks. The same thing may be even more visible for things usually perceived as artistic. Of course, it is hard to devise a metric that can actually rank such skills.

My idea is that for very hard skills, the distribution is more like a power law (at least in the tail). Very few people are good, most people are not even comparable to those and the probability to find someone twice as good as a very good candidate is just a fraction.

Just to conclude, I believe that for very simple skills most of the time we have a gaussian. If we have "learning steps" or some distinctive non-continuous feature that is related, then we have multi-modal distributions (like the camel for programming: those that are able to build mental models of the programs are successful, those that only use trial and error until the programs "compile" are unsuccessful). Eventually, for skills related to exceptionally hard (and challenging and gratifying) tasks we have power-law distributions. May we even use such distributions to classify the skills and the tasks? And in those cases, a gaussian distribution is a good thing or not?

So that, given someone that is able to make mental models of programs, maybe Haskell programming remains multi-modal, because there are some conceptual steps that go beyond basic programming, while Basic is truly gaussian? Is OOP gaussian? And FP?

And in OOP languages, what about static typing? Maybe dynamic typing is a camel (no, not because of Perl) because those that write tests and usually know what they are doing fall in the higher hump, while those that just mess around fall in the lower hump. Ideas?

Monday, July 9, 2012

On language level

When historians started to name periods of time, they roughly divided human history in three main periods: Ancient History, Middle Ages and Modern History. Although there is not general consensus on the actual subdivision (I remember something about Burdach and Burckhardt), that is the general idea.

Modern history essentially starts with the 15th century (again, this is debated) and goes on. Then there is the idea of contemporary history, which is a moving target and regards the last 80 years. I somewhat believe that perhaps we need a better name to refer to what happened in the 20th century that is going to last after it is not contemporary anymore. Still, it is not my job.

Something similar occurred with Art History, where Modern Art goes from 1860 to 1970. Then we have Contemporary or PostModern. So in a few years, a new name will be needed... like Post^2Modern. Don't care.

And we basically have the same trouble. In 1960 Fortran was a high level language. So every non machine level language is a high level language. And we call some languages very high level.
In a few years will we have "overwhelmingly high level languages"?

Friday, May 11, 2012

Software developers are not carpenters: on "Why do web sites andsoftware take so long to build? And why is it so hard?"

This evening it happened to me to read this quite interesting article about why software is so hard to write. In the article, if you don't care or do not want to read it, the blogger reports the decision of a friend of his quitting his (probably highly paid) job as software developer because he got tired of it. The motivation he (the one who quit) suggested are that software is complex to build and is the only large-scale human artifact that is mostly built by hand. Hand-made stuff, he argues, is more fragile and error prone that machine-made stuff. He also points out that good software developers do not agree on the right way to do things, etc. Eventually, he arguments that in civil engineering architects (or engineers) design stuff, politicians and administrators regulate it and carpenters build it. That thing is not possible with software.

So I have to say that: I'M FUCKING TIRED OF PEOPLE COMPARING BUILDING SOFTWARE TO BUILDING HOUSES. It is not the same thing. Moreover, I believe that comparisons with other forms of engineering has been detrimental for software development and lots of wrong practices and costly mistakes came from this illusion. I also think that people who really believe that building software is like building houses should be building other stuff. Neither software or houses (not houses I'm going to live in). Am I saying Rational F*cking Unified Process?

Humans have been building houses and bridges for millennia (yeah) and software since 50 years. It is quite natural that techniques have been developed. Software engineering is young. Really. So please, have patience. We will surely agree on the principle. That will happen earlier if people realize that no matter the process, unskilled developers are not going to build a working and maintainable piece of software.

Regarding the objection of software development being too manual, last time I checked, gcc and javac are exactly machine building software, not a bunch of underpaid third world workers. So, we do have machines building software. Compilers, build systems... testing infrastructures. We have lots of machines that help to build software, much in the same way that we use machines to build other things. We do not use machines to design most non trivial stuff.

And we continuously create new kind of machines doing stuff for us. Moreover, in the last 50 years we have been rising the abstraction level: since CPUs basically compute the same stuff, it means that we have more "machines" at work. People do not write opcodes. We write Python (Lisp? Clojure? Ruby?) code that is compiled and/or interpreted by a machine that runs on a machine called operating system that offers uses the services provided by a machine called kernel that uses relatively high-level services provided by the hardware. I don't tell the computer to write a 0 in some position of the hard disk!

Of course, we don't have machines that convert pointed-haired-boss-level babbling and unclear requirements to executable software. In other words, software developers are not skilled in divination. Perhaps haruspicy [0] or augury should be added to CS curricula. The problem is people do not even know exactly what they want. The best we can do is to keep them involved in the development process and use continuos feedback to deliver the product they expect.

"Name one other thing in the world, he said, that is used by so many people and which is created entirely by hand"

Well, many things come to my mind. Books. Laws. Theorems. You don't have machine writing books (well, in fact IA tried to build machines performing some limited "artistic" tasks, with mixed results -- the more constrained the piece of art, the better the chances --). I do not think we have machines writing laws. Human have been creating laws for millennia. We *wrote* them down. And still, there is not consensus on what is right. Laws are bugged and there are people exploiting bugs in them (and that is not even closely illegal: it is the highly paid profession of the lawyer). We don't have nor want machines writing laws for us. Experts do not agree in what is a right law. Laws are continuously changed, modified, patched, deployed (in Italy we have the concept of "decreto attuativo" which I'm not even sure it has a clear translation in English -- the idea is that the law is so vague that you need some "lower level" laws to actually explain how the law should be implemented). Laws are unjust. And nobody fucking complains that the Romans could build bridges lasting millennia (I could have a roman bridge right under my feet right now) and we can't have unambiguous laws. Well, romans were pretty good to write laws as well...

So essentially the point is that some people think that software should be like houses, because it is a product. I think that software should be like poetry, because it is an idea.

----
[0] The problem is that if you believe write requirements based on sheep guts then maybe you should start the noble profession of PHB.
[1] [0]s/sheep guts/birds flight/

Sunday, January 16, 2011

Different complexities: Lisp and C++

I could not think to two more different languages than C++ and Lisp. They are different in almost all relevant aspects. Even the underlying philosophies are completely different. The culture clash between Lispers and C++ users is well epitomized by the famous (perhaps notorious) post of the great Naggum.

Some quotes from one the post are:
  • C++ is a language strongly optimized for liars and people who go by guesswork and ignorance. 
  • ... it's just that in C++ and the like, you don't trust anybody, and in CLOS you basically trust everybody. The practical result is that thieves and bums use C++ and nice people use CLOS.
And a quote I would have missed were not for wikiquote is
  • I believe C++ instills fear in programmers, fear that the interaction of some details causes unpredictable results. Its unmanageable complexity has spawned more fear-preventing tools than any other language, but the solution should have been to create and use a language that does not overload the whole goddamn human brain with irrelevant details. 
Now, Naggum's post are usually extreme and it is easy to get offended. However, were not for the post I linked (and for a certain Python guru which introduced me to Python) I could probably have my mind crippled by C++. Not that C++ cripples the mind; exclusive exposure to just one language and strong belief that it is the best in the world[0] does it.

Dropping Naggum's extremes, it is true that C++ is about coercion and mistrust as Lisp (and Python) are about freedom and trust. Notice that supporter of different languages disagree on whether freedom is a good thing, after all. Ask an Ada programmer and he'll have you jailed just for thinking about certain things.

Then I asked myself: there is something C++ and Lisp share? And yes, there is. They have huge manuals. I'm quite a Lisp noob and for certain I miss many opportunities. No single course could cover all the stuff (the reference is some eight hundred pages alone!). Every time I look at some article, different book or manual, I usually find some feature I did not know about (and which usually I like it a lot).

I consider myself rather skilled in C++ and, although it is the single language I forget more easily[1] when I do not use it a lot[2]. However, I often speak with inexperienced C++ programmers and I find out they often are missing lots of language and library features.

There is a difference, though. My Lisp code is correct. Perhaps some experienced Lisp hacker could argue that not using some feature makes the code longer or less readable, and I agree, being a fan of idiomatic code. However, the code is not wrong, neither is "Python in Lisp" or something like that. I know the functional model quite well and I can always apply it.

In other words, my inexperience is shown in choosing a longer route, not a wrong one. On the other hand, from my experience, inexperienced C++ programmers just write wrong and inefficient[3] programs; but let us ignore the inefficient thing. They are wrong or in the best situation just error prone. Since it is very hard to design interfaces correctly, I often see implementation leak in the interface or internal handler somewhat exposed (which basically blows the whole encapsulation thing and disables the painful private/public discipline with an orange toxic fart). And even if they are exposed correctly (e.g., iterators) they are always risky. I believe every C++ programmer (included myself) has at least once used an iterator which has been invalidated and had nightmares about it ever since.

Ignoring safe pointers (auto_ptr, shared_ptr) is a good way to write buggy software. In fact, auto_ptr is also a good way to write buggy software: it's semantic is just quite counter intuitive. On the other hand, shared_ptr has hidden costs and should be used with care. Then there is scoped_ptr... which embraces fully C++ design philosophy: if you are using it wrong (copying it) you won't even compile. In a certain sense the concept of "reference" to an object is expressed in 5 slightly different ways (7, if we put the things to hold arrays as well). Not using them correctly leads to incorrect or bug prone code.

Basically, Meyers/Sutter's excellent books are not there to improve C++ code in the sense that programmers can live without them and simply write less enlightened code. If they don't read[4] them (or similar books) their C++ is going to be a vivarium for bugs. Perhaps if some of them is very clever and very experienced (in other languages), she may just see them coming and "rediscover" some of the recipes all alone. Ok, that's fine, just harder. On the other hand in Lisp we are just "missing" the tenth consecutive cool feature.


----
[0] this applies to Lisp and Python as well
[1] this means something, doesn't it?
[2] and I'm happy about it
[3] I believe that if you use a language that traded everything, common sense included, for speed and you write slow code, you have seriously missed the point.
[4] I take for granted the whole read/understand thing

Friday, November 26, 2010

Slowly abandoning Apple?

There was a time when I used to say most software I use was Cocoa. Consequently, I did not use cross-platform software (a part from CLI stuff). I preferred the OS X only, non portable solution to cross-platform solutions every time the OS X provided a niftier integration with the system.

I was rather shocked considering that it is no longer true. First: I mostly work with non Apple systems (that is to say Windows and Linux). This is not really an issue: I was aware that my job could be done without a Mac. Being mostly a developer, I just need the development tools: compilers, open source interpreters, Eclipse, WingIDE, IntelliJ. All this stuff is cross platform. I also use latex (which is also cross platform). Unfortunately I use Word and the wonderful MathType quite often. Well... once I was very skeptical about the pair, long time ago. I changed my mind, of course. Still don't like word, but MathType is wonderful. JEdit and gvim more than TextMate or BBEdit.

I still use OmniGraffle, and I find it wonderful. However, I think that it sucks not being able to use it on my netbook (my apple laptop has a broken hard drive and I haven't fixed it yet). I mostly dropped Papers for Mendeley (cross-platform and I think more useful). My synchronization needs have increased: I use gmail more often than Mail; Dropbox beats the crap out of MobileMe (which I'm not going to renew).

Etc etc etc. In fact the last bundles of Mac software are not interesting from my point of view. I bought some sw some time ago, and I did not use it. Not that the MacOS is not great, beware. Just I feel like I have to be able to leave the platform with no hassle should the need arise. My MacPro is going to last, so is my laptop. But not forever; and then? I even find some things are better outside the mac (e.g., key shortcuts of IDEs... they are not standardized like on the mac, of course, but the ides just don't work at 100% on the mac... perhaps the new versions are improving).

Just happy I bought 1Password for Windows. Now I just have to leave Yojimbo. Still, no time to export the notes... and the serial numbers. I don't even want to think how much I money I threw away. :(

Yeah... of course, if I had more time to play things would be different. I just love Logic (Express) and doing audio on the Mac. Though, I have not enough time.

Powered by ScribeFire.



, , , ,

Sunday, October 31, 2010

What about Apple quality (ipad, iphoto, camera connection kit)?

The beginning

I quit using Apple products in the late nineties as I felt that directly and solely using Linux was far a better choice to my needs. As a consequence, I stopped doing many things I use to (such as recording and producing music) and that was it. Some years later, I bought a 12" powerbook and I think it is one of the best notebooks I ever had. Jaguar was crap compared to the systems we have today.

Integration with open source stuff was mostly left to the users (and that way I learnt lots of things I had for granted in Linux). On the other hand, I had lots of beautiful applications and a unix system which worked flawlessly on my laptop, which, at the time, was not common at all. Since then I have been quite enthusiastic about apple products. I bought many more Macs and used them as my main development platform. I bought mac software. I have an iPad and an iPhone.

I was very satisfied with the general quality of the products. Few bugs, few problems. On the other hand, I'm now starting to seriously question Apple strategy. I have already expressed my concerns about the mac store. Though I'm starting to believe things are worse.

The tragedy

For example, this fall I went to Cornwall on holiday. I brought my camera and my ipad. The idea was that I could store the pictures on my iPad (I bought also the camera connection kit).

I was pleasantly surprised that the kit stored the pictures in raw format and consequently I had no loss of quality. On the other hand, this detail was not clear at all (I had to sent myself an email containing one picture to find out that it still was a NEF file). I think that this information is irrelevant for most amateurs (as most digital compact cameras save in JPEG); however, it is critical for a professional. And it may be critical for some amateurs as well, the ones with digital reflex cameras.

So as soon as my memory card was full, I connected it to the ipad and started downloading the pictures. Apparently, everything went well; I simply felt that the process was quite too slow (but I may be biased as I wanted to use the ipad at the same time to check the email and I did not want to interrupt the transfer). So I decided that I could afford buying another memory card. With that one and the now emptied old one, I could manage to take pictures without another transfer.

Went I came back, I connected the ipad to the mac pro and started downloading the pictures. The process hanged after importing a hundred pictures or so. Since I connected it to my monitor (which has an USB hub), I initially blamed the monitor. However, I should have suspects on iphoto since the "cancel" button did not work and I had to manually force quit the application. Then I tried another hub (which was more tested); same results. And then I directly connected the ipad to the Mac and once again the transfer hanged. My guess, at this point, was that the ipad had issues. In fact, I transferred greater quantities of pictures (but I forgot I did not use iphoto, but Nikon Transfer).

As a side note, I stopped using Nikon Transfer because I lost some pictures due to unclear options related to "deleting pictures after transfer". For NT it meant delete all the pictures after the transfer, both the ones you transferred and the ones you did not, while I thought that it conservatively meant "delete the pictures that you just transferred". Luckily enough CardRaider saved the day.

Well, iPhoto was not very clear on what they meant with "Keep pictures" "Delete pictures" either, so I decided to "keep" and manually delete. I think that Apple could have been more precise.

Anyway, at this point I was quite desperate: I found no options in ipad-iPhoto to mass put all the pictures somewhere where I could access them. Luckily, I remembered that Preview is able to import pictures from cameras. And it is able to import pictures from the ipad as well. The program is faster than iphoto. It is faster to start, faster to transfer. The image selection interface is also far clearer: moreover, failed or interrupted downloads showed clearly the already imported images, so starting from the point where I left was easier.

In fact, the first time I got the same transfer error I had with iphoto. However, plug and unplug + quit & reopen fixed the issue and now I have all the pictures safely on my hard drive.

Conclusion

I never really trusted iphoto: I kept my files outside the library in order to more easily access them. I trust the program even less: I won't use it to import pictures, just to present them. The "find faces" functionality is just a curiosity: I still haven't found any use for it. Moreover, much of the imported pictures are not processed by that functionality. I don't know why.

As a consequence, I would like to get rid of iphoto. I want to stop subscribing to mobile me as well (e.g., out of the blue, iWeb is not able to update my website anymore). Now I just have to find a substitute; something which has similar features and that possibly retains the association between the raw pictures and the modified one. Still iPhoto was not that bad: I could have used it. I just think it is not refined and a bit left on its own.

And now there is the new version. And I am not very motivated in buying that software. On the other hand abandoning most apple ties is quite hard and since all the stuff is very well integrated, it is somehow required to stop using all that crap together, otherwise problems arise.

Some pictures

Ocean Pictures (Dawn)

Ocean Picture

Ocean Picture (Night)

 

 

Technorati Tags: , , , , , , , , , ,

Saturday, October 23, 2010

Mac App Store Review Guidelines

Lately, it seems to me that at Apple is doing everything they can to completely annoy developers and geeks. Which is, of course, a very bad premise for a post; as far as I have seen Apple proved to be right against all the odds most of the times. People continuously complain on Apple (and I have never seen a company with so many haters, with the possible exception of Microsoft), though sells grow and the products improve.

In fact Snow Leopard is the best OS they did (and perhaps the best I ever tried). The machines they build are sturdy and elegant at the same time. And the ipad is a wonderful tool .

There are many things that I don't like, though. Perhaps one day I will elaborate on this. At the present, however, I would like to point out the conditions to have an app accepted at the Apple store.

Some are worried that they will become the sole way to distribute software. I am confident it will not. First, the EU already questioned whether it was acceptable to do that on the iphone/ipad. I am sure that they will seriously avoid having Apple doing that on a PC. Moreover, Apple would lose developers and applications (thinking Adobe and Microsoft and many other commercial companies will comply with those lines is pure madness)... And I even think that it is good to create such an OS.

It means slowly going towards some Raskin's ideas (he also opposed the very idea of third party applications). Though, it would be an OS completely useless to me. If they do it and they do it right, perhaps it is a good thing. But they won't get my money. Windows 7 is a solid system and Ubuntu gets better with every release: I'm not even sure that they would catch up without Apple going so experimental (they just lack some software).

Back to the rules...

2.1Apps that crash will be rejected

2.2Apps that exhibit bugs will be rejected

Am I reading this for real? Every developer knows that every non trivial piece of software has bugs. We strive to put in fewer bugs and for having the severity of the bugs reduced. But no bugs? Madness. An uncaught exception means that the application is going to crash. As far as I can see, those rules are basically reducing the set of acceptable apps to applications so small that they can be manually proved correct (unfortunately, this basically excludes GUI and concurrent applications).

So I think that those rules are fakes. They don't mean a thing. If they do, I am going to buy some Apple software from the store and ask them to remove it from the store as soon as it manifests a bug. And it will... ah, it will! Apple software is far from perfect: it just has a very careful UI design... ;)

2.7Apps that duplicate apps already in the App Store may be rejected, particularly if there are many of them

Oh, really? So you've got to be fast! Perhaps if the developers publish a bunch of word processors (which, with Cocoa API is quite simple) then Microsoft Office will be rejected. I don't really believe this, but it would be funny. In fact, I'm not even sure that MS is going to put anything on the store.

2.8Apps that are not very useful or do not provide any lasting entertainment value may be rejected

 

What the fuck does it mean? Office does not provide any entertainment value: its a tool. I am not entertained when I work with Word or with Keynote. Dear sirs at Apple... there is people working with your bloody macintosh computers. We are not to be entertained: we don't want to have a funny dog advisor to make the software entertaining.

2.16Apps that download or install additional code or resources to add functionality or change their primary purpose will be rejected

 

At last, they rephrased the sentence on the ipad guidelines. The way it was before basically would rule out a web browser.

2.19Apps that require license keys or implement their own copy protection will be rejected

2.20Apps that present a license screen at launch will be rejected

 

I love those two. I hate developers spending effort on protections. If I like the app, I am going to pay for it. If I don't like it, I'm not gonna use it. There are developers who put on the protections before writing useful functionalities (and sometimes they do sell the betas as well... luckily, the MacStore will at least make this behavior unrealizable).

2.18Apps that install kexts will be rejected

2.23Apps that spawn processes that continue to run after a user has quit the app without user consent will be rejected

7.4Apps containing "rental" content or services that expire after a limited time will be rejected

Ok... here it is obvious other means for installation will remain

2.24Apps that use deprecated or optionally installed technologies (e.g., Java, Rosetta) will be rejected

No Eclipse on the Mac Store... It seems that Python apps will be ok, as Python ships with every mac. At least nowadays.

2.25Apps that do not run on the currently shipping OS will be rejected

 

Oh... so developers... you always have to keep up with the last Apple OS!

 

3.1Apps with metadata that mentions the name of any other computer platform will be rejected

 

Don't know... CommodorEmulator seems to violate the rule.

6.1Apps must comply with all terms and conditions explained in the Apple Macintosh Human

Interface Guidelines

6.4Apple and our customers place a high value on simple, refined, creative, well thought through interfaces. They take more work but are worth it. Apple sets a high bar. If your user interface is complex or less than very good it may be rejected

Ok. Reasonable. Perhaps even possible. A certification "(Good UI)" would be very good: a prohibition to sell is bad.

6.2Apps that look similar to Apple Products or apps bundled on the Mac, including the Finder, iChat, iTunes, and Dashboard, will be rejected

How is this called in english? Abuse of a dominant position? Yeah. If this mac store is ever going to be successful, then Apple will got into troubles. And rightly so.

 

7.6In general, the more expensive your app, the more thoroughly we will review it

LOL. ROTFL. Makes sense, though.

8.3Apps that are simply web clippings, content aggregators, or a collection of links, may be rejected

Actually, no wikipedia app.

9.1Apps that encourage users to use an Apple product in a way that may cause damage to the

device will be rejected

 

LOL.

9.2Apps that rapidly drain a products battery or generate excessive heat will be rejected

So, no scientific computation tools allowed.

11.1Apps portraying realistic images of people or animals being killed or maimed, shot, stabbed, tortured or injured will be rejected

11.3"Enemies" within the context of a game cannot solely target a specific race, culture, a real government or corporation, or any other real entity

Looks like some games will be rejected. E.g., in 2nd war games, it seems you will have to be able to play both sides.

Technorati Tags: , , ,

Friday, October 22, 2010

Asus Survey

I own an ASUS netbook and I am quite satisfied. I also wrote about specific problems related to performance and Java and RAM and those things you should be supposed to do with a netbook but are painstakingly slow. However, things improved since I bought 2 GB of RAM.

Anyway... I'm a rather satisfied ASUS customer and I received a survey request.

"""Thank you for registering your Asus product. We are holding our 2010 Asus laptop current usage survey."""

So I decided to do the survey. Ok... I start answering all the questions; then I tried to submit the whole thing.

The system does not allow me to send the survey if all the questions weren't answered. Which is idiotic: I did not fill in some question on purpose. I did not want to answer or I did not know how to answer. But I have to provide an answer nonetheless. And of course, that is a fucking random answer.

For example, they insist asking me questions on how I would like my next touch sensitive ASUS laptop when I just answered I do not want any bloody touch screen and touch whatever laptop. I have an iPad for that. And they keep asking where would I use the laptop I told them I would not buy. WTF!

At the end, after giving some random answers (if your analysts and web designers can't do their job and you get answers without value, the problem is yours, not mine), the survey could not be submitted without providing my personal details. And I'm not seeing the point.

I am doing you a favor ASUS. You don't have to bother me this way: no survey from me at this conditions. Of course, ASUS can do well without my survey. But I think I'm not the only one with position similar to this. By the way, I considered the idea of filling the survey because I'm a satisfied customer. I was more than willing to spend time to answer properly and reflect on the answers. Instead, the survey really annoyed me.

Tuesday, October 19, 2010

Checked Exceptions

I definitely hate them. They are evil.



He is a boy-scout in comparison.

Tuesday, October 5, 2010

Me and my IDE

Introduction

As customary in my articles on text editors and IDE I originally started this post with a self-condescending presentation of my skills and expertise. Then there have been some miscomprehension between chrome and blogger and the second part of the draft was not saved although blogger stated otherwise.

As a consequence I had the more self-condescending part and I lost the slightly more interesting one. I thought to do everybody a favor and delete that stuff. Now, a slightly less condescending paragraph on myself in order to motivate my point of view.

The past

I almost always used editors. Emacs, vim… and when on BBEdit and TextMate. Ah… light tools. Not only that: I was quite vocal in the IDE vs. Editor war (from the editor side, of course). And this can also be related to my choice of  “freedom languages” (more on this on later posts, perhaps?).

But some weeks ago I realized that now, without noticing, I’m mostly using IDEs. How has that happened? The easy part to explain is the Java related one. Java greatly benefits from IDEs (or perhaps the widespread diffusion of IDEs has tampered the development of good language features?); in fact it is quite much harder to develop Java without an IDE, since the language is very verbose. On the other hand its restrictions and bounds make it quite easier to develop good and powerful tools. Of course I could use UltraEdit on Windows… but no luck with OS X and Linux (moreover, I had to pay that as well… and I preferred to buy IntelliJ).

Emacs has very nice modules to work with Java. On the other hand they have to be installed separately (and in my experience also slowed down normal operations). When I have to loose to much time configuring my editor, I usually try other solutions. That is why I used TextMate and BBEdit extensively… because they are almost already set-up. I also like vim, since has decent default setups for most situations.

For somewhat similar reasons, I bought WingIDE to work with Python. I could set up Emacs (or vim) to do that stuff, of course. Still, I had not much time, not motivation… and I bought the thing. I especially liked it because it worked equally well on single files and on large projects. It also had the best auto-completion for Python I ever tried, nice debugging features (I use them rarely, but when I do I love to have an easy to use environment, especially because I use them rarely and I tend to forget the tricks). In the pack there is also nice support for unit-testing (and that is a definite plus).

In the same time I worked extensively with C++. I mostly used editors (vim, because I especially like it with C/C++) and BBEdit because of its easy to set up “project management” features. BBEdit also has most the processing power of classical editors and that is nice. I quite enjoyed the best effort auto-completion it provided and ctags based stuff. Ok… still too much template metaprogramming (or simply correct and not basic use of templates) crippled smart “IDE like” features which I would have liked.

In other words, I sincerely craved for a nice C++ IDE. Perhaps I should try Java based IDEs with C++ as well… I may be surprised. Though I hate setting up projects in IDEs. Every IDE has its conventions and it is not always immediate how to work with a project that both needs “classical command line build interface” (which is something I’m not disposed – nor can I afford to – lose) and the IDE based build. Somewhat CMake eases the problem, but at the price of restricting myself to the supported IDEs.

Other languages I use, but I think that they account for less than 30% of my development time (and it is going to drop). And perhaps they could be moved to IDEs as well… as soon as I solve the “single file project problem” [or I simply give up my hopes with that].

This basically rules me out from editor flame-wars. Still, I believe that learning using IDEs is a terrible mistake… but is a modest position. Moreover, nowadays most editor proponents show you how to add all the IDE features to their editor of choice. So what’s the point? It’s not an Editor vs. IDE matter, it’s Emacs vs. Eclipse. And somewhat I believe Eclipse is going to become what Emacs was in the past years. And hopefully it is going to become faster like Emacs did…

The future

So what now? I’m lazy to the bone. And I’m quite new to the IDE world. I have my habits and I don’t really want to change them. And don’t believe the ones who tell that using IDEs is easier. Nor faster. It depends on your skill set. As I have my own requirements, some things may be slower with IDEs, at least until I figure out how to do them.

Which basically means that an IDE is not automatically more productive: it may be, provided that you know the tool. Yes, some have a very good learning curve (like WingIDE), others are very good, but need you to figure the way they work to exploit them fully (IntelliJ). Moreover, I still have to figure out how to develop Java projects easily built both with IDEs and with command line tools. Perhaps I should explore maven (which should be well integrated with all the main IDEs). After-all its racist on my part to spend time with cmake and auto-tools and not doing that for Java “based” projects.

Saturday, September 18, 2010

Productivity metrics

Many metric of productivity, code quality and similar stuff have been proposed during the years. Usually each metric has some underlying implication on how software engineering and development should or should not be done. Some are so biased that they seem created only to promote a given procedure. Well, everyone has its jobs. There are people who code, people who tell other people how to code, people who tell other people how to tell other people how to code. The things stops here because even managers understand that a fourth level of indirection is a pure waste of money.

What we know is that good developers are just more productive that bad ones. This was well known even before the whole agile movement came into existence (and even before free software was a buzzworld). In fact I found references on this in Mythical Man Month, between a praise to God and another[0]. Basically Brooks cites some studies which proved that a good developer can be 10 times more productive than a regular one. Of course I would be led to think that a 5 good developer team could achieve much more than a 50 regular developers teams because of the minor impact of communication overhead (especially considering Agile techniques, but now I'm going astray).

Of course, the number of wtf code reviewers utter gives a roughly idea on the quality of examined code... and it works independently on the number of people in the team; it does not matter how many people wrote the cr... code. If it sucks, it sucks. If it sucks it will yield a sensible and continuous stream of wtf. The actual problem is that: i) you actually need a reviewer [which you should have, but too many companies don't]; ii) you actually have to put up recording systems and tie audio files with commits, which would require huge amount of space. Simply counting the number of wtf I don't believe it works, as tone counts. There is a mild wtf and there is an astonished wtf. And there is the angy wtf. And basically you have to develop a very complex system to discern the tone and texture and mood of wtf.

Thus, here we propose the FLOC metric (Fun per Line of Code). That is to say: how much fun the developer (in a sober state) had writing the code. Unless the developer has some facial paresis which makes him look as he was smiling all the time (which is something which luckily affects only a relatively minor percentage of programmers), only a crappy jpeg needs to be associated with the commit. Software which are able to do emotion recognition from face pictures is being actively developed and its not rocket science (actually rocket, have faces, sometimes, but I find extremely bad taste when soldier paint women on bombs).

Please notice I'm half serious: if developers have fun (such as when they program in some nice freedom language) they just write better code. And work longer. Produce more. Crap! That was a secret!

----
[0] I really understand why it is considered the "Bible" of software engineering, it is because the ratio of references to God per sentence is similar to the one we find in the Bible... which I don't think it's a problem in the Bible (since it's about God), but is awkward in software engineering. To understand my feelings, consider this scenario:
[user] Can the bridge support my truck?
[engineer] God bless you.

Friday, September 17, 2010

It was better when it was worse (and the RAM...)

I usually deride this kind of arguments. I believe that although specific issue can worsen with time (a part from the obvious ones, such as oil shortage), most things somewhat improve. This is especially true in the computer science/math/science fields. We have better algorithms and better hardware.

My (not so) cheap netbook (which I am using to write this post) would have been a super-computer for the standards of when I started using a computer. I am not only talking about the 14h of autonomy (back then I
don't think the concept of laptop was widespread)... even my crappy Atom CPU would have been a wonder.

I'm usually not very sympathetic with the ones who actually complain about the resources needed to run modern applications (Mind child, when I was your age I had only 640 KB of RAM and I did this and that! -- which in turn must have been generated by some condescending unix hacker or some punched card freak comparing populous with pong when they were young).

In fact their argument is flawed in the sense that modern programs tend to do lots of stuff that their ancestors did not (which can be useless stuff, compare Word 2007 with Word 5.1 for Mac...). Moreover, modern computers have to do lots of stuff older computer did not have to do, operating systems are more complex, we expect stuff like plug and pray to work etc etc etc. It is like complaining why stuff cost less money many years ago: e.g., in "How Blue Can You Get" B.B. King sung about buying his woman a 10 dollar dinner, meant to be a very expensive one (while she thought it was just a snack). By today standards its the price of a fast food meal.

However, there are some constants. Vim is a fast editor. It does not matter: 10 year ago it was a fast editor. Today it is a fast editor (and improved as well the functionality). On the other hand, while Java as a platform improved a lot in the last fifteen years, Java IDEs are always heavyweight. I was there when Eclipse was just a beta, just something more than a proof of concept. And it was slow. And huge. And now... well, it improved, of course... but I have a quad-core MacPro and its barely passable. I let you wonder how it is on the EEE.

By the way, I don't want to criticize too much Eclipse (Idea is much in the same condition....). Yes, I hate the fact that you have to put everything in a workspace. I hate that it is so much project based that you basically have to create projects for everything. But I have to admit that those tools are necessary to make developing in Java bearable (and productive). Moreover, I quite like the idea... small core, everything is a plugin. Reminds me of Emacs; just with less configuration hassle (which is good). Perhaps in another 15 year it will run smoothly on the machines they will have; Emacs took a lot of time to run fluidly on home-computers afterall.

O yeah, and I have to absolutely buy some RAM because otherwise those IDEs are going to make me die of old age while I try to finish my tasks.

Saturday, September 11, 2010

What is this Java you are talking about?

The first time I heard about Java must have been around 1995 or so. There were these applets and I was looking for something to program my mac. Back then I was not a Unix user nor had any exposure to C. I remember I looked at some examples and I basically did not even understand what was it all about (and I'm not even sure I had the tools to compile the thing). I hated it. That single episode can have had very far reaching consequences in the developer I'm today. I seriously studied Java later. I think it was Java 1.3 or so (and I hated it again). Then I hated Java 1.4. I felt more comfortable with Java 1.5 and I almost overcome my childhood memories around the times of Java 1.6. Besides I did write some serious code with both Java 1.4 and Java 1.5 a part from hating it. The ones who know me perhaps could have been surprised to know that I do advise to learn Java. And it is not something recent (in fact I foresee my future will be much java-centric); it is something I did in the last 5 years. I love Python. I love functional programming, dynamic typing. I love lots of stuff Java does not have and probably will never have. I hate the static typing Java uses, I hate its threading model, I hate above everything else checked exceptions. So why learning Java? Because if you don't read Java, you miss lots of interesting literature. Clean Code is written thinking about Java (and some issues presented are typical of Java, while others are more universal). Patterns of Enterprise Application Architecture is "written" in Java. And so many other books. Moreover, many developers you meet are proficient in Java and in order to introduce them to any other language concept or feature you better express it in terms of Java. The idea I slowly matured is that Java is slowly replacing C as kind of Lingua Franca in computer science. It does not matter Java has defects (and big ones, too). Many new technologies are created inside the Java platform and while we can discuss if it is a good thing or not, things are going this way. Many things that once would have been done in C, now are done in Java (not that I'm suggesting Java will replace C in the areas where C is strong). A couple of days ago I realized another important truth. I kind of figured it out why the industry is using Java, still I had to understand why the academics do (a part from the joke that they love a language you can't use without classes). And the answer is the same: science is not about how good is the language you use. It is about creating, communicating, sharing knowledge. I could write my next system in clojure (that was exactly what I was planning to do). But then fewer people could understand and appreciate my work, and even fewer could take it and improve it. So... let's hope they will improve Java soon. :)

Thursday, September 2, 2010

Netbooks and other tiny things (Java?)

Why are Java IDE's so slow when used on a netbook? This is kind of unbearable.
And I think that now the IDE crashed too. Another 5 minutes and it will finish loading!!

Thursday, July 8, 2010

More on Word

Some pieces of software are unbelievable: as soon as you start noticing how nice are certain features, you discover that some other parts are so incredibly broken that you would want to put the whole thing in the thrash.

As is customary, I received the template to format my article, which was an IEEE standard. Nice. I opened it in Word 2007 for Mac (and the template should be compatible with that) and I removed the contents of the template (as advised on the template itself) and filled with my own text. Shit happens.

For no good reason, the styles built in the template were imported utterly broken. For example the base font size was plainly wrong, some styles did not use the “keep together with next paragraph” thing and so on. Essentially, I had to manually check the styles I used with ones in the unmodified template in order to fix things. And I was able to, however, it took time.

Then I sent the file to my advisor (as a word file, since perhaps he would like to modify some parts). And he told me I was not following the standards, for example because the image labels did not start with “Figure x.”; I found this quite strange, since I was pleasantly surprised by the fact that the text was auto-inserted choosing the style (I think as a kind of numerated list style). I checked my file and the figure x. was still there. So I opened the document with word for Windows. And the Figure x. was missing.

Apparently Office 2008 for Mac and Office 2007 for Windows are not compatible at all. The question is: how many things are going to be fucked up? If I got a lot of nice features which I can’t use because otherwise I can’t share files with colleagues, then the whole point of using Word instead of Latex (and especially the “revisions” feature, which is very useful) is lost.

As a nice side note, I discovered the bibliography IEEE style I downloaded to “auto-manage” the bibliography is utterly broken. First, the references like [4] have italic numbers and the standard I have to follow has not… perhaps there are multiple standards, but then… how to discover the right file?

Second the bibliography itself is formatted as a huge double column table, which is completely unusable in 2-column mode. Other styles (such as the ones built-in with Word) do not format the references, so essentially applying the “references” style to the unformatted references simply solves the problem. But not with the style I have to use. And I don’t understand why word does not come with such widely used styles and I have to download broken third party implementations. The solution was to format the references by hand. Besides, Papers “import into Word” feature also gave me some problems, as every single link contained the pdf url, even if that is not standard. I don’t understand if it’s Papers fault, Word fault or the style fault. Well… doing things by hand, I solved the problem.

I still don’t understand the part “Word is user friendly”.

Monday, June 21, 2010

The power of the power of the power...

Though I really don’t particularly like writing about hardware in my blog, I provide some updates on my current hardware situation. Some years ago, I wrote a short series of blog posts about my iMac. That was a first series machine and I criticized lack of support for scientific software. This is partly related to GMP not being too much collaborative (as it appears they did not have intel macs, bac in the day).

Of course those problems have been entirely solved quite soon. I suppose that by the end of the year they were no more and the faster intel chips were just the right choice for everyone. A couple of years after those events I bought a MacBook Pro 15” laptop and that became my main work machine. Among the things I really liked best about the intel processor (and all the lovely virtualization software packets out there) was that I could run Linux in a virtual machine. Since I did not stop working on a certain “almost-linux-only” project, that was really good (and saved me from ugly partitioning). Although I had a Parallels license (which I used on the iMac), I preferred to use the simpler VirtualBox. Back in the day, Parallels did not support Linux exceptionally well and I could just live with the free VB. And that is the machine I used (along with the iMac) for my M.Sc. dissertation.

4 years after i first turned it on, my iMac blew off. Well, not literally. I suppose I can fix it, however, I chose to buy a new Mac. This time it is a MacPro. Essentially, I hated that if I thrashed my iMac (because of other damages) I could not save the monitor. So I chose a monitor-less computer. Essentially the thing is powerful. It is extremely evident when encoding my CDs into mp3’s. I don’t do much video editing.

Nonetheless, Parallels is completely capable of sucking all the resources. I had to stop using it, since the MP became useless. I suppose it may be related to having only 3 GB, even though the iMac had only 2. If I will need a virtualization software, I suppose I’ll go with VMWare or VirtualBox. But… that is not the last machine I bought.

Monday, June 7, 2010

PDF and other tragicomical histories

Today I had the unlucky task of creating a PDF from a Word document we wrote.
In fact, I did not think the thing would have gotten tricky (ah, how naive!). Word 2007 has a nice "save to PDF" menu item and I thought I could use that to solve my problem. Luckily enough, I double checked the generated PDF on the Mac. And, apparently, all the bold fonts were substituted with another font. I already mentioned this in a post earlier today.

This is completely illogical since the font was Times New Roman and I have Word on the Mac as well, which would install a lot of additional fonts, even if TNR was not that standard. So I searched for a Windows PDF creator (which, by the way both OS X and Linux-based desktop programs have). I found a bunch of them, some commercial, some free, some open source. My choice was PDFCreator.

Some reasons are: i) it is free as in free beer, ii) it is free as in free speech, iii) had no ads, iv) is based on the same softwares I happily used with Linux. Of course, reason i) was paramount: I had no intention to buy a stinking PDF creator for Windows unless it is absolutely necessary (which may be). The other three reasons have to be considered together: I searched google for suggestions, but I had no clue on which one was supposed to be better.

Usually the only problem with open source software is lack of support/user friendliness. However, that was not the case of PDFCreator. Unfortunately, for reasons beyond my comprehension, the generated pdf completely screws[0] a TIFF picture I put in the document. The same picture is perfectly fine in the PDF generated with word built-in generator. I tried to include in word a PDF, but that did not work either (the PDF was linked, but not visible -- nor printable --). Amazingly, Word for Mac is capable of using PDF image files, IIRC.

Perhaps, I should have tried more generators. I went home, opened Word for Mac, double checked that the formatting was fine (which was not, but I could fix it in little time) and simply printed to PDF. The PDF is perfect. This goes under: how to completely waste a Monday morning.

Footnotes

[0] This is a technical term, essentially it looked like it had low resolution

A matter of homoiconicity

Somewhere around the late sixties the term “homoiconicity” has been introduced in the computer science community. In fact, the term was older and dates to the 1960, at least according to Wikipedia. Strangely enough, I did not find traces of the term homoiconic or homoiconicity in McIllroy [1]. I was not unable to recover the full text of the paper on TRAC [2]. However, widespread use of the term is due to McKay (along for the very idea of object oriented programming and a good deal of criticism on Lisp – perhaps I will look for some opinions of famous lispers on Smalltalk to make things even) in his Ph.D. dissertation.
The basic idea is simple: program is data. That is to say, the program is represented in the very same format as data. Thus, a program can manipulate programs (and even itself) in the same ways it uses for data. This is great and is the foundation for great and funny meta-programming.
Indeed, references on TRAC should make clear that a structured representation of programs is not needed. TRAC manipulated strings and programs where represented as strings. On the other hand, Lisp manipulates lists and a program is a list. It is quite rare in a discussion on programming languages with a lisper that he does not use the term “homoiconic” somewhere in the discussion, usually before becoming condescending (a proof of this is being developed actively – no trolls have been harmed during the experimentations).
What I find extremely interesting is that this great property was simply obvious in theoretical models. Universal Turing Machines and primitive functions need an enumeration of programs (functions, respectively) in order to manipulate such objects. If such enumeration was not possible, most computer science would not have been created.

The von Neumann architecture also relies heavily on instructions being represented as numbers and stored along with data. It’s a bit of a pity that this properties have not been naturally ported to programming languages (except from Lisp and some others).
Indeed, we all agree that homoiconicity is a great property in programming languages. In fact, I often find frustrating complete lack of it (e.g., Java is completely not homoiconic, since its main data structure is the Object but Java programs are not even near to being objects – ok, you can always call the compiler get an AST… but this is not what the whole thing is about). Other languages have limited support for it.
In Python functions and classes (and objects) are available when compiling a module. The whole decorator concept, for example, relies on the fact that functions are objects and can be passed as such at compile time. Very powerful meta-programming techniques in Python rely on “program” manipulation, where programs are represented as classes and functions (and not syntactically, like in Lisp). This makes some kind of manipulation very hard (without resorting to byte-code manipulation – and then the same objection with the java compiler/AST thing applies – or to basic string manipulation, which I would not consider as a symptom of homoiconicity, since strings are not “the main data” in Python). However, I would not rule Python out of the bunch of homoiconic languages, either. Perhaps “partially homoiconic” applies? Or perhaps do we need better built in tools to manipulate classes and functions in Python to qualify for the full homoiconic(tm) certification from old lisp hackers[3]?

References

  1. McIlroy, M. D. 1960. Macro instruction extensions of compiler languages. Commun. ACM 3, 4 (Apr. 1960), 214-220. DOI
  2. MOOERS, C.N. TRAC, a text handling language. Proc. ACM 20th Nat. Conf. Cleveland, Aug. 1965, pp. 229-246.
  3. Not meant to be offensive… perhaps old could be replaced with ancient?

Using word to write...

Using word to write articles is a rather perverted art. E.g., why are the "regular expression" different from every other syntax I met and there are two different syntaxes depending whether you are using jolly characters or not?

Why is the bibliographic tools such a joke that almost everybody does it by hand (and, moreover, many conferences explicitly tell you to do it by hand? and the W2007 implementation is not compatible with W2003 – at least that is the opinion of W2007 on that matter)

And using images is a PITA. But that is a PITA with Latex as well. Last but not least, I have yet to understand why a PDF created with word for windows visualize bold characters (I'm following the IEEE template, so changing the font is not an option... besides, it's times new roman) with a *different* non-bold font when opened on the Mac. If it were not such a standard font I would have said it's a matter of not including the font.

Monday, September 1, 2008

I'm Back (Back in Black)

I'm kind afraid the few who read this blog kind of regularly (for pretty wide values of regularly) stopped this despicable practice in the last year, as apparently I stopped writing as well.

This is indeed the bare naked truth. In september I graduated and in the last period I was astonishingly busy (and worried for the results). The results were excellent, but my schedule perseverated in being crowded. I also was thrown out from Google indexing since some nice guy proved that no PHP website can be left unattended for months (and did so filling my articles with invisible links to the worse sites of the web -- or the best ones, depending on your point of view --).

Out of the blue, I decided I could start writing again. And I decided to try the nice MacJournal application whose license I got among the ones in the last MacUpdate Bundle.

The bundle itself was quite unsatisfactory. I don't use most of the applications. I don't like Mellel (and in fact I'm a quite satisfied Nisus Pro user) and I find DEVONagent wonderful and mysterious as well (that implies that I was unsuccessful in making something of it). Some of the other applications are great, though I don't really need them.

For example I'm using 1% of Contactizer Pro capabilities and I think I scribbled somewhere I was to learn to use the program, since it seems extremely useful. I'm also very satisfied by LightZone, since I recently bought a nice reflex and plan to use it a lot. Unfortunately enough, I don't seem to have time to spend sightseeing (and consequently taking pictures) and this is how the story ends. Moreover, I really need two things in an image editing program: something to straighten the horizon and Photoshop ‘patch' tool. Appearently even Gimp has it, but not Pixelmator (nor LightZone, but this is because LZ is a totally different kind of program).

DSC_0351-2008-09-1-05-24.JPG

Moreover, I've got no time to learn LightZone and I'm afraid I'll stick with iPhoto even though it can only save edited images as JPEGs. Which kind of sucks, but it's my fault: I paid for more professional and I don't want to learn how to use them. Besides, the meaning of "more professional software" is still under theological scrutiny.

As a pleasant side effect of the MacUpdate Bundle, I got an enormous discount on software from Koingo Software. This particular discount gives me access to all the applications they created or will create and their updates as well. Librarian Pro is among them.

I love Librarian Pro. I love books and LP seems a great way to keep a catalog. And one day or another, I will put it online. But this is another story.

Going back to MacJournal, it seems an extremely good application. Maybe I will write this blog regularly, after all.

What else? We did Pycon Italy 2008, which was great. And since the blog was not actively maintained, I did not write about it then.

And for those of you curious about my yellow dog... it seems a Leopard ate it. Poor dog! :P