3 ms·
While the author's main point has some merit and is worth discussing, the example chosen is wrong, and the reason it's wrong is the reason you should take a bea
by caymanjim 7y ago
While the author's main point has some merit and is worth discussing, the example chosen is wrong, and the reason it's wrong is the reason you should take a beat before you consider ever rolling your own solution.
So now we've got some simple code to copy files between machines, because we hired someone who was too academic to figure out how to set up a simple FTP server. Here's what comes next:
1. We need to open firewall ports so these two machines can communicate. What are they? Who knows. If it were FTP, the sysadmin would know.
2. We need authentication; we can't just allow any old machines to connect. If we were using FTP, we'd have that built-in. And it would have been audited, so we can have at least baseline confidence in its safety and accuracy.
3. We can't go having the disk overflow. We need something to manage quotas, because even though we trust our users, sometimes software goes rogue. Maybe the default FTP server can't handle this, but some other product can.
4. We need logging so there's an audit trail, in case something goes wrong and we need to track it down.
And on and on and hey look you've reinvented FTP and now no one else on your team knows how it works, it's full of bugs, you've hardcoded a bunch of inefficiencies, there's no documentation, we have to explain what it is and how it works to the operations team, and hey here comes the boss asking us to make sure it works over SSL.
If you think you can do it better, make sure you think about what you're doing.
- clarry 7y agoHow can you say the example chosen is wrong? You came up with a bunch of things to complicate the scenario that do not apply to the author's problem, and those things are precisely the kind of things that make a general solution more complex. Here, by writing their own tool, Joe could avoid all the complexity that does not apply to his scenario. I don't think the point of the example was to demonstrate a complete and general solution to the problem of transferring files across computers, but a specific solution that solves the immediate problem in the specific environment Joe was operating in, faster than you'd get it done by trying to apply a more complex (and more general) solution. Another point I'd like to make (that the original post doesn't) is that they could easily extend this custom solution with additional logic that doesn't exist in any FTP server off the shelf. In fact I've had to reject libraries and programs on similar grounds; they almost kinda do what we need, but then a vital piece of the puzzle is missing and forking the project & implementing our special sauce (and then maintaining it) is going to be much more painful than rolling a custom solution from scratch.
- hinkley 7y agoMaybe the two most painful experiences in my career are the customer who changes his mind every six hours (and once a week that happens twice in one day) and when the smartest person in the room is also the biggest fool. They can write the most arcane code that nobody else will want or be able to try to untangle, and then act surprised when people are frustrated with them.
- username90 7y ago> the example chosen is wrong He didn't need an ftp server, he just needed to manually copy some files. Is it really wrong to do that without setting up an FTP server with authentication, disk quotas, logging etc?