This is a report done on all the projects that make up for the android project, my copy of it is synced as of May 23rd 2010, 6pm
[bash]
——————————————————————————–
Language files blank comment code
——————————————————————————–
XML 4130 26919 62996 3044624
C 7191 494387 685731 2826741
Java 16473 423278 986294 2084883
C++ 5623 349754 385625 1754053
C/C++ Header 12278 300773 653608 1153456
HTML 2325 13539 14681 348935
Bourne Shell 501 45684 46947 317410
Javascript 1717 41901 76306 208012
Assembly 1704 18732 51392 96700
D 2181 16936 24 59142
m4 116 6026 1813 49502
Perl 221 8189 8246 40058
Python 236 9805 14225 38852
make 381 6844 3837 37059
IDL 421 3128 0 24181
Objective C 93 2804 3371 10032
yacc 15 1300 742 9660
CSS 42 1760 617 8566
Teamcenter def 41 631 95 5430
C# 93 863 537 5283
Bourne Again Shell 99 569 1643 3784
lex 21 776 754 3492
Expect 20 105 168 2170
Ada 10 599 560 1681
Ruby 14 393 228 1433
XSLT 8 105 110 1328
XSD 7 182 359 1048
Pascal 4 218 200 985
DOS Batch 34 252 399 911
awk 14 92 198 899
DTD 9 66 42 289
sed 9 32 143 277
Korn Shell 1 39 46 223
Lisp 2 32 5 144
MSBuild scripts 1 1 0 140
NAnt scripts 2 10 0 89
ASP.Net 3 5 0 76
YAML 6 27 42 66
SQL 1 5 0 21
PHP 1 0 0 3
——————————————————————————–
SUM: 56048 1776761 3001984 12141638
——————————————————————————–
[/bash]
Update
It seems like this post got some attention on Reddit, YCombinator news and other sites on monday. I hadn’t noticed until today, so here are some answers to many of the FAQs about the post.
Yes it was done using cloc. Don’t shoot me I’m just the messenger.
It was run at the base folder of the entire Android OS source checkout, so yes it will include sample and tests I suppose.
C#, Ada, Objective-C? I also thought the same… It’s probably worth the try doing a few finds and greps to see if this is true, again I just posted the output of cloc, I didn’t intend to make this a scientific paper, just a fun and curious post to get a rough number on the lines of code, that breakdown was just icing on the cake for me (as inaccurate as it maybe)
Update
This post is now being referenced in Wikipedia! on the “Android (operating system)” article.
About Gubatron & Android
Ever since the iPhone OS handicapped millions of smartphone devices with its draconian laws, I started looking more and more seriously at Android as THE platform for every non-iPhone device coming to the mobile and TV space. Now I’m part of the developer team of FrostWire for Android, an application that exploits all the power of the device and the freedoms of the platform to allow people to connect and share.
ASP.Net ? Objective C? Ada?
How bizarre.
Answer: 1 line of Ruby? Hahaha, just kidding. 😉
Are you including the sample code and data in this count? 3 million lines of XML code seems a bit high unless you’re counting sample data.
C# ?????
Did you measure only the part of Android that is downloaded via the repo tool, or all 242 git projects? My count using cloc for the latter was substantially higher:
SUM: 380827 14403252 19160933 77345274
XML is not a programming language.
XML can be used as a programming language. It’s all how you interpret it. The fact that most people use it as data or metadata doesn’t mean you can’t create a programming language using tags.
In platforms like Android it’s used plenty as a support in the programming of your user interfaces. You define a set of steps on how your UI layout will be, that to me is a program. If you’ve ever used stuff like ant, then you will also consider XML as a programming language.
“Ever since the iPhone OS handicapped millions of smartphone devices with its draconian laws, I started looking more and more seriously at Android as THE platform for every non-iPhone device coming to the mobile and TV space. Now I’m part of the developer team of FrostWire for Android, an application that exploits all the power of the device and the freedoms of the platform to allow people to connect and share.”
Handicapped millions of smartphones? Draconian laws? Freedom to connect and share? You sound like every left-wing, head-in-the-clouds Google fanboy who ignores how fragmented and buggy Android is because you think it’s “open” and not controlled by carriers.
You tell me if you want to spend 6 months of your life developing an app that could be rejected. Screw that.
Buggy? Fragmented?
My apps are running fine on thousands of phones and tablets, if there’s an issue it can easily be fixed.
I rather have freedom of choice and deal with it’s costs than be hand tied and have an overly expensive hardware that can’t do much.
Apple is on it’s way to repeat its doom of the 80s, it’s going to divide the camp of developers for MacOSX with the Market. Now you’ll get the same Fart App, Cookie cutter One App that gets counted a thousand times as different app type of developer to come and pollude the MacOSX pristine environment which got to succeed because it embraced freedom and standards. If they’re lucky, they’ll get the same Trigger-buyAnApp-happy customers to buy the same shit they got on their iPhone this time on the desktop.
There’s thousands of existing apps that will never fit the Draconian restrictions.
And hell to the no, “god” save me from being a left-wing Google fan boy. I just tell it like it is, I’m immune to Apple’s Reality Distortion Field. I like what makes sense from them and google, and I hate what doesn’t.
php just 3 code ??? very interesting
3 lines of PHP !!!!
I suppose it’s something like that:
This (the report above) is an excellent example how the information we get in net can be totally useless e wrong.
In my last post the 3 lines of php are missing.
I’m try to write again.
1: