Hacker News new | ask | show | jobs
by jsaxton86 4367 days ago
I'm trying to figure out how much effort went into this. I ran cloc, and here's what I got:

  --------------------------------------------------------------------------------
  Language                      files          blank        comment           code
  --------------------------------------------------------------------------------
  Javascript                     1803          66480          85484         423029
  HTML                             57            847             79          20374
  SASS                             19             21              8          12114
  C++                              38           1011            763           7700
  C/C++ Header                     45            816            713           5165
  CSS                              16            133             27            777
  PHP                              36            330           1048            597
  CoffeeScript                     14             72             44            326
  make                             13             91              3            255
  YAML                             39              8              0            227
  Bourne Shell                     16             49             42            197
  Python                            1             32              7            125
  m4                                1             12              0             61
  Bourne Again Shell                5             15             16             38
  XML                               1              0              0             18
  Ruby                              1              0              2              4
  --------------------------------------------------------------------------------
  SUM:                           2105          69917          88236         471007
  --------------------------------------------------------------------------------
Most of this is obviously third party code, but it looks like you wrote thousands of lines of PHP, plus a bunch of frontend code?

I'm not a web developer, but this seems like a day or two of work? That seems unreasonable to me, and I probably wouldn't have agreed to that level of commitment, especially if they were still interested in me after an interview.

Side note: in the webdev world, is it normal to have third party code mixed with stuff you wrote yourself? In C++ land most of the third party stuff would have gone in a contrib directory or something before being built into a library of some sort.

1 comments

TIL about cloc! Thank you good sir. It seems as though this is because he had node_modules checked into source control on the frontend part. npm basically likes to download the whole internet when you run npm install, so these stats do not suprise me. Checking in that directory is generally discouraged, but its possible he wanted to avoid adding the node dependency in order to ease installation.
You are correct. Here are the revised numbers after excluding public/scripts/node_modules:

  -------------------------------------------------------------------------------
  Language                     files          blank        comment           code
  -------------------------------------------------------------------------------
  PHP                             36            330           1048            597
  Javascript                       9            101             86            362
  SASS                             6              4              4            127
  XML                              1              0              0             18
  CSS                              1              0              0              1
  -------------------------------------------------------------------------------
  SUM:                            53            435           1138           1105
  -------------------------------------------------------------------------------
NPM actually encourages you to check the directory in when building something deployable like a website or app: https://www.npmjs.org/doc/faq.html#Should-I-check-my-node_mo...