4 ms·
Totally with you, except you need to choose your primary language carefully if you want it to scale up and down like that. Don't expect people to write little
by dkarl 7y ago
Totally with you, except you need to choose your primary language carefully if you want it to scale up and down like that. Don't expect people to write little command-line tools and one-off scripts in C or Java. You'll see an apparent lack of tooling for little tasks, as people hoard their secret scripts. And it's really important to get people to check code like that in, as then it will be subject to PRs where bugs will be spotted, documentation requested, and general awareness of the code's existence raised.
Also, junior people will translate "code I will never be able to check in anyway" to "perfect opportunity to play around with that new language I want to learn" and then you've got them making the usual mistakes as noobs in that language.
- Spivak 7y ago> Don't expect people to write little command-line tools and one-off scripts in C or Java Assuming you’re a C/Java shop, why not? You get to leverage all of your coworkers code to make that little CLI app. The whole thing will probably be “parse args and then call an existing method.” Then that little tool is part of your app, callable wherever your app is, stored in Git, testable with your existing tools, etc.
- dkarl 7y agoParsing args in Java is okay, I guess, but it doesn't meet people's expectations for knocking out a quick script to get something done. When it comes to writing a script to parse some arguments, send requests to a few endpoints, process the responses, maybe send more requests, it's a lot faster to write something in Python from scratch using Click and Requests than it is to write it in Java even taking advantage of the model and client classes that we have for all of our services. Scripting in Scala using Ammonite would be the best of both worlds, but our Java code requires a ton of stuff to be set up and initialized before it can work. And that's another big issue with Java. If you start out writing plain Java, people feel like they're missing out on all the "help" they'd get from a framework, and pretty soon you can't figure out how to make your code run at all except inside the framework. So you have to either write your scripts using the framework's CLI helper, which is probably some enormous abstract class that has its own argument parser you have to integrate with, or you start reverse engineering the framework's CLI helper to figure out which parts you need and end up running out of time and falling back to Python and swearing to figure it out someday. That's my experience, anyway.
- rho4 7y agoYou are assuming that people are not capable of "parsing args and sending request to endpoints" in an efficient way, using a few lines in their main programming language. This assumption is probably very offensive to any competent developer. Your are right, however, that a junior developer who is still getting up to speed with the main language of the team will be tempted to use whatever language / script that he already knows or encounters in a stack overflow answer.
- madhadron 7y ago> Don't expect people to write little command-line tools and one-off scripts in C or Java. Why not in Java?
- jerven 7y agoMany people don't know about JShell which was added in JDK9. That make it easy to write "scripts" in java.