January 21, 2012

Windows vs Linux without flaming

I recently had a discussion about how Linux was better than Windows (or vice versa), why it's market share is so small and so on.
Of course, the discussion was between me and another geek, or maybe I should say a die-hard-coder-geek who's only way to interact with a PC is using a console. (means, no UI at all, init3-only state)

After having that discussion for a pretty big amount of time, I decided to ask in a few IRC channels, and see what other people thought about that. And to be honest, I was amazed about how geeks (read as: geeks, coders, net magicians, etc...) think. And I was amazed in a bad way.

There was only one argument about why Linux has so small market share:

  • Windows comes pre-installed in 99% of PC's.

And the most used arguments about why people should switch to Linux were:

  • Linux is free and Windows isn't.
  • Linux is safer and Windows is basically a crap.
  • Linux is easier.
  • Linux has better support for hardware.
  • Linux has more applications, and almost all of them for free.
Those seem to be some pretty solid arguments for switching from Windows to Linux, but I'd like to say a few words about each one of them.

Linux is free and Windows ins't - That's true, unless you buy one of the few paid distros. And, in fact, those are free too. You're paying for the support service or for helping the creator(s). I can't add anything more to that point, so, I'll accept that as a valid argument.

Linux is safer - That's true too. It's not the safest OS, but it pretty much kick's Windows ass. Nothing more to add on that argument. Yet another valid argument for switching from Windows to Linux.

Linux is easier and has better support for hardware - Wrong. Most Linux installers are as easy as Windows Vista/7 installers. But once installed, Linux just gets a pretty damn thing to control.

By the way, just in case you're reading my blog without knowing who am I or what I do, I'm a software developer and a die-hard Linux user, I have been using Arch for a couple of years, and before that I was on Debian with KDE and Kubuntu. It's worth to mention that I pretty much hate anything Windows related.

So, as I was saying, after finishing the install part, Linux just turns to be a pain in the ass compared to Windows. Let me explain why.

Windows users have all those magic autorun-CD's, part of their computer with a pre-installed Windows, that install pretty much all drivers, codecs, some other important stuff like Adobe Flash, ShockWave and a few crapware/bloatware applications. Just insert the CD and wait for it to finish it's work.

On the other hand, the easier distros, like Ubuntu, make your computer work with some open source drivers without you having to do anything, but they don't install any codecs because of some law/restrictions reasons.

The codecs part is understandable. If you want those, just install them. Some appilcations, like Amarok2, detect missing codecs and install them for you. We could say that that is as easier as installing codecs with an autorun-CD. But what about drivers? Let's be honest, open source drivers just suck. Sure, they let you open your favourite web-browser and check your email, the news and see your photos, but that's all. You can't watch full-screen movies in 1080p (lack of performance), you can't play any 3D-intensive games, you can't work with applications that require 3D (CAD for example). For doing all those things you need to install the proprietary drivers.

NVidia drivers aren't that hard to install, you just have to choose them from your package manager, install them and reboot. But ATI... oh dear, ATI drivers are just a major pain in the ass. 95% of the time you end up with a messed X, or even worse, without X. Also, what about Intel graphics? Those aren't even installable... Of course, not by a normal person that bought a computer a few months ago with the hope to be able to read emails, news and watch movies.
Also, IRC channels, forums and so on aren't a solution for a very high percent of people. They buy a PC to make their life easier, not to be forced to RTFM!

Geeks doesn't seem to understand that the "just open a console and write `sudo apt-aDvFg#$%&gga!!#¿!¡¡'`" is difficult for people.

Linux has more applications, and almost all of them for free - Linux has tons of applications. Tons of useless or duplicated applications. Once again, let's be honest, there are 500 music players for Linux, and none of them is good. You have Amarok2 that feels like it needs 4gb of RAM to work properly, then there are Totem, Kaffeine and Xine that just don't match the concept of 'beautiful user experience', not even skins make them look good. And then there are a few Gnome players that do match the 'beautiful user experience' concept and system integration but they lack some basic features.

Same happens with video players, IM applications (btw, I'm one of the developers of aMSN), mail applications, etc...

Even worse, Linux users don't have any quality nor production ready applications.
CAD applications are totally missing.
Games have less quality graphics than the majority of free games that I can get on my Android phone. Don't go on the "games don't need to have quality graphics to be good" as that argument applies only to puzzle and some platforms games. And even so, gamers don't play those type of games! They want good looking FPS or racing games or... You get my point.
Graphics applications are useless for professionals. There are GIMP and Krita, maybe a few other ones, but they just suck for everything else than resizing images and applying a few filters. They aren't alternatives for Photoshop and Dreamweaver.
The same happens with video editors. There are a few open source projects that are trying it hard, but they won't let you do anything further than applying nice transitions between clips/photos, and applying filter to clips. Have you used Pinnacle or Premiere?
Music editors? That area is so empty that makes me laugh every time I think about it.

I won't go into the discussion about why is that happening or why companies aren't porting their products to Linux as that's a hole other topic.

So, the results are:

  • Pro's for switching to Linux: free and safe.
  • Con's for switching to Linux: difficult and useless.

The fact is that Linux has a small market share because it's difficult and because it lacks some very important applications. Deal with it.

January 14, 2012

Javascript and it's tricks

I love coding in Python, C++, Java and a few other languages, and I love it because of the challenge of using every language's little dirty tricks. For example, I love how Python decorators and lambda functions work and I love how Java Reflections work, just to mention some of them, and how many possibilities (scary bugs and low performance too :p)  bring us those kind of functions. But the one thing that I most love about all those languages is that they are used for desktop applications.
Desktop development is what I love the most. But I'm forced (read as "that's the job I have") to code in PHP + Javascript. Don't get me wrong, those languages are fine too (better than the language that co-workers used before I got here: ASP .Net...) and they sure have their special things, but it's just that I hate web-development.

Anyway, as I'm forced to do PHP + Javascript on a daily basis, and I got tired of trying to make stuff work as I expect them to work in all browsers, I made a little set of Javascript scripts. Nothing as powerful as jQuery or MooTools, but something that, in combination with those frameworks, makes my life easier.

Basically, those scripts check if the browser they run on has certain methods, and if not, they add it via prototype.
Every object constructor exposes a special property called “prototype.” That property allows you to add properties (and methods) to all objects instantiated from that constructor function.
Means, for example, the String type of data has some methods, like .substring() or .trim()... The "prototype" property gives us the ability to check if a method of String exists, and if doesn't, create our own. So that's what my scripts do.

There are some pretty cool functions for strings, numbers, dates, arrays and functions itself.

If you're interested in Javascript or you work with Javascript, have a quick look: JniftilitieS

Oh, just one more thing: Yes, I do know about the existence of IE7, IE8 and IE9 compatibility scripts. Mine are a little bit different, as they also add customized functions, like String.capitalizeAllWords() or String.toInt()...

January 7, 2012

Piracy and anti-piracy laws

Every single day I read news about piracy, anti-piracy laws like SOPA, all kind of opinions about both things, etc... And I'd really like to write my point of view about that.

I don't want this post to sound just like one more opinion, like the opinions that can be said in one phrase, in a random forum, or in a comment on a random blog, or in a tweet. I don't want you to think that this post can be resumed as "piracy is bad" or "piracy is good". I want you to understand why do people pirate things, and why do people create anti-piracy laws. I want you to see the reasons of those two different behaviours.

This is a really hard-to-discuss topic, as both parts have good and valid reasons for doing what they do, and that's why I'm going to ask you to stop reading this post right now if you don't want to hear a single word about any ideas that don't match yours about how the Internet should work. If you don't respect other ideas, no matter how valid they are, then this post is just not for you, and reading it will waste your time.

I'd like to start with the definition of a few words that are loosing their real mean because of bad use when talking about this subject. Those words are "share", "piracy", "freedom" and "protect".

Share - Allow someone to use or enjoy something that one possesses.
PiracyThe unauthorized use or reproduction of copyrighted or patented material.
FreedomThe capacity to exercise choice; free will.
ProtectTo keep from being damaged, attacked, stolen, or injured.

That said, let's see what do people understand by "sharing". According to a lot of blogs, tweets, forums, irc channels, Youtube videos, etc... "sharing" means:
I can share that song with a friend of mine, and that's OK, as it's exactly the same as sharing with him my console, so he can have some fun for a few days. I'm free to do both things because I have Internet freedom.
Note: I said "song", but you can replace it with "movie", "game", "software" or whatever other thing you'd like.

That seems valid. I'm free to share my possesses whit whoever I want. I bought each one of my possesses and I own them, so I can do whatever I want with them.

Then those same sources of information go further:
Sharing makes the community as a hole progress faster, as everyone has access to the culture in general. Also, sharing/copying doesn't cost anything at all so everyone wins. And copying is not stealing as stealing means taking from the one who possesses without giving it back and copying is just making a copy.
That sounds like a valid logic too. I'm not hurting anybody when I do a copy of something, and I'm actually not stealing it.

Both the first and the second quote are valid! And you're sure about it. Because they are... or maybe not... Are they?

No. At least not 100%.

Why aren't they valid? Let me try to explain it.

You're really free to share your console and your games with your friend, but after a few weeks you want to get your console back, right? So, you call your friend and ask him for it. When he returns it to you, he won't be having it anymore and he won't be enjoying it anymore. He didn't paid for the games nor for the console, but he enjoyed them for a while, because you shared those with him.
All that time there was only one physical console and only one physical copy of the games. The possessions that you got from a store, paying for them.

What happens when you share a song with a friend? Why that kind of sharing isn't the same kind of sharing?

Because you shared something that can actually be copied. And exactly here, my dear reader, is where things get tricky. The song you shared has some digital rights. Means that the singer that made that song protected it, as in not letting you play it without paying for it. I see that fair enough. He made something and he deserves to gain something from it. If he wanted to make the community progress faster, he wouldn't have protected it in the first place.

And, on the other hand, sharing/copying actually does hurt someone. It really does.
Think about it that way: The singer who made the song had to pay a studio for helping him with the record process, he had to pay for the discs/covers, he had to pay for the ads, he also had to pay a lot more stuff. If it wasn't wrong sharing and/or copying his song(s), he would actually receive money only from the very first buyer, as that very first buyer would be free to share and/or copy the song with everybody else. But as I said, the singer protected the song with digital rights. If nobody respected that, the singer from the example won't get anything from all his work, and then he'd be forced to do something else. Now apply that same case to every single musician and you'll end up in a world without music.
Apply this example to every single games company, to every single books editor, to every single software developer, and you'll end up with nothing. And at that point, the community won't progress any further, as there won't be anything.

Yes, that really sounds too apocalyptic, and it won't happen at all, but I wan't you to see how a world will work/end up if nobody respected what you think/thought it's legal, and that are copyright laws.

If you're still reading you'd be thinking that I'm a die-hard-copyright-laws-defensor.
Actually I'm not. I'm against most copyright laws as I consider them too restrictive, too abusive and/or too helpless to actually protect the possessions they were/are made to protect.

We all know what projects like SOPA or ACTA are trying to do. We all know what most copyright laws prohibit us to do. And we all know that those laws aren't working. I guess you already have an opinion about how unfair those laws are, or how stupid those laws are, or... Let's see some of them.

  • There are laws (maybe non-existent in your country, but I assure you they exist in some countries) that make copying illegal. And by copying I mean backing up in case of accidental erase, disc failure or any other accident. Those laws literally take away your freedom. A freedom that you must have. You should be allowed to make a private copy of something that you already paid for. Not sharing it but having it, just in case. For example, why I'm not allowed to have a backup of a game that I paid for? What if my physical disc breaks or gets unreadable by my PC/console?
  • There are laws preventing you to hack your possessions (jailbreak, unlock, crack...). Those laws also take away your freedom. A law can't prohibit you to do whatever you like with a possession of yours. At least if you're not doing so wanting to use it for enjoying unauthorized (read as protected) content. Let's get back to the last example. I have a physical backup of a game I bought. I should be able to jailbreak my console in order to be able to play it. In the same way I should be able to backup my songs so I can play them in my mp3 player, or backup my movies so I can watch them in my widescreen phone.
  • There are laws that try to make you, as a user of certain products, pay for them for each N times of use in the same place/time/machine. (Windows licenses for example). 
  • There are also all those copyright protect methods, as DRM, rootkits, self-brick systems, etc... that are even useless than the copyright laws.

There are certainly a lot more laws/methods that I won't list here, but that, as I said, we already know.
Anyway, writing about how useless laws are, or how unfair they are, or how good/bad piracy is easy. What about writing what causes them? What about some actual solutions?

What causes piracy?

Piracy, read as downloading other people's backups and using/sharing them without the permission of the author, is mainly caused by the too-elevated prices. Let's be honest, nobody wants to pay 20$ for a music CD if there are only 2 songs that are worth it. Nobody wants to pay 70$ for a game, when that game has a less tan 10 hours playable history. Nobody wants to pay an excessive price for something.

What causes all those useless laws?

Mainly people with more power than they should have, and less knowledge than they should, trying to protect their products, instead of adapting themselves to the Internet and the new market.

What is/are the solution(s)?

That is really not a simple answer. It's a hole mix of more affordable prices, less restrictive laws, less protection systems causing damages or spying, etc... I don't have the exact answer. But what I do have is the certainty that making more copyright laws and more copyright protection systems won't be the solution that neither side wants/searches.

Thank you for reading!

PS: Just in case you're thinking in writing a comment about how much I don't understand the concept of "free" and "share", I'd like to let you know that I probably spent 10000x more time than you helping the community with both code and help/support. And I did it for free, without expecting anything in exchange.