Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

In short:

Person puts short shell scripts "build", "deploy" and "dev" in a single makefile as targets, instead of putting each script in a separate well named file. Then concludes that make is a great build tool as long as you don't use it as a build tool ("nothing complicated").

Please do not do this. make is not a shell. Also, consider reading (and writing) build docs, instead of running make with random targets as soon as you see a makefile



Personally, I've always created shell scripts too. Or PowerShell scripts if I need Windows based support (like for Golang projects that might see Windows based usage.) I find they're way, way better and easier to work with.

That being said, the only issue preventing me from using shell scripts well is shared code. Like common functions etc. So far I've simply used a common.sh script and sourced/imported it.

Also, what do you do once you have 4-5 shell scripts at the root of your project? I find it gets messy quickly. I need a solution for this.

But yes, I agree shell scripts are generally better.


> Also, what do you do once you have 4-5 shell scripts at the root of your project? I find it gets messy quickly. I need a solution for this.

Put them in a folder! I see "tools" used commonly for dev/build scripts


Write a Python script instead? Easily cross platform. Nice libraries for CLI args. Easy to debug with a real debugger. Pretty nice?


I'd take php over python any day.

Everyone has their favorite python modules they like to use in scripts, half of them are not built or wrong version for whatever current distro I'm in, so I install stuff with pip, then something with requirements.txt breaks because of wrong pytorch version, I start reading about envs, much crying.

At least with bash or make nobody expects you to provide external modules/libraries


I’ve never so much as looked at a Php script in my life. I’d have to ask ChatGPT how to even run one.

A build script should work with vanilla out the box Python. No extra modules needed. I mean if you can assume vanilla bash tooling then vanilla Python is perfectly fine.

If there’s some Python library you really want then add it to repo. Easy peasy.


PHP has all the same problems (composer or whatever), plus being a shit language that NOBODY uses for scripting.


PHP is a fantastic system scripting language IMO. Much more ergonomic for the task than Python. But I'll do you one better: Perl. Perl is incredibly stable and ergonomic for system scripting. It's probably the most ergonomic scripting lang I've ever used.

The benefit is Perl is robust, unchanging for decades at a time, and available on pretty much every system. Bash is not portable, Perl is.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: