| Many of the points are based on personal taste. But others are just wrong / misunderstood. Specifically: > See how when you assign to a variable you don’t get to see the result. Yes. Because assignment doesn't return any value in Python. > Instead I have to know empty collections in python are false No. There's always `len(collection) == 0` available. > import os / Python had no idea what os was. That's just some mistake the author made. Importing modules works just fine and in many style guides it's preferred over importing specific functions/classes. > Instead we have to look at an entirely different module named shutil with the function rmtree. This is exactly because of being explicit, like the author wanted Python to be a few lines above. The `os` module maps pretty much exactly onto basic OS operations. There's no rmtree, because it's not a basic mapping. It's a complex procedure, so it's somewhere else (with other complex functions). > Shell commands like cat are in my fingertips for such things. This is not a feature of bpython as far as I understand. It's a feature of ipython though. Just choose your repl. > I run it like this: run(`codesign --verify $app`) Whatever the language, this is a bad way to run external applications. What if the `$app` contains spaces? Or hyphens? Or semicolons? Again, author approved of the explicit approach in the same article, so they should just pass an array of command and arguments instead. > In contrast Python distinguishes the two with: ["codesign", "--verify", app] "codesign --verify {}".format(app) They're different things, and that's a good thing. If you want to print out a list as if it was a single command, you can do `' '.join(the_list)`, but without proper escaping, it's not always going to be correct. > Here are some examples of what I do in Julia which does not require extensive libraries: And I call BS at this point. If the author can do "Modifying and resigning iOS apps." in Julia without extensive libraries, they should show that. Calling an external command does not count. |
The author writes "Whether dealing with string literals or back-ticks for expressing a command line, you can refer to a variable foo as $foo and it will be escaped properly."
http://docs.julialang.org/en/release-0.4/manual/running-exte... confirms that `` has special escaping rules designed to prevent the problems you pointed out.
> Or hyphens?
The interpretation of hyphens depends on the program being called, not the shell. There is no automated way to escape them.
I agree with everything else you wrote.