Month: January 2023

Is Tiobe Index misinformation?

Is Tiobe Index misinformation?

news, false, conceptEvery month a new Tiobe Index is published purporting to show the most popular programming languages. Except, if you look at other programming language popularity surveys, lists etc, the Tiobe Index increasingly seems to be at odds with everybody else.

Take the programming language C. As you can imagine I have a particular interest in it. I was at first delighted when I saw it at #3 in the Tiobe Index. In fact, in their most recent index it is listed as the 2nd most popular programming language. Well that is just crazy. No matter how much I might want it, there is no way on Earth that it is the 2nd most popular programming language.

It’s not just me saying it. Let’s look at who else says it.

SiteC's RankingComments
Tiobe Index2Updated monthly
GitHub Octoverse Programming languages9Annually- this is October 2022
Reddit Programming languages10Subreddits for programming languages
Red Monk Programming Language Rankings10June 2022. Updated every 6 months
StackOverflow developer survey11Annually
Statista most used programming languages 202211
Hackerrank Developer skills report 202312

There are other programming language lists or surveys but those show what I mean.  No one else has C anywhere that high. Here it’s in positions 9-12 with an average roughly around 10.5 if you exclude Tiobe or 9.3 if you don’t.  I think their methodology is flawed and biased by age. Older languages appear to carry more weight.

Never mind C, what about JavaScript? Everyone else has it in first place (except HackerRank who has it in 4th). Tiobe index has it in 7th. Misinformation is defined as “false information that is spread, regardless of intent to mislead.”. Maybe that’s a bit harsh but that’s how I regard the Tiobe Index.

Nice to see an article favouring C

Nice to see an article favouring C

brown wooden letter c decorToptal.com is a site for recruiting freelances for projects. They have published an article by a developer Daniel Munoz which praises C and shows how it is still quite relevant today. It’s definitely worth a read.

Given the pressure today to move to Rust, Go and even Kotlin, it’s nice to see someone praising C.  Of course for the games I do C is near perfect.

Posted in C
How to debug programs using SDL

How to debug programs using SDL

Terminal fprintf outputThere’s nothing worse than a program halting with a simple “Segmentation fault” and no idea where or why. It happened to me today working on the 2nd eBook (for Raspberry Pi) and I had to figure out where it was going wrong.

In the end it was a really silly bug, I was trying to load masks but had left the masks/ folder out of the filename.

How did I find it? I sprinkled a few fprintf(stderr,”message”); throughout the program changing “message” to something appropriate and launched it from a terminal. I’d thought it was in a function LoadTextures() so added a call before and after but you can see that worked and the segmentation fault happened after LoadTextures().

So I added it before and after LoadMasks() and my second run it happened before it reached the After LoadMasks message.

Note, I used stderr as the output path because, unlike stdout which is buffered and can be cleared, anything sent to stderr appears immediately.  More about this in this offsite article.

The using SDL part of the title is just to show that you can find bugs even in programs that use SDL.