Wednesday, September 22, 2010

Is programming similar to a game?

I have heard people say that programming can be fun. Even, I have said that I enjoy programming. Is it possible to say that programming is similar to a game experience from the perspective of the developers?

In the nature of engineering there are somethings that works like games, for instance:

  • in both there is a goal.
  • in both there is a way to lose, which is meant to be avoided.
  • in both there is a set of possible actions you have to do at each moment, and the correct execution of these leads to the goal.
  • in both there are factors that maybe random.

But that looking at an academic point of view of games, it doesn't tell about how much you can enjoy programming, it just says that it is possible. Programming may be seen as a game, but it may as well be just be a bad game.

Is programming adictive?

Think about how the most addictive games (or may be I should say compulsive games). Those games are not about joy, they are about keep people comming back, no matter if they like doing it.

The mechanics of these games is simple: it's a roulette. It works the same way people gets addicted to casinos, because it give you random rewards with the potential to be big enough to pay for what you have lost. You just can't leave the casino because the next one may be a winner.

Do you hate it if you leave a casino machine just to see that the next person to sit down wins the big prize? Well, you may hate it if that happens. You better stay there until you win. That's the core of the adiction.

¿Example of these games? The industry has learned to do this in a very sutil way, they place monsters in the game, which you may or not kill, but if you kill them, then they will drop money and some other random items. Those random items have value (even if they are virtual) because you took the descision and effort to beat a whole monster to get it! If it's hard to get, you will appreciate it.

Does programming have this characteristic? Well, yes and no. You do not program by pressing "sword button", "sword button", "sword button". But there are some repetitive parts of programming... which you should not be repeating that much.

But you can fight monsters, which are optional in most cases. These monsters are optional because you may as well download something already done. You know, do not reinvent the wheel. These monsters are algorithms and data structures. If you implement a datastructure in a reutilizable way then that implementation has value. It has value because you implemented a whole algoritm! and what takes affort has value. What programming is lacking is the random part, which makes programming less adictive than it's casino counterpart.

Inmersion

Inmersion is a key characteristic of role playing games. That is to become the player a part of the history. This gives to the player the power to change the outcome of the game, and to see and enjoy the effects dynamically.

To have inmersion in a game, you want a game that reacts to the player. A game that behave like it were alive, and also that lets the player change it. These enviroments makes the player feel and become part fo the narrative.

There are two kinds of programming enviroments that exhibit this characteristic:

  • Those with a REPL (Read - Evaluate - Print Loop), such as Python, which have an insterface similar to a terminal that lets you run commands on the fly. It's like the software were growing as you write it.
  • Those like Visual Basic, that let you build software graphically, it enhance the constructive part of us, and supplies the need to leave legacy for comming generations. It's like creating the software from building blocks.

Please allow me to mention, that any language can be of those kinds, because the magic is done at compiler level, in fact, currently C# is both of those two kinds I mention above... in Mono C# have a REPL, and in Visual Studio it has both Form and Class Diagram designers. (In Mono there is a Form designer too).

Cooperation and Competition

Most games have one or the other, to be fair, those games with both are usually better. In competition we learn to defend ourself while reaching a goal, this is one of the objetive of playing in the nature, to teach the new ofprings how to defend themselves. In cooperation we also learn to survive, but from a hard enviroment or some other threat that requires to work as a team.

Beyond the instincts level, Cooperation and Compettion allow us to share emotions with our co-players, that makes stronger links with them, and creates synergy. Combined with Inmersion, this becomes an strong tool for human relationships.

In programming we may have both, Cooperation and Competition. Although Cooperation is what is mostly promoted in the industry, Competition will never disapear. Also Competition in programming as competition in more physical enviroments is becoming a kind of sport. For example there are regular competitions and Internet sites dedicated only to that matter. Fo example TopCoder and Google Code Jam.

Learning

Believe it or not, learning is a crucial part of playing. But not in the old classroom sense. To have things to discover and explore allows us to develop our investigation skills, and also give satisfaction to our never ending curiosity.

As mentioned before, the porpuse of playing is to learn to do things. It's usual that children play with toy versions of things they will be using when adults, such as cars for example. There are some toys that parents give their children to mold their behaviour (even if they do not know what they are doing, new toys mold their behaviour), for example there are toys meant for girls, which resemble what the society expect from girls when they grow up (such as cooking? and... choosing a boyfriend with a car?).

Beyond those impositions, toys have the power to teach in two ways:

  • Constructive: allowing to explore interactions and pruposes of the things
  • Desctructive: allowing to explore internal mechanics by taking that toy apart.

Programming also have that learning component, you can learn on a constructive way, by trial and error. Or in a desctructive way by discepting in open source software, just to see what happens if. Or in a more pasive way, just reading code.

Reputation

It's hard to find something more attractive than status. People have a need to find friends, couples and support by third party, this guaranties to stay alive in the old jungle. Today it's about getting more rewards, and a better car. Status is also atractive for dating, but that's another matter.

The point is that everybody want some level of status, and what is status? status is visibility of those monsters you have killed, so every body knows you are somebody. That you have a name.

Building a reputation in software is usually very hard, the end user doesn't care, bacause for them you are hardly more than the name behind the feature. But between developers the thing is a bit easier. But let's think about this... if I want reputation I should show what I have done, and that means that others may learn from it, and even take it for their profit.

It's a hard decision for many. Do you want to share your source code?

If you do... Will it give you money?

I can asure you that it will give you reputation and you will enjoy it. About money I can't be that sure, but it won't hurt to only reveal somethings and keep others closed from the public.

Conclution

Programming may not have all the components of a game, but it have those needed to allow people to enjoy it. It still lacks some important aspects, like keeping highscores. But it's proven that it's all comunity and developer enviroment magic. It's not about the hardware or the language you choose, but it's the tools and the people that will make the diference between enjoying or hating programming.

Sunday, September 12, 2010

¿What's wrong with Mono?

According to an article written by Richard Matthew Stallman, there is something dangerous in "dependent" in C#.

It may be curious that Stallman do worry about dependence on a particular programming language, because the programming language can be changed to another and get the same software (even identical at the binary level, with some help from the compiler). Still, Stallman says in that article, "The risk" is that Microsoft may want to bring C# implementations under a patent.

In my opinion if something of this were to happen, the least problem would be to change the language to an equivalent. But the truth is that this will not come to pass.

WHY DOES MICROSOFT NOT PATENTING C#?

If we do some memory, remember that .NET is a standard, however, somewhat less well known is that C# is registered to ISO, as a little searching on the Internet you can prove.

Microsoft can not issue that patent because:
  1. Microsoft has put C# under ISO.
  2. Existing implementations of third parties.
  3. They can sue Microsoft for monopoly.
  4. Microsoft likes that there are others implementations of C#, to attract developers to Visual Studio.

Perhaps what worries Stallman is that they does not say "free standard" but "open standard". But Stallman and the Free Software community should understand that there is no such thing as a "free standard" (as in free speech) because if everyone has the right to modify and adapt the standard to his choice then it is not a standard. At best we can say that is a technical recommendation or a suggestion, or a guide.

Perhaps what annoys Stallman is that Debian are using Mono, that Mono is from Novell and that nobody uses DotGNU. Mono is not against the GNU politics or philosophy and Stallman knows that.

Sunday, August 15, 2010

.NET as standard

.NET framework is an open standard developed by Microsoft, its implementation is a set of libraries that contain functions to perform common tasks, so that programmers do not have to retype the repetitive parts of the program. In addition, .NET defines a standard way to communicate between two programs and programming languages called IL and C#.

Between implementations of .NET are Dot/GNU of the GNU project, Mono Framework of Novell (Owners of the distribution SUSE Linux) and .NET Framework from Microsoft. All three share the same basic structure, libraries and the same language equivalent. So that most programs to write for one of these implementations. NET will run in the other.

Despite being registered with an open standard ECMA and ISO, there are differences in implementations mainly because Microsoft has the lead in development and implementations Mono and Dot/GNU are lagging behind. On the other hand that Microsoft's implementation only works on Windows systems, while Dot/GNU focuses on systems derived from UNIX and Mono is intended to function on multiple platforms.

It is worth noting the similarity level architecture that .NET Mycrosistems and Sun Java have, with the difference that the latter is not an open standard. Also note that Microsoft and Mono have developed a tool for interactive applications, which competes with Adobe Flash. This tool is called SilverLight in the world of Microsoft and MoonLight in Mono.

Finally, .NET is the foundation of the Web development platform ASP.NET, direct competition from PHP and JSP. Likewise .NET is the framework for XBOX and XBOX 360 systems from Microsoft.

Sunday, August 8, 2010

What you get may differ form what you see

From the very first entry of this blog, I started having issues with the formating of itself. I'm using a editor that is embedded in the web, that editor also claims that "what you see is what you get". But in the practice what I get is a lot of empty "span" HTML tags, and similar stuff, for example the paragraphs are done using the HTML tag "div" instead of "p".

¡And I don't like it!

As I know my HTML ancient arts, I would prefer to have more control over what I will be posting, but then again I would like to do not have to think about it when I am writing. So I decided to write my HTML apart in a desktop software. I started using Geany, because it's what I use for web development (when I'm not on Visual Studio), and that's how I wrote my first article.

¡But it's not quite the same!

I have discovered that this blog preserves the new lines that I had in HTML, the result is that I had some lines where I didn't expect them. I may start searching for a software that does my posting with a better formatting.

In the meanwhile, I'll forget about the "span" atrocities, and just keep going on my writing of this blog.

Edit: So far I've fixed the format, I'm only using HTML to write posts, and telling blogger to do not insert new lines. Also always remember to use "p" in my HTML.

Saturday, August 7, 2010

English & Spanish, new tags on birth

I have to face this issue: having content that may present problems to translate to Spanish. As I've said in another post, I'm from Colombia, so I want to keep a good translation to Spanish. In order to do so, my first step is to review the translation that Google does for this Blog. After I've decided that the translation is Ok, I'll post the translated version to C# porque no sé ++.

This have a drawback. It may happen that the translation get delayed, so for those interested in the lastest topics, there is a translation box. On the right, below the search box. in there you can select "Español" to view this Blog in Spanish. I'm making sure that all the translations that Google provides for this Blog are accurate and that will never change the meaning of the text I have in it.

But now, let's suppose that I would like to share a few videos from another source... for example, but the videos are not easy to translate from English to Spanish (or vice-versa), It's also time consuming to provide close caption or another similar technology (I would probably better do that, you can blame by choosing to do not do that). And since I'm from Colombia I expect to have certain level of visitor that speak Spanish, and the odds are that there will be people that may be not so good in English too. The videos are going to be a problem, since I can have them in English or in Spanish.

So... for those, there is always the option to learn English, be it with a movie, a book, video games, or with a teacher. Though I'm not English teacher, I can find a few books to learn English from internet.

¡But I still want to post the videos! (and other language specific stuff).

Edit: All that stuff will be posted to C# porque no sé ++, if I can't provided a decent translation to English, I'll add the tag "Spanish" to the article when I post it in this blog. Also, if I post something here that I can't properly translate to spanish to add it to C# porque no sé ++ then that post will have the tag "English".

Friday, August 6, 2010

Code and Google

I'm having the next issue: I've been trying to write a "hello world" example for "C#" in the blog. But when I translate it to Spanish... the code is also translated, so far I have found these options:

  1. Post the code as an image, so it can't be translated.
  2. Post the code inside an iframe, so it won't get translated.
  3. Post the examples twice, one for English, and one for Spanish.

My issue for the first one is that the code cannot be copied, and I want the code to be copied by my readers (in the thinking that I will have readers). So the second may be preferable... but it means to host the code somewhere else. About the third one... I want to write once. You know, to reuse and stuff.

Edit: I have decided to write a blog dedicated to readers that have Spanish as their natural language. You can find it here: C# porque no sé ++

New blog

Hello, this is my new blog "C# dash & slash".


But, ¿who I am?

cl My name is Alfonso Ramos and I'm a independent Software developer and... new writer of blogs?

I'm writing a blog because of three big factors:

  1. the first one is that mail is a mess, I've often found myself writing or reading a lot on my mail account that simply a blog would make things easier.
  2. Second is that I wish to share some knowledge with ECMA-334 (I mean C#) and ECMA-335 (I mean (dot).NET-Framework, also Mono).
  3. And third, because it's an opportunity to have a -bigger- name in Internet.

So, this brings a few obvious questions to the table:


¿What will I be blogging about?

I will be writing about, the things people write to me about, the things I do with computers (some projects and so), and what is happening in the Industry that affects me. and why not a few jokes if they come handy.


¿Why would you read my blog?

I don't know, that's up to you, I will not make any promises, neither give incentives whatsoever to come and read my ramblings and crazy stuff. But, then again... ¿Why not? if you have some time to spend (I know you have since you are reading this already) the odds are that you may find something interesting to read here, if not, well, that's ok too.


¿How can you contact me?

Via mail, the old system still works, so you can use it, find how to mail me from my profile. Still I'll do my best to avoid the need to force people to mail me (you know, this is a blog so you leave comments and stuff). About that, I'll be a "optimistic moderator" about messages, all messages are in by default but I reserve the right to delete any messages I find harmful or troublesome. This is opposed to pessimistic moderation, which is when you do not let any message in until is reviewed. I'll probably switch to that at some point in the future if this blog doesn't go too well. So, if you feel like telling me something please comment when possible, otherwise there is always the "old way" e-mail.

Edit: I've added a new contact section to this blog, look for it at the top menu.


My own faults

I have a few faults on my self about writing, this is the basic list:
  1. I give too few links. That is, there are a lot of pages I may be referencing in this blog, but I'm not doing it because I forgot about it, or I'm just lazy.
  2. I write a lot, if you let me. And you are leaving me. It may be trouble, then again it can be fixed easy by splitting what I write here in more than one post.

Edit: This is the english version of the Blog "C# porque no sé ++". I have writen that blog in Spanish. If you are a Spanish speaker I recommend you to visit it.

Now, if you find me committing any of the above sins, let me know. I try to fix the post or add new post to cover the problem. ¿How to? Try leaving comments in the post, or if that doesn't work go to use e-mail, get my e-mail information from my profile.

The birth of the "blog" tag

This is the birth of the tag called "Blog", it's intended to be used on all the articules that describe info about the blog itself, and also all the articules that talk about my experience writing this blog, or articles that have a special function but are not oriented to the content -except the births of tags-

"C#" are ".NET" are tags births as twins!

This is a double birth, my first article oriented to content, is related to "C#", and ".NET", so I will give birth to both tags at the same time.

Now, the tag called "C#" will go to all that have any relation to the language, how to write something in "C#", examples and that kind of stuff, I'm open to write a lot of that in relative to that language in the near future.

Also, the tag called ".NET" will go for all that related to ".NET" this will include the part of Mono that's an implementation of ECMA-335. I think I will give birth to the "Mono" tag to all the articles that are specific to the progress of the Mono project... but that's another tale, that must be told in another moment.

The birth of the "HTML" tag

Today we are here not to hold sorrow, but to celebrate the birth of the more ambiguous of all tags! the "HTML" tag!

This is a tag to be set to the articles, not a tag of "HTML"... OK, that may be confusing, what I'm saying is that I will set "HTML" as a tag to all the articles that are related to HTML, makes sense? Good!

Tag birth

At the first time I set a new tag to an article, the plan is to describe what will fit in that tag. In order to do so, I will write an article of "tag birth". So, to start the metodology of tag births, this is the tag birth of "TagBirth".

Under the TagBirth, I will set all the articles that are of "tag birth", from now on. Also a rule will be that all articles of "tag birth" will have the tag that has been born.