Friday, April 15, 2011

Introduction to Engineering

Engineering is the human activity that deals with the application of technology. Personally I like to say that engineering is "reverse science. " This will explain later.

Engineering is about making, designing, creating. The focus of engineering is to apply knowledge to turn a situation in another situation better. So engineering is to get from point A to point B. Where A is the current status and B is a future situation where we met our goals.

What do we mean by a better situation?

A better situation is one where we have more comfort, more quality of life, that is where we make less effort to satisfy our need. Therefore engineering pays close attention to the objectives that have to do to satisfy need.

The goals are a hierarchy. Project should have a single root goal. This is usually called general goal. This in turn subdivided into specific objectives, which may be related to a need or not. When a goal is associated with a specific need is subdivided into a kind of objectives to which we will call requirements.

When you run a engineering project, it is important to distinguish which goals are requirements and which not. From this initial classification is triggered the whole process of engineering.

Once we have identified and requirements related to a need, we also know that person belongs to every need. Any person that is going to meet a need by the project will call involved.

It is advisable to consider that while the project meets need also create new need. For example if the project creates a product, it also creates the need for technical support on this product, training to use the product, and possibly change management needed to create new versions. These need are also included in the project so that it also can satisfy those needs.

Thursday, April 14, 2011

Proyect types

The classification of projects presented here is intended to discriminate between projects according to their power, in a way that is practical and easy to understand focused on college students. I do not pretend to compete with the standards, methodologies or organizations that have something to say on the classification of projects, but provide a very natural point of view that has been poorly documented in the past.

Project types according to their scope

For this classification will take into account the type of interaction with the environment, and the purpose of carrying out the project. Many times this is not clear for the college student who has been assigned a project, because this student can feel that the only purpose is to please the tutors and teachers.

But there are some things we can say the purpose of projects:

  • All projects allow to learn something.
  • All projects satisfy needs.
  • All projects have a result, this result may be tangible or not.

It is appropriate to ask for these items when starting a project: What can I learn from this project?, What needs can I satisfy with this project? and What result will have this project?. The answers to these questions will give us the Goals of the project.

The classification presented below should be done based on the response to the third question above. This means that this classification should be done based the expected result of the project.

  • Research Project: The expected outcome of the project is information and knowledge. What we hope to get is: a set of data organized and significant for those involved in the project.
  • Development Project: The expected outcome of the project is a design. What we hope to get is: a map, diagram, structure, or plans to run a task, for example to build an asset (Deployment project).
  • Deployment Project: The expected outcome of the project is: value. What we hope to get is: a resource, directly or indirectly. It may be that the project will culminate in the construction of an asset, or to acquire or conserve a resource.

    The following are specific cases of the deployment project:

    • Demonstration Project: The expected outcome of the project is: attention, motivation and reputation. What we hope to get is: the interest of one or more persons in the services that we offer. Is a project of small-scale implementation can demonstrate the capabilities of who runs it.
    • Marketing Project: The expected outcome of the project is: money. What we hope to get is: the sale of the services we offer. It is a project of implementing a sales strategy.
    • Implementation Project: The expected outcome of the project is: equipment. What we hope to obtain is a set of functional tools and trained personnel.

When you are producing an intangible is common to find that the deployment project includes the design project. But for most tangible products of these two projects are separate. This is due to the need to create more of a tangible product to meet your demand, so many tangible products are made ​​from the result of the design project.

The possibility that the projects belong to more than one type may lead to think that all the projects belong to all types. You really have to say that to create a product we carry out projects of all types: Research, Development, Deployment. But that does not mean that it is always necessary to achieve them all.

As mentioned earlier, many deployment projects are made ​​from the result of a single design project. Similarly for the design requires a preliminary investigation. But may not be necessary to repeat the research project to get it every time.

At the same time a research project may require one or more deployment project to create models, tools or experimental situations. That does not mean they are necessary every time.

This confusion is evident when a teacher requires the characteristics of the three types of project in the projects assigned to students. For example, the teacher assigned students a project to make the model of a building. This seems to be a deployment project only. But the teacher also requires a methodology of research, such as survey, interview or observation. In response, the student can not understand why a survey to produce a model of a building. This is maximized by the project templates found on the Internet, which emphasize research projects.

Programming Levels

As I mentioned in the article Introduction to programming, programming languages ​​must be translated into machine language so the computer can interpret and execute. However, there are variations between machine language and these variations should be taken into account in the first programming languages ​​that were developed. This set of programming languages ​​implies that the programmer (the person writing the program) knows characteristics of the computer for which he or she write the program. These languages ​​are called of low-level, because they have a strict equivalence with the machine language.

On the other hand there are high-level languages, which allow us to write programs independently of the machine to be executed. Finally mixed languages ​​are those that allow us to ignore the details and in the high-level languages​​, but if we can take control of these details and in the low-level languages​​.

An example of a low-level language is Assembler, an example of a high-level language is C#, and finally C++ is a typical mixed language.

Interpretation Form

There are two ways that a computer can understand a programming language:

  1. The first is through a full translation of the programming language into machine language specific to the machine, we will call this technique native code. When using native code there is no guarantee that the program when copied to another computer will still work. But we get the best performance on machines where it works.
  2. After the native code, the next option is using an auxiliary program that translates programming language or other intermediate language to machine language in real time while running, this has the disadvantage of being slower than native code. But this technique can transport the program to other platforms without major complications (says the program is portable to other platforms, or just portable).

    In the latter technique there are two variants:

    1. In the first variant, the program is in the original language it was written and is not verified if it is correct until it is executed, this is called interpreted code, which is evident as it is unsafe because there is no guarantee program integrity (assurance that has not been damaged).
    2. The second alternative is to translate the programming language to an intermediate language that is more easily translated into machine language, this means also to verify if the program is correct before you start to run. In this way the program runs faster and more securely than interpreted code, this will call managed code. Managed code ensures the integrity of the program, however it is possible that even the intermediate language is high level and therefore need another iteration of translation. This second translation is generally performed because the integrity of the program has already been verified, when performing this combination of techniques is still managed code, but if he says it is compiled JIT (Just In Time).

The following are examples of common programming languages ​​compiled to native code: Assembler and C++. On the other side are Java and C# are managed code in most cases, an example of interpreted code (although it might not) is JavaScript. A situation in which JavaScript is not interpreted is the virtual machine V8 using Google Chrome, with this virtual machine JavaScript runs as managed code. There are also tools for compiling languages ​​that are commonly managed code to native code.

Introduction to programming

Computers are machines capable of performing many tasks, are said to be multipurpose and can fulfill the functions of other machines, such as a calculator or a typewriter. However, when the computers are created, they are unable to perform a task by themselves, need a program to follow to accomplish tasks.

The computer programs are like recipes, indicate a number of elements needed to perform the work, followed by a process "of preparation or cooking" and then allow to achieve the desired result. But from a broader perspective, both recipes and computer programs are based on algorithms.

Algorithm Definition

To develop an intuitive definition of algorithm, we can say that an algorithm is the description of the process necessary to perform a task, making it possible to define algorithms for any activity or even for projects taking place in organizations. A formal definition of algorithm would be as follows: An algorithm is a finite and ordered set of steps without ambiguity that perform a particular task.

So to get the computer to complete a new task, it is necessary to give the algorithms for the computer can do it. Now the problem that arises is How to tell the computer what to do. In the early days of computing was necessary to tell the computer what to do every time you need to, at present there is teh concept of stored program, which can be reused as many times as necessary. So that what we should do is write one of these programs stored in our computer so that it can understand it.

Estos programas almacenados hacen parte de aquello que conocemos como software, de hecho, muchas veces nosotros adquirimos software (descargándolo de Internet por ejemplo) para poder utilizar uno o varios programas almacenados que dicho software contiene. Además de estos programas el software contiene otras cosas como documentos o manuales de usuario.

What does the computer understand?

The computer understands a language called machine language, although some computers understand "dialects"or different variants of machine language, there is some level of consistency between the machine language of a computer to another. You have to highlight that as technology advances language machine's computer becomes more rich and extensive. However, the machine language is a coded language so that it is difficult to understand for humans, this limitation makes ineffective any attempt to create a program directly in machine language, except - of course - very short programs and those written by someone skilled in the subject.

For this reason, engineers have developed several computer languages ​​that serve as intermediaries between humans and computers, these languages ​​are easier to understand humans, and then, through a special translator called compiler We translate these languages ​​(also known as programming languages ​​) to machine language so the computer can understand and perform the tasks we have set.

There are many programming languages​​, some obsolete, others have changed over the years have passed. However, the principles on which are based programming languages ​​are the same. One of the most popular programming languages ​​in the world is the language C++, however in this blog, we will focus on the programming language C#.

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.