mkellyxp
Im an “old school” PHP developer working in the traditional LAMP stack for years now. I’m ready for something new and have projects that need to scale. So naturally I’ve landed here.
I’ve purchased some elixir / Phoenix books and have the boot camp course on Udemy and about to really dive in.
But I have to admit, my brain is having a really hard time with the syntax! The functional programming part is fine grasping. But all the bizzare symbols everywhere just totally looses me. I don’t find it readable at all.
I know most of this is because it’s new, but even so, it looks so cryptic. Any tips on getting comfortable or understanding these basics. Sure I can copy and paste from a book or course, but I really want to understand what on earth I’m looking at.
I’ve heard amazing things about this community and excited to be here!
Trending in Discussions
Other Trending Topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixirconf-us
- #ai
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #hex
- #security










Showing Posts 21 to 30- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
mkellyxp
HAHAHAHAHAH.. And just like that, I became an Elixir dev…
cblavier
welcome home
patrickdm
JINASWAN
kokolegorille
Having a console is a game changer, and having the observer is just awesome
That’s why I find it complicate to use languages without console (like Rust).
dimitarvp
Same here. But I found that this forced me to write much more – and more detailed – tests. Which turned out surprisingly good.
lucaong
Yes, that’s a common experience when delving into a different programming language. But, I can only say, give it some time before concluding that the syntax is “objectively” unreadable. Usually, what you are seeing is familiarity bias.
Long ago, I remember seeing LISP and thinking that “this cannot possibly be readable by a human”. As soon as I got familiar with it though, I just started to LOVE its simple syntax. What was an unreadable cluster of symbols was then a clearly readable computation.
Same with JavaScript arrow functions: I just love them nowadays, but I used to think that it was much harder for the eyes to parse than the old school
functionkeyword. Or Python’s semantic indentation: I found it hard to digest, until I got used to it.In each of those cases I tought that my preference was objective, but it really turned out to be just familiarity. I learned that syntax preferences are mostly a matter of getting used to.
So, my suggestion, is to temporarily suspend the judgement on syntax, and just spend time reading and writing code on something that you enjoy. You might be surprised by how your taste could change quite quickly, as your brain gets used to the different syntax
mkellyxp
Good advice.. thank you. I’ve already closed the phoenix book and purchased and reading the Programming in Elixir 1.6 book. I’ll spend some time getting to know Elixir properly and write more code to get used to it. It’s already easing up a little. Was just quite shocking at first.
I’m also realizing, in my 20+ years as a developer, this is the biggest change/shift I’ve embarked on.. so I should expect some WTF. But it’s also what’s exciting about it.
Really appreciating the supportive community here and the potential for this new to me language
cblavier
If you want to to learn Elixir (without Phoenix) which seems a good idea to me: you might want to try adventofcode.com.
I do it every year and it’s a perfect & really fun way to improve your Elixir. You’ll find a lot of adventofcode discussions on this very forum (one per challenge), and by reading other’s code you’ll want to revisit your own solution
(I also wrote a blog post about it)
brightball
So the biggest tip that I can give you is on all of the different symbols because I came from a PHP background as well.
One thing I missed from PHP everywhere that I went afterwards was the that super data structure for associative arrays / hash maps which can have keys or not, maintains order, etc. You’ll miss that in most other languages, including Elixir. I’ll explain why in a second.
The other thing that goes along with that is the lack of operator overloading in Erlang/Elixir, so you can’t just combine two arrays with a
+sign.Now, the flip side of that is that while Elixir isn’t statically typed, it is strongly typed. If the compiler sees
a + bit knows that bothaandbmust be numbers and can do a lot of inferred checking from that without you ever having to actually define them as numbers. Same with using different symbols for combining strings, etc.It frustrated me a lot at first until I saw a talk on Dialyzer at Elixir Conf in Orlando that made it all click and helped me to realize all the benefits that come from the approach.
I wrote a bit about it here. Elixir ETS Versus Redis
Here’s the talk that helped me so much. https://www.youtube.com/watch?v=JT0ECYZ9FaQ
Exadra37
That’s true, but Elixir also doesn’t have arrays
The closest you can see is that Elixir provides the ++ and – to manipulate lists: