sdushantha / fontpreview

Highly customizable and minimal font previewer written in bash
MIT License
909 stars 39 forks source link

Rewrite fontpreview in POSIX sh #46

Closed khuei closed 3 years ago

khuei commented 3 years ago

This is subjective so feel free to close this PR if you don't want it.

sdushantha commented 3 years ago

Awesome! When I initially wrote fontpreview, I thought of writing it in POSIX sh, but I gave up after I could not figure out a way to translate the code for checking the dependencies.

I do have a question regarding POSIX sh. What is the big deal of using POSIX sh? I know that it will support more OS's but dont almost all popular OS's these days have bash? Also bash has more features such as arrays. I feel like writing POSIX sh is something people are using to have less bloat on their computer or something of that sort. Dont get me wrong, I really enjoy writing POSIX sh because I see it as a challenge and a way to have less lines of code (I could be wrong about this point)

khuei commented 3 years ago

Yeah, that's the reason why I said this PR is subjective since bash is everywhere these day.

The main reason why I like POSIX sh is because I can run it with dash, which is smaller and faster bash. I occasionally have to use/work with small embedded system so I prefer to use dash on it rather than bash, so the system can run a bit faster.

POSIX sh is useful in certain situations, but if using bash is more useful and create less traction for this project in the future, I would recommend you to stick with bash.

sdushantha commented 3 years ago

I think I'll stick with bash for this project, but I did learn a few new things about POSIX sh from your PR, so thank you for that! Also thank you for the explanation :)