Browse by Tags
All Tags »
coding (RSS)
As a new hire, you will mess up. But don’t sweat it, it's to be expected. You will learn more from a mistaked because you will be forced to find a solution when someone points it out. Indeed your success as a new hire isn’t a question of how few mistakes
Read More...
Which piece of code is not only reasier to read, but more efficient? Example 1: const int size = 10; bool FindValue( int value ) { int arr[size][ size]; Load(arr); bool fFound = false ; if ( value != 0 ) // Must have value greater than 0 { value--; if
Read More...
Anyone else code to video game music? OCRemix.org is one of my favorite sources of free “coding” tunes. And who doesn’t get pumped to the cowbell at the end of the Half-Life 2 credits music?
Read More...
At the college you are attending or attended, was the focus on a native language (C, C++) or a managed language (Java, C#)? The first real language I learned was C++ and later when I had to take a class in Java, I thought it was very easy. However, I
Read More...
Really, take your best shot: value += ((LPWORD)&((WORD *)data)[1])[i]; It’s not all that complicated, it’s not intentionally deceptive, but it is confusing. Such is life while working on a large project that you didn’t write. You will have to interpret
Read More...
Many people take C++ as the end all be all of languages. And why not? It supports many different paradigms of programming at once: functional, object oriented, templated, metaprogramming, assembly and probably more. But what doesn’t it support? I don’t
Read More...
Not many people responded to last week's puzzle , so I'm going to leave it open for another week. In the mean time, take a crack at this. Here's something many of us would have written in college. Take a look at the code and see if you can spot what's
Read More...
My apartment is a mess. After a party on Saturday there are glasses, pizza boxes, dirty dishes, empty bottles and bottle caps scattered in every corner of my place. Some might ask: “Why don’t you just clean it?” Well, I’m a procrastinator. As long as
Read More...
Take a look at this piece of code: if( length + 4 < length ) return ; Algebraically, it's always false. "A number plus 1 can never be less than the number itself, that's a fundamental property of addition!" Computers, however, are not perfect mathematical
Read More...
Say the following question was on a Computer Science exam: Are you an Engineer or a Scientist? Explain. What would you put? I'll give you a bit of hint by your answer to this question: How much information can you store in linked list? 1. Infinite - Linked
Read More...
I'm sure you want to have a legacy. People will remember you and tell stories about what you did and look back at what code you wrote. Life would be grand, assuming your legacy was good that is. More likely people 10 years down the road will look at your
Read More...
It is important to follow the coding conventions that your team sets. That said it can be an enormous pain to break personal coding habits. Coding styles can be widely varied and you may even have the "pleasure" of working on separate projects at once
Read More...
I wanted to talk a bit more on compilers and why you should be thrilled to work with them. Inlining Here is something I used to do constantly in every program I wrote: #define POW2(x) ((x)*(x)) For starters, look how awkward it is to define. If you don't
Read More...
Who has ever met that guy that insisted on writing every piece of code to be as fast as possible? We'll call him the "speed freak". Thankfully, speed freak is less an influence in languages such as Java or C# because there is no low level access to the
Read More...
We've all been there. Whether it's in C++, C#, Java, ASM, which ever it is the temptation exists. Doing as many things as possible in one line of code instead of dutifully expanding it to it's required three or four lines. A C++ example: *( pData ++)
Read More...