|
|
|
|
|
by pricetag
3090 days ago
|
|
I came across the same conclusion this year while learning to write Rust >A main function should be a particular invocation of library code. That means collecting any input necessary for the process and then passing that input to library code. This style of main functions is more likely to result in testable and composable code. There’s such a huge emphasis on OOP nowadays, that I think people who didn’t grow up writing C with the above concept in mind might initially make the same errors we both did in how they structure the main function in languages that aren’t OOP. |
|