3 ms·
The number of lines written is no measure of success, rather the reverse. How many lines of Python did this re-write replace?
by zabzonk 5y ago
The number of lines written is no measure of success, rather the reverse. How many lines of Python did this re-write replace?
- BiteCode_dev 5y ago> we needed 2.7x lines of Go to handle the same features as our Python code But it's for a rewrite, so: - you can use the most modern language features. Python 3.9 is less dense than Python 2.7 (E.G: a silly 2.7 example would be https://0bin.net/paste/xpnCov-3#3s2AgDReXpeqG4knegGwdnYNi523PqgYXKH6svrFW-5 https://0bin.net/paste/xpnCov-3#3s2AgDReXpeqG4knegGwdnYNi523... which is 37 lines, the equivalent in 3.9 is https://0bin.net/paste/b4DVZIS5#372LGWNLBJfDUNQGAMsDlJPNlkVy982luK1seDkOD+K https://0bin.net/paste/b4DVZIS5#372LGWNLBJfDUNQGAMsDlJPNlkVy..., down to 25 lines). Also note that it's not just less lines, but way shorter, yet clearer, lines. Something LoC fails to take in consideration. - you can use the most modern stack. E.G: fastapi is less dense than flask as soon as you use data validation, plus it adds typing for free. - you know very well the problem to solve so you get it right the first time.
- irjustin 5y agoI didn't take the headline to mean "success" more like "experience". In the article, they clearly measured success by 1:1 porting of the entire code base from Python to Go as closely as it makes sense.