Code statistics for Basecamp Next
37signals.com
37signals.com
$ rake stats
+----------------------+-------+-------+---------+---------+-----+-------+
| Name | Lines | LOC | Classes | Methods | M/C | LOC/M |
+----------------------+-------+-------+---------+---------+-----+-------+
| Controllers | 164 | 139 | 6 | 23 | 3 | 4 |
| Helpers | 81 | 62 | 0 | 13 | 0 | 2 |
| Models | 102 | 58 | 3 | 6 | 2 | 7 |
| Libraries | 0 | 0 | 0 | 0 | 0 | 0 |
| Model specs | 256 | 198 | 0 | 0 | 0 | 0 |
| Controller specs | 29 | 22 | 0 | 0 | 0 | 0 |
| Request specs | 555 | 424 | 0 | 3 | 0 | 139 |
| Cucumber features | 87 | 34 | 0 | 0 | 0 | 0 |
+----------------------+-------+-------+---------+---------+-----+-------+
| Total | 1274 | 937 | 9 | 45 | 5 | 18 |
+----------------------+-------+-------+---------+---------+-----+-------+
Code LOC: 259 Test LOC: 678 Code to Test Ratio: 1:2.6
(Note that "Request specs" is RSpec-speak for "Integration tests".) This is probably a little heavier on the test code side than I would have in an app designed for production rather than pedagogy, but it gives you the basic idea.Even though there's some minor controversy about testing frameworks in the Ruby community (you can see that I use—gasp!—RSpec), I think it's great that the only way to cause major testing controversy is not to do it.
P.S. I have some reservations about Cucumber, and the Cucumber features are there mainly for Rails Tutorial readers who want a quick introduction to the subject. I don't use Cucumber much myself, although I do have a better appreciation of its virtues than I used to.
Twitter is my least favorite site in this respect.
No idea what this means for of Basecamp Next, as there's no actual code yet, but in my own work I like to make sure that no-JS doesn't necessarily mean no-functionality.
But we do rely heavily on JS for functionality, so it won't work without it.
I suspect it comes down to the project and the trade offs therein. I'm no code zealot.
I'm presuming you're serving just desktop interface to start as well? No responsive or mobile at launch?
But we're also ruthless about keeping the code base small. In the beginning I would go through the entire code base every week and prune it. I still read through the entire thing every now and then and make sure there's no excess fat.
EDIT: And since I'm already asking so many questions, how do you guys feel about supporting older versions of IE?
We will not support old versions of IE. We support IE9+.
Code to Test Ratio: 1:0.8
That seems like an awful lot, no?The current project I work on has 292908 LOC, and Code to Test Ratio: 1:1.1.
I'm not sure when/if we'll have a chance to get back to it.