Hey, I’m following along with Dave’s awesome “Elixir for Programmers” courses and I’m really working on my own building stuff to get good practice in.
One thing is I’ve noticed a significantly more challenging to debug than, say, ruby…
I suppose it gets more problematic when pids/processes are involved.
For example, the first thing is I’ll struggle with harder to read error messages (I’m sure I’ll get used to that). That’s not really a problem, just something getting used to.
Then, I’ll try using pry but it will crash processes at even the slightest problem/mistype. This causes all the processes to crash and reboot, so all the pids are dead, so I need to respawn them manually in the console to get a fresh pid or reboot the entire pry session.
Some things I type, like module constants, or some methods, will generate other errors so I have to manually change tons of code while debugging to make it ‘fit’ within pry so it won’t error (for example Ill have to say Agent.update(pid, ...)
instead of Agent.update(@me, ...)
. There’s been times where I’ll get 4 separate erlang errors in a row that look like deep deep exceptions, but it won’t seem to be related to anything I just typed (more like things/processes failing?)
Worst of all, once it crashes and I restart IEX, it doesnt remember any my console history, so I literally have to RETYPE every single thing from scratch. This one is probably the absolute worst, and causes major headache. I have to keep a whole text file scratchpad open of lines I can copy and paste in. I think if there was one thing to fix it would be this.
If I’m missing anything here I’d love to figure out what I could improve, or what I’m missing to make this easier. Things that would take 45 seconds in ruby are taking me like an hour just struggling with fussy processes and retyping.
Thanks!