ignorabilis
Joined 11 years ago
Joined 11 years ago
Regarding your other questions: Humans will build the machines that build the machines. In fact they do it now. Then we will build machines that can build machines based only on a design. That's the future.
The thing with the machines is a little bit different, but essentially it is much better to work from an office 2-4 hours a day, controlling a mining machine compared to actually mining.
Once a person can read there is almost no need for anyone else to teach him anything. I never listened in class, didn't have a notebook and got A's when I wanted to. I was reading the books that we were supposed to, but I prefered to explore them my way and I usually read them before it was needed. I know other people like me. I also know that people are curious in general and like to explore if given the opportunity.
And here comes my last answer - these people will do that because they want to see the result. Because they will enjoy doing it. And when they no longer find it interesting they will move on to something else. Because not doing anything is depressing. Doing it against your will - even more.
In the context of the article I/O is someone else's code. If it were my code it should be tested elsewhere, as if someone else wrote it. Not in every place that my application uses it.
In the particular case with writing the actual I/O code - I don't have enough experience, so I can't tell you. Maybe tests are absolutely necessary. Maybe mocks are the only way. I don't know.
What I do know is that programs transform input to output - input -> transformations -> output. You never care where the input comes from nor where the result of your transformations go. All you care is if your transformations are correct.
Your program may be very complex, with many inputs that you don't control, scattered around your logic. So prior to writing tests you have to decouple those dependencies from your logic and only then proceed with writing tests. If you are using functional language you may reduce every piece of logic to the simplest, smallest function possible, test it in the REPL, document it and move on without actually writing tests.
When things are decoupled refactoring is not that dangerous. If all pieces of your program are small, intelligible functions you can always just refactor a single, simple function and you should not need tests to rely on - all you have to do is make sure that this function is working like it worked before the refactoring (or better).
In OOP everything happens somewhere else because anything can hold a reference to the variable and change its value right under your nose.
To me at least these are two different concepts.