3 ms·
I recently had to learn a language whose REPL I didn't like and initially felt the same way, but then I did the following: I began writing 'unit tests' for each
by pagnol 9y ago
I recently had to learn a language whose REPL I didn't like and initially felt the same way, but then I did the following: I began writing 'unit tests' for each feature of the language I studied, and I had a Makefile to recompile and run my tests whenever I saved. This setup gives you instant feedback just like a REPL with the added convenience of being able to go back to previous examples without having to separately store your history. Depending on the testing library, you also get a detailed explanation of what's wrong. Now, when using the language, I still return to my 'tests' every once in a while for reference.
In the Makefile itself I use entr:
http://entrproject.org/ http://entrproject.org/
- noir_lord 9y agoYou can do something similar with the Code Runner extension with vscode [1] Been able to simply and quickly run code in a variety of languages with little friction is a handy thing to have, particularly when writing fragments in multiple languages at the same time. [1] https://marketplace.visualstudio.com/items?itemName=formulahendry.code-runner https://marketplace.visualstudio.com/items?itemName=formulah...