Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I'm confused about the assertion that Flask is only 800 lines of code.

Counting Flask v0.8 with cloc yields twice that:

  $ perl cloc-1.56.pl flask --exclude-dir=testsuite,ext
  18 text files.
  18 unique files.                              
  114 files ignored.
  
  http://cloc.sourceforge.net v 1.56  T=0.5 s (36.0 files/s, 8008.0 lines/s)
  -------------------------------------------------------------------------------
  Language                     files          blank        comment           code
  -------------------------------------------------------------------------------
  Python                          18            694           1748           1562
  -------------------------------------------------------------------------------
  SUM:                            18            694           1748           1562
  -------------------------------------------------------------------------------
And that doesn't include the size of Werkzeug, without which Flask cannot run:

  $ perl cloc-1.56.pl werkzeug --exclude-dir=testsuite,ext,debug,contrib
        20 text files.
        20 unique files.                              
       126 files ignored.
  
  http://cloc.sourceforge.net v 1.56  T=1.0 s (20.0 files/s, 13460.0 lines/s)
  -------------------------------------------------------------------------------
  Language                     files          blank        comment           code
  -------------------------------------------------------------------------------
  Python                          20           2307           4277           6876
  -------------------------------------------------------------------------------
  SUM:                            20           2307           4277           6876
  -------------------------------------------------------------------------------
Including the contrib and debug packages of Werkzeug adds another 3000 LOC.


I haven't done the numbers in a while but from the given ratio I would assume your line checker tool treats docstrings as code. The red part there is for the most part just documentation, not code: https://github.com/mitsuhiko/flask/blob/master/flask/app.py (as an example)


I think you're right, it is counting docstrings as code.


> I'm confused about the assertion that Flask is only 800 lines of code.

It's called "spin". It's common practice for people trying to sell you on something.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: