Line Count Improvements: C vs C++

Avatar
written by Robin Luckey
mar 14 2008
 

Lately we've been receiving a lot of patches to Ohcount, the tool we use to count lines of code. This has been really exciting for us, and we're very thankful to the contributors who've been helping us fix bugs and add new languages.

Historically, Ohloh has never distinguished between C and C++. We simply lumped them together and called them "C/C++". This annoyed a lot of people. :-)

A major change that we're adopting today is to (finally) distinguish between C and C++. This is thanks to the efforts of Ciaran McCreesh, who submitted a patch to do this earlier this week.

This change poses something of a challenge for Ohloh: we have literally billions of lines of C and C++ in our system, and it's going to take us a very long time to recount all this code. It doesn't help that our current server farm is already overworked.

This means that for the next few months, you're going to be seeing an increasing amount of "C" and "C++" as separate languages, but you're also going to see a lot of legacy "C/C++" code. These might coexist in the same reports.

I can't predict how long it will take us to recount and sort out all of the existing "C/C++", but I estimate it will take a few months. We are expecting to install more server hardware soon, and that may help speed up the counts.

If you are eager to see your own project recounted, just let us know and I'll be happy to bump you to the front of the queue.

Thanks to everyone for the contributions, and here's to C and C++.

Comments (15) Subscribe to Line Count Improvements: C vs C++

Thanks Robin!

Could you bump this proj: http://www.ohloh.net/projects/11656?p=OffhandWay


Avatar

Giuseppe "Oblomov...

2 months ago

Ok, now I have a problem ... as you guys know, I'm working on literate programming languages. I've implemented Knuth's WEB so far (Pascal + documentation), and I'm now working on CWEB ... which can be used both for C and for C++ files. In fact, the same CWEB source can generate both kind of files. So what should I do? Stick with generic C, reintroduced cncpp for the mixed/unknown flavour, or what?

(Ok, in fact CWEB can even be used with Java but I'm not going to touch that for the time being ...)

Any suggestion (here or as a comment to this ticket welcome


Avatar

Hagen Möbius

2 months ago

Wow. I'd like to see that on my projects :).

http://www.ohloh.net/projects/6065 http://www.ohloh.net/projects/5669

Thanks,

Hagen.


Avatar

Robin Luckey

2 months ago

@MotiveForce -

This project doesn't contain any C! I think you are just asking for a regular update, which is overdue for this project. I've bumped you up.

@Hagen -

No problem. I'll be curious whether the results match what you expect. Let me know if something seems wrong.


Avatar

Hagen Möbius

2 months ago

Yeah, seems to work really good. Project 6065 is a C++ project and I get < 1% for C, which is really good. I believe most of the C lines come from comments now, which is a bit awkward. I have some C++ files (with classes and stuff :)) containing a small comment with a version number. Every time I change that version number I get a C line. :)

But all in all this is most satisfactory, because now you can see whether a project is done with OOP or not.

Thanks a lot for this feature.

Kudos Ciaran McCreesh.

Hagen.


Avatar

gianino

2 months ago

@Hagen: you can't see if a project is OOP or not, you can only see if it is in C or C++. Just for the record...


Avatar

Hagen Möbius

2 months ago

Yeah, OK, you're right. That's a misconception on my side. I am still wondering whether gtk+ is OOP or not. :)


Avatar

Lennart Koopmann

2 months ago

Sounds great! Could you push my project?

http://www.ohloh.net/projects/10919

Seems like only one of my repos has been analyzed the new way.


Avatar

Robin Luckey

about 1 month ago

Hi Lennart,

ScopePort has been updated. Let me know if there are any surprises.


Avatar

Camiel Vanderhoeven

about 1 month ago

Me too please, I'd like to see whether I'm really coding in C++, or just think I am ;-) http://www.ohloh.net/projects/12354


Avatar

Lennart Koopmann

about 1 month ago

Looks very good Robin! 55% C++ / < 1% C. That seems to be correct.


Avatar

Camiel Vanderhoeven

about 1 month ago

Hmm... After the last recount I get 74% C/C++, 1% C++ and <1% C. Are the older files calculated as C/C++, and only the new files as C or C++?


Avatar

Robin Luckey

about 1 month ago

Yes, Ohloh project updates are incremental, so code previously counted as C/C++ will continue to be C/C++ in all new project updates. To get rid of the C/C++ we need to recount the old project history from scratch.

I'll go ahead and schedule a full recount for ES40 Emulator.


Avatar

Ciaran McCreesh

about 1 month ago

Please could you do a full recount for Paludis (8721) as well? I'd like to clear myself from the evil that is C/C++ for good.


Avatar

Robin Luckey

about 1 month ago

Paludis is on the way...