2 ms·
This probably varies widely, because unreadable bash is absolutely not considered normal, nor would pass code review in any of my projects. On a slightly diffe
by freedomben 3y ago
This probably varies widely, because unreadable bash is absolutely not considered normal, nor would pass code review in any of my projects.
On a slightly different note, unless the application is written in python, it grosses me out to think of writing scripts in python. IMHO, if the script is more complex that what bash is good at (my general rule of thumb is do you need a data structure like an array or hash? then don't use bash), then use the same language that the application is written in. It really grosses me out to think of a rails application with scripts written in python. Same with most languages/platforms.
- echoangle 3y agoWhat if your application is written in Rust or C? Would you write your build scripts in these languages, too? I would much prefer a simpler scripting language for this. If you’re already using a scripting language as the main language, you don’t necessarily need to pull in another language just for scripts, of course.
- ycombinatrix 3y agobuild.rs is a thing FYI
- dgsb 3y agoor make.go, for some project it makes sense to not add another language for scripting and building tasks. It way easier for every one to have to master multiple language.
- eru 3y agoWriting a build script in Rust is fine-ish. Writing anything in C is a bad idea these days, and requires active justification that only applies in some situations. Essentially, almost no new projects should be done in C. Re-doing your build system, or writing a build system for a new project, counts as something new, so should probably not be done in C. In general, I don't think your build (or build system) should necessarily be specified in the same language as most of the rest of your system. However I can see that if most of your system is written in language X, then you are pretty much guaranteed to have people who are good at X amongst your developers, so there's some natural incentive to use X for the tooling, too. In any case, I would mostly just advice against coding anything complicated in shell scripts, and to stay away from Make and autotools, too. There are lots of modern build systems like Shake, Ninja, Bazel, etc that you can pick from. They are all have their pros and cons, just like the different distributed version control systems have their pros and cons; but they are better than autotools and bash and Make, just like almost any distributed version control is better than CVS and SVN etc.
- northzen 3y agoAlso zig is a good example of not a scripting language which does this job.
- freedomben 3y agoC is probably the best example where I would be fine with scripts in Python (for utility scripts, not build scripts). Though, if it were me I'd use Ruby instead as I like that language a lot better, and it has Rake (a ruby-ish version of Make), but that's a "flavor of ice cream" kind of choice.