News for hackers. Stuff that matters.
Re:ShutIt – Automation framework for programmers by zwischenzug on Sunday July 10, 2016 @03:01PM (#12066726)
That's just an illustration, not 'ideal' code. Of course mkdir -p serves the same purpose; the point is to show the 'file_exists' function.

Mostly it's where using the shell would be painful. Do you have other specific examples?

Re:ShutIt – Automation framework for programmers by mrb on Sunday July 10, 2016 @05:56PM (#12067441)
I am a firm believer that example code that serves as a reference should illustrate the absolute best practices. "mkdir -p" is the best practice to create a dir that may or may not already exist, therefore this is a bad example (you are teaching some devs who don't know "mkdir -p" a bad practice). If you want to demonstrate the file_exists function, pick a better example.

This is the same reason why I dislike, for example, seeing the documentation of a library showing how to perform actions X, Y, and Z, but a footnote says "by the way, there is no error checking in this example". Well then, why use this code as an example?

Anyway, sorry for the rant. ShutIt does seem interesting :)

Re:ShutIt – Automation framework for programmers by zwischenzug on Sunday July 10, 2016 @06:02PM (#12067465)
I know what you mean, but I couldn't think of a better example that would not have involved explaining something else that would have distracted from the point. I wasn't comfortable doing it, but at the same time, couldn't think of anything better.

Actually, I have similar problems when teaching - I'm writing a git course at the moment, and it's hard to illustrate concepts in a realistic way without hopelessly artificial repos.

Re:ShutIt – Automation framework for programmers by rickycook on Sunday July 10, 2016 @07:18PM (#12067745)
there's another file_exists for the git directory that seems to be an even more complete example :)
Re:ShutIt – Automation framework for programmers by emilong on Sunday July 10, 2016 @03:06PM (#12066756)
Just some similar stuff in the asciinema, but I'm thinking that's also just for illustration. Thanks for the clarification!
Re:ShutIt – Automation framework for programmers by zwischenzug on Sunday July 10, 2016 @03:09PM (#12066774)
Pleasure. BTW 'install' is really useful, eg here for my home server setup:

https://github.com/ianmiell/shutit-home-server/blob/master/S...

so I can port to Centos from Ubuntu pretty easily.

PS That's an example of a ShutItFile, which is still a WIP.