News for hackers. Stuff that matters.
Re:Throw away code by m45t3r on Friday September 25, 2020 @11:03PM (#24596088)
Also I really like Python stdlib for those kinda of throwaway scripts. While `cargo` is a far better tool than `pip` for dealing with dependencies, if you don't need to dependencies at all it is even easier, and most times when using Python I don't really need to install any third party libraries even when doing non-trivial stuff (i.e.: sometime ago I did a script that scrapped a page for a download link for some APK and sideloaded it to my Android smartphone).

Someone also said the REPL, and while the REPL in Python is not as powerful as, i.e.: Clojure, it is still something that feels essential for a exploratory workflow that is the scripts case. Testing is not the same, it is much slower to interact, specially when you just want to check a hypothesis (also, most scripts I don't want to write tests, they will probably break anyway in a few months like the example of web scrapping I said above).

Re:Throw away code by heavyset_go on Saturday September 26, 2020 @12:43AM (#24596487)
> Someone also said the REPL, and while the REPL in Python is not as powerful as, i.e.: Clojure, it is still something that feels essential for a exploratory workflow that is the scripts case.

Check out IPython if you haven't, the REPL is a game changer.

Re:Throw away code by sullyj3 on Saturday September 26, 2020 @04:24AM (#24597248)
What features make it a game changer for you? For me it felt like just a small quality of life improvement, but I've never delved that deeply into its feature set.
Re:Throw away code by heavyset_go on Saturday September 26, 2020 @04:50PM (#24602013)
- readline functionality and history

- Hints and completions behind the Tab key

- Syntax highlighting as you type, along with auto-indentation

- Dynamic introspection with "?" and "??"

- Being able to run shell commands with "!" and capturing their output with "!!"

- Magic commands behind "%" and "%%"

- File system navigation

Re:Throw away code by m45t3r on Saturday September 26, 2020 @11:03AM (#24599340)
I know IPython, and yeah, it is very nice. But most of the time I just to test something fast the default REPL is already enough.