1. Home
  2. Computing & Technology
  3. C / C++ / C#

Latest Programming Tutorials

About C, C++ and C# brings you the latest programming tutorials, a part work built up week by week. Choose C, C++ or C# or all three.

Latest Programming Tutorials

David's C / C++ / C# Blog

Getting better Pay in IT

Thursday December 10, 2009

In my 28 year career, 6 of the companies I have worked for have gone bust. No I'm not really a jinx, it's just that the IT industry has changed a lot during that time. That means new companies come along and old ones fold in a Darwinian survival of the fittest battle. Names like Digital who grew massively in the 70s but failed to adapt to the PC and were bought by Compaq who were then bought by Hewlett Packard, now known as HP.

Until I reached the age of 40, the longest I stayed in a job was 3 years. In the last ten years I worked at three companies, one of them for 7 years. Unfortunately it's the way of the world that changing jobs is the best way to get bigger pay than promotion within a job. I was never driven by money and so chose to stay in programming jobs rather than move up into management apart from a couple of Team Leader/Senior developer roles that were still mostly development.

Two of the firms had career paths for techy people such as developers but most companies were small and didn't. Big company culture is different to small and you usually have less freedom and responsibility than in a small company but are more likely to get benefits such as training courses, health care etc. I'm not sure there's any more safety in a big firm as the bank holding company I work for had four rounds of redundancy last year but I'm still there...

Scaling Up to Large Number of Users

Tuesday December 8, 2009

I've always (well for fifteen years) been a traditional RDBMS person. Even the largest website I worked on (a property website) had only had at most a few thousand users and SQL Server 6.5 coped admirably with that.

However many websites with millions of users take a different approach, the so called NoSQL Approach which promotes non-relational databases that don't need a fixed schema and usually avoid join operations. Basically these are based on big fast lookup tables with no relational joins. Facebook with Cassandra, Amazon with Dynamo & Google with BigTable are all big site examples of this.

Given that I'm unlikely to run a website which such large numbers, I can live within my comfort zone of relational DBs. However if you are tempted to dip a toe, Redis is an interesting databse server written in Ansi C for Posix systems. It serves up data structures at a very rapid 110,000 SETs/second, 81,000 GETs/second on a normal Linux box but has a quite rich command set (see ) that distinguishes it from being a simple key/value server.

There are bindings for C and the C# version was developed by Miguel De Icaza of Mono fame. If you use PHP as many do (including myself), you'll also find bindings. Of course if you're like me and comfy with a relational DB but want fast performance cheap then you might want rethinkdb, a drop in MySQL storage engine for SSD devices.

How Long is a Piece of String?

Monday December 7, 2009
C strings are easy to use but they are also easy to misuse with Buffer overflows a consequence of not doing full boundary checking. Companies like Microsoft having been disallowing the use of functions like strcpy as part of their SDL (Security Development Lifecycle) for the past five years. I can't stress the importance of this, just take a look at this page to see what can happen.

But applications need string handling and there are a huge variety of replacement string libraries. James Antill is the author of one such library vstr and has compiled a comprehensive list of other libraries that he has compared it against. Whichever library you use, just ask yourself if a user of your applications could be compromised through insecure calls.

More Thinking Outside the Box

Sunday December 6, 2009
Game AI has come a long way from the 80s and computing power has increased several thousand fold. The AI I wrote in assembly language for a simple Empire game was reasonably sophisticated but hardly compares with say AI for a team of soldiers in a 3D shoot-em-up these days. However even learning techniques can sometimes end up with rubbish behavior as witnessed by this video.

Part of the joy of game playing is gaming the AI. In anything but the simplest games, humans always have an advantage over an algorithm; they are just too devious, sneaky and prepared to try different approaches. So a newer approach is to do what animators do. Look at a human's behavior and do the same. Animators capture motion with special camera and tracking devices attached to clothing. Researchers Jeff Orkin and Deb Roy are trying to model a waiter's interaction in a restaurant with a simple game that feeds them data. You can participate and help them.

Challenge 30 First result

Pedro Graca has set a very fast time of just over 10 ms, so that's the time to beat.

Explore C / C++ / C#
About.com Special Features

Holiday Central

What to eat, where to go, fun things to do and how to save money on the perfect gifts. More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

  1. Home
  2. Computing & Technology
  3. C / C++ / C#

©2009 About.com, a part of The New York Times Company.

All rights reserved.