Archive

Archive for the ‘General’ Category

10 reasons you should know C++

May 20th, 2009

First of all, as I know that this can be a sensible topic for someones and that it can turn to a religious war, I want to remark that I’m only saying that, for a programmer, to know C++ is a good thing to do, and I am NOT saying neither of this:

  • That C++ is the best language around, as that concept does not exist.
  • That you should use it every time you have to program something. The language to choose for a project depends, of course, on the project itself.
  • That it is the only language you should know. It is not.

Here comes the list. There are some reasons more focused at the knowledge you can get, and others more focused at work and employment issues.

1. C++ has influences in many other current languages

When other currently most used languages, such as Java or C# appeared, C++ had already been here for a while, and, as one of their goals was to substitute C++, is no surprise that they have been highly influenced by it. So, learning C++ you will learn an important subset of many other languages, making you easier to learn them later if you ever need to.

2. Huge amounts of documentation for it

As, probably, the most used language in the last 20-25 years, there are tons of resources oriented at it. Books, forums, blogs, you will find virtually any kind of help you may dream of.

3. Many code samples are coded in C++

Whenever someone, including book authors, need to write some code and the audience is not expected to share any other language, he will usually implement that code in C++. So, as in many cases you are actually expected to understand it, it would be good for you to really understand it well, in order to learn more from the source you are reading/listening.

4. It will provide you a better understanding of other systems

Some people criticizes C++ as difficult for explicitly dealing with low-level things as pointers or explicit memory management. While it’s true that in some circumstances you would get no benefit in dealing with them, and it’s then more a source of bugs than anything else, it’s also true that having a sincere, deep understanding of them will make you a better programmer, and you will have a wider comprehension of the system, even when programming on some language that abstracts those concepts.

5. Templates & generic programming

C++ provides you the possibility of programming functions not taking into account the types of some variables or some of the arguments. This opened the possibility of truly algorithmics, and has been used in many other languages since then.

6. Interfacing languages

There are lots of different libraries, and many of them are in C++. If you program in any other language, chances are that some day you will have to interface some library, and it will probably be in C++, so you’ll have to interface it, and knowing C++ will save you time.

7. Efficient machine code produced by C++ compilers

C++ has had efficiency as an objective from the start, and, while the gap has diminished in recent years, C++ compilers are still the ones producing most efficient machine code. You may find yourself in the need of writing some part of code where you must control things that higher level languages do not allow you. Knowing C++ could help you then.

8. There will always (or, at least, for a very long time) be a niche for C++

It’s true that the C++ ratio usage has diminished in the last, say, 10 years. That’s mostly because it was used for applications that did not really needed a lot of control and performance. But almost all of those applications are no longer written in C++ any more. Most of the projects being currently developed in C++ do actually have time or space constraints, and they use a C++ for a reason. Systems programming, simulations, game programming and some others are niches that are not going to switch to another language for a long while.

9. C++ projects are more interesting than the average

As pointed out by Alastair Rankine in a post which I agree with, C++ projects are over-represented in the set of interesting projects and under-represented in the rest of profitable projects. All other things being equal, working on an interesting project instead of non-interesting one is a great change.

10. You will hardly be seen as a hacker if you don’t know C++

This is very important if looking for a new job. Companies (intelligent ones, at least), when looking for programmers, prefer hackers, people with passion for programming. This, again, happens most on interesting projects, which are usually harder too. Knowing C++ you will not be immediately seen as a hacker, but the inverse applies here. There are few hackers that don’t know C++, and your reputation as a programmer will be lower if you don’t know it.

General , ,

Knowing your level

April 18th, 2009

Let’s face it: we’re not all the best programmer in Earth.

And let’s say more: we’re not all above the median. Only half of us is. That means that half of us is below the median as programmers.

All of us (at least those of you reading a programming blog) want to improve as programmers. The first thing to do to improve is to be aware that you have to improve. This can seem obvious, but as the Dunning-Kruger effect states

“ignorance more frequently begets confidence than does knowledge”

competent people is usually more aware of their lack of knowledge areas than incompetent people.

The second thing is to know is where do you have to improve, which are your best skills and which ones you should train more. This, of course, depends greatly in the specific area of programming you are interested in and in your objectives and priorities.

Taking that into account, I have found a resource that has been helpful to me and that I think that can be helpful to many of you too. It’s the Programmers Competency Matrix. It’s not completely exhaustive and doesn’t includes some specific areas, as well as some points are a bit ambiguous and others require being very honest about oneself, but it can guide you to know what to improve, as well as knowing other programmers’ level.

Remember that in the long term is not as important how much do you know as how fast do you learn new things. So, I hope that you find it interesting and useful in order of being a better and more balanced programmer.

General

Wheel of reincarnation

April 15th, 2009

The term “wheel of reincarnation” was first coined in a paper by T.H. Myer and I.E. Sutherland named “On the Design of Display Processors”, and refers to the cycle, completed many times in computer history, of migrating some kind of work to special designed hardware in order to gain speed and liberating the CPU for other tasks, then this hardware becoming of more and more general purpose and powerful, and finally integrating it again into the CPU to simplify the architecture.

Let’s have now a brief look at 3d graphic cards history.

The first 3D graphic cards started in the early and mid-90’s and were only rasterizers, leaving all other tasks in the CPU. Later, in the late-90’s, the Transform and Lighting stage went to the graphic card too, allowing for greater detail scenes and to do more work on the CPU.

In the early-2000’s, they did a great step towards generalization, with the appearance of shaders (small programs executed for every vertex, every fragment or , more recently, for every primitive to be rendered). Shaders had to be very simple at first, with a very limited number of instructions, with lack of branching and other limitations, but over the years those limitations have been relaxing or disappearing.

The graphic cards, at that point already named “GPUs”, were specialized in the processing of floating point numbers, and so programmers solving numeric problems of this kind started to use them, and GPGPU (General Purpose Computing on Graphical Processing Units) was an expanding field.

As more kind of programmers were attracted to use GPUs to solve their problems, so were GPU companies to offer them more attractive technologies, and special languages to allow generic computations on the GPU started to appear, such as NVidia’s CUDA or OpenCL.

Now, with Intel’s GPU project, Larrabee, which is based in x86 processors, the difference between the CPU and hardware processing graphics will be reduced again, and the wheel of reincarnation in the graphic cards field is one step nearer to be completed.

Will it be finally closed? I think so. When? We will probably have to wait many years before getting enough powerful CPU as to host the usual computations of high-demanding applications such as last generation games and at the same time process their graphics rendering, which will be for sure way more advanced and complex than what it is currently.

Architecture, General, Graphics , , , , , , ,

Hello world!

April 4th, 2009

Hello world! When I saw the initial post that Wordpress sets as default when you install it, I thought that I could not think of a better title for the Unknown Programmer’s blog first post.

First of all, I would like to say that I’m not a guru programmer, I consider myself right now an average programmer who tries to learn something new every single day, in order to be every month better than the month before, and every year better than the year before. If I write is not to show my knowledge but to show myself what I really know and what not, to force myself to learn some details that I could have missed, and last but not least, to try to be helpful and useful to other unknown programmers as me, and (unlikely) to some known ones.

I would also like you to note that English is not my native language and apologize for the errors that I could do. However, I think that my level is enough to communicate my ideas, and I hope to improve my english expression skills through the development of this blog. If you see something not correctly written, or bad explained, I would really appreciate your comments on that.

Finally, I would like to explain a little bit what are we going to talk about in this blog. The topics I like most are algorithmics in general, object oriented programming, graphics and game programming, optimization techniques and psychology applied to software development (both in the development team and in the client side), which is usually ignored but really important for the development of our careers. We’ll also review and recommend books and other webs or blogs, or review some programming tools.

The programming language I use most is C++, and so this will be what I would mostly use when showing code, but I will try not to make the blog language specific. Other languages such as Python or shader languages may be used as well sometimes.

So, welcome to the Unknown Programmer’s blog and I hope that you enjoy reading it as much as I will try to while writing it!

General ,