I think part of the problem reading and groking Elixir is because I don’t have some kind of IDE Intellisense plugins which can show me the type of objects I am looking, display some help on them and help understand the parameters and syntax better.
Are there some ViM plugins which can help with that, or for any other editors. I think I have to avoid GUI based editors as I will doing a lot of work over terminals.
In general emacs with alchemist is capable of showing you documentation and also VS code can.
But this functionallity is very limited, it is only available fur functions and modules that can be resolved unambiguously.
Types of a “thing” (I avoid to say object for a reason!) are even harder. It is a very hard task to infer them from the context. Generating the necessary typeinformation of erlangs base applications takes about 10 minutes on my computer using dialyzer. And even after this information is available, types can get pretty complex, since the way the BEAM deals with them.
I would like to add that IEx is a wonderful tool, with its i, h, v and r helpers. When trying out if ideas work, I usually will write out the basic functionality in a module, then load this in an IEx session with some inputs, before deciding if this is indeed the proper way. If so, then I’ll lock it down by writing tests for it.
But especially when using third party libraries, thr ability to find out how any command works by using h is really wonderful.
I am referring to understanding the code as I read it because coming from an imperative background I find the code rather cryptic. Symbols seem to be popping up all over the place when in imperative language they will be declared and you can see what is going on.
For instance I had some trouble understanding pipes because the function calls didn’t match the signatures until I was told that expression to the left of the pipe is actually its first parameter. I think I am in my first week of getting to grips with Elixir.
Just when I thought it would be safe to go with Vim I am now told Spacemacs is the preferred option (for Elixir). I need to learn some Vim so I would prefer the Vim’s equivalent to Alchemist and evaluate Spacemacs later.
Don’t spend lots of time on editing tool. Just pick the one you feel good with.
About understanding the pipe operator : it is exactly how it is explained in all tutorial. Keep playing a bit with it, there tends to be really little happening in elixir. What probably happens is that you overcomplexify your explanation.
Which is normal, it is how our brain is wired if it is hard to understand, it should be complex. Keep playing a bit, yoiu will probably get your mind blown a couple time
I agree with this for the most part but once you’ve experienced perfect intellisense in full visual studio it’s very hard to go without.
I’m currently using visual studio code with vscode-elixir and it’s ok but still leaves me wanting more. You can hover the cursor over a module or function and usually shows you the documentation but it seems like a 50/50 chance it can actually find the module. The same goes for autocomplete but no docs (though it does list params) even when it works it doesn’t seem to list all functions.
The good thing is that elixir is quite a simple and well organised language. I still have keep a tab open with the elixir docs but always find what I want very easily.