Better HN
topnewbestaskshowjobs
Log inSign up

dorianh_

2 karma · joined Jul 9, 2020 (6y ago) · 2 submissions

Submissions

comment 6y ago · link · parent

Exactly! Thank you!

It seems that most devs (me included) learn at school to write pure functions, which is great. Then they come to the industry and all of the sudden the "parseXml" function takes a ftp port as a parameter... ("be in my case the xml was on a ftp server!")

Why there is no CS course that explains this kind of stuff?

comment 6y ago · link · parent

I totally agree with your refactoring. The code you wrote is simpler, less surprising, reusable, easily testable, and so on.

Unfortunately I think that the article only shows that the OP made poor design choices, (which he probably wouldn't have if he had used TDD, ironically).

Even if the article is well written, the code shown in the three first blocks kind of invalidate the whole argumentation :/