hfalzon
Hey all again, I am back → a few months ago I started dabbling with Elixir and Phoenix.
Long story short, I came away a little confused and little jaded. I just couldn’t get the appeal (of phoenix)
I suspect it is simply just a matter of unfamiliarity and not really thinking in the same way as the framework at this time. (I like building things from the ground up as it helps me understand more about what I have built → It is why I like Go so much… I tend to be able to reason a lot more about what I need to do to achieve something)
However, I really like elixir (baring some issues that I would like some help with and the point of this post) So I have been trying to look more into setting up http servers with elixir, and I have got to say I am little lost…
A lot of the docs (for example in Bandit) assume that you are using phoenix.
I guess my main confusion comes from the tooling. Is there a secret sauce so to speak to make the tooling a little more useful in my IDE?
for example: I will install bandit and then… I just don’t know what to do with it.
In go for example it would be:
go mod init <name>
go get <module>
import <module>
Then I can start getting autocompletes within my ide fairly consistently
in Elixir, (I really like the language… just I am really struggling with the tooling)
- Place my imports into the mix.exs
mix deps.get- Then I am lost… some libs want to be placed in a config… but that just confuses me as it just seem like values are going everywhere, without me really understanding why (despite looking at all the docs) or sometimes using
mix.Install - I am really unsure how to start seeing import options/ or autocompletes or documentation. (How to configure)
- Take Plug for example (which is what I am trying to use over phoenix at this time) I just don’t get why we configure things in the way the docs are configuring them.
I know that this is stemming somewhat from my unfamiliarity with at least the mental model. But I build my own frameworks in php, go, node… so I do feel like I should be able to get this. I am just really struggling dealing with the tooling and setup of a project. And I don’t know where to look or things feel really inconsistent and/or magical… like… you do this thing here for this library… just “because”… And that is the one part of the language (right now… that is just not gelling with me)
Is there a resource and / or book to help with this aspect of Elixir? (I have Elixir in Action (third addition) coming this week so I hope that might help
Trending in Questions
Other Trending Topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #blog-post
- #ai
- #phoenix_html
- #elixirconf-us
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming










Showing Posts 1 to 10- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
arcanemachine
To address the topic:
What IDE are you using?
What have you tried so far?
I wish I could really help with the rest of the post (I haven’t tried to make a framework), but I have found config to be pretty straightforward, mostly. Follow the docs, and occasionally break conventions as needed, if I can.
hfalzon
I am using VScode With elixir-ls (nothing too fancy here)
I think my issue comes from the “magic” feeling that I am getting from everything and there being no discoverability of imports (at least for me right now…
let me use a basic supervisor as an example
Just in this little bit of code I feel really overwhelmed…
For example
Where is
Applicationcoming from?Where does
Supervisorcome from? (Standard lib, I know but just using it as an example)I am sure it might be really obvious to others… it just feels very “magical” and you do it because that is how you do it…
Again… I could be completely out of line here, and just be completely not getting something (thus my questions) → But this might be a good example of what I am feeling. I just feel like a lot of Elixir when dealing with libs is this pre defined dance of semantics but with very little feedback from the ide.
I think I somewhat understand that
useis sort of like metaprogramming and injecting things at compile (please correct me if I am wrong on that)Sorry if this feels like I am just not getting it.
dogweather
When I hover my mouse over
Applicationin VS Code with ElixirLS I get this:That’s pretty nice, IMO. And that View on hexdocs link is super-useful.
hfalzon
Yeah, I get that too, it is really good, I agree. I think (at least right now for me, it is a bit inconsistent some libs don’t really have this, like right now I am trying to work through the bandit plug docs, and I just feel stuck.) Again, I think it is coming a lot from my unfamiliarity with the mental model, and I hope that the book I have coming helps me at a more foundational level.
dogweather
And FYI, that popup-window scrolls down: there’s more to read.
Also, when I add a ‘.’ at the end of Application, it gives me accurate completions. (They don’t really make sense here with the
usestatement, but they are all things we can reference fromApplication:dogweather
For sure, Go is much more statically typed than Elixir, and I think that does improve the IDE assistance.
Personally, it’s something I accept as a tradeoff for the benefits of the community and technology.
hfalzon
Yeah. I love the idea of Elixir… I really want to learn it just for the BEAM/OTP model (It is a thing of beauty) I think I just got to put my nose to the grind stone a bit more by the sounds of it haha…
arcanemachine
I think a lot of your problems will go away when you have some experience under your belt, plus a working LSP.
Typically, imports are aliased, so you’ll at least know that
SomeModule.some_function()comes fromSomeModule. (There are times where this is not the case, but I’ve found this to be the case most of the time.)Also yes,
useis used to execute a certain type of macro.hfalzon
Yeah, I think you are right… I guess right now I am in this stage of tension between what I am used to and how elixir works.
How long do you feel did it take you to really start getting things?
dogweather
Yep. I’ve gotten first-hand great experiences from it because of the OTP & BEAM:
So maybe one reason for your shock: you’re stepping into a large “batteries included” framework - not just an http library. So lots of these concepts like Supervisor means wrapping your head around someone else’s design, and figuring out how to plug your ideas in.
I got familiar with Elixir on its own, without the framework overhead, from exercism.org - you do the coding exercises in a test-driven style, on your own computer. I compare my solutions to the highest rated ones. My profile: dogweather's profile on Exercism