312 karma · joined February 9, 2017
I also wrote a small article on it, not very detailed but maybe it can help you get a rough idea of the power of clojure.spec when combined with generative testing -- [http://abhirag.in/articles/spec_oracle.html]
Also the perspective that helps me learn an instrument is that it's like you are developing a friendship with your instrument. One day you will be so comfortable that playing an instrument would feel like talking to a friend but making a friend takes time :) You have to have some awkward conversations first, feel like this is going nowhere and someday it won't feel awkward anymore and you would pick up your instrument and it would understand you like a friend does :)
I used to play a guitar and now often spend my time playing the mandolin so this perspective has definitely helped me, maybe it would be of some help to you too :)
Also if you are interested in all this stuff try this -- [https://www.visualstudio.com/dev-essentials/] you get free 3 months trials for Pluralsight and Linux Academy, you can download and watch some video courses during commute and that might reduce your study time at home a bit.
Disclaimer -- not affiliated with Microsoft or Linux Academy or Pluralsight, just trying to be of some help :)
The added benefit is that when you actually break out the debugger to squash a bug you better understand what might be going wrong as you can try and pattern match from the time it worked perfectly.
I treat the debugger as a tool for understanding code, buggy or otherwise, no "debugger-induced tunnel vision" for me, it widens my field of view :)
"(1) An accurate mental model of how the program should behave, with sufficient detail to hypothesize about why it's not behaving that way" -- While working as a firmware engineer, I once got a bug from a customer, he reported that they were in Argentina and the device with the firmware would lose an hour in the time displayed every time they had a power loss and that the problem goes away when they put the time-zone to Brazil, this much was enough to know that the problem was with the day light saving time part of code. Some engineer hypothesized that problem might be with the NTP server but his hypothesis was wrong because NTP server was dealing in UTC.
"(2) Available tools and instrumentation that allow you to inspect a running program (I'm old enough to remember debugging by adding commands to print state to the console)" -- I dealt with code which installs the firmware, frequent power cycles made keeping a debugger attached an exercise in futility so I just continuously logged the top two frames of the stack by using a system call. Crude way to trace the control flow but helped me in understanding the installation process a lot.
"(3) sufficient experience and sophisticated understanding of the system to be able to make valid hypotheses and design tests." -- This was even more important while dealing with firmware hangs, dealing with hangs made dealing with crashes look easy. Crashes were the messy criminals leaving a lot of clues behind. Hangs are the type of criminals who would have to be caught while committing the crime.
I would also like to add one more --
"(4) When debuggers fail you, git-bisect is your only true friend." -- I once was dealing with a memory corruption bug, in a piece of memory which was shared by two systems, the number of processes with access to that piece of memory was bonkers. I decided to brute-force my way out, it worked in the last release, it stopped working this release, I just kept doing a git-bisect between clean and dirty states and found the code which caused the bug. This way was definitely not the clever way to do it, but brute-force is sometimes the only option left.
1. If you are prototyping and prefer working on a remote server, have a look at(https://notebooks.azure.com/), memory is limited to 4Gb but its free and jupyter notebooks are great for prototyping.
2. For prototyping you should try and do REPL driven development, what I mean is that you should be ok with just playing around with the library API before you write a longish-running processing task, that would reduce(not remove) the chances of a runtime error. Jupyter notebooks excel in this too as you can just try out code in a cell, learn from it, rinse and repeat. You can also use your IDE to send code fragments to REPL and get immediate feedback on them. This way of iterative development would make sure that the speed of your feedback cycle isn't slow. If python's feedback cycle seems slower to you than C++, you are definitely not using the REPL enough :)
3. If debugging is a pain point definitely give an IDE a try, I prefer Visual Studio as I am on Windows. You can very well go with Pycharm or vscode(not technically an IDE but has a debugger so that's that). I personally prefer Jupyter notebook or Emacs with my code and REPL in split windows for prototyping, different strokes for different folks.
I personally love working with python, I even write my blog posts in a Jupyter Notebook so although it isn't perfect, it doesn't have to be frustrating either :) Hope my suggestions can be of some help!