mkellyxp

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!

Showing Posts 21 to 30

mkellyxp

mkellyxp OP

HAHAHAHAHAH.. And just like that, I became an Elixir dev…

cblavier

cblavier

welcome home :wink:

patrickdm

patrickdm

JINASWAN :wink:

kokolegorille

kokolegorille

Having a console is a game changer, and having the observer is just awesome :slight_smile:

That’s why I find it complicate to use languages without console (like Rust).

dimitarvp

dimitarvp

Same here. But I found that this forced me to write much more – and more detailed – tests. Which turned out surprisingly good.

lucaong

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 function keyword. 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 :slight_smile:

mkellyxp

mkellyxp OP

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

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 :slight_smile:

(I also wrote a blog post about it)

brightball

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 + b it knows that both a and b must 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

Exadra37

That’s true, but Elixir also doesn’t have arrays :slight_smile:

The closest you can see is that Elixir provides the ++ and – to manipulate lists:

iex> [1, 2, 3] ++ [4, 5, 6]
[1, 2, 3, 4, 5, 6]
iex> [1, 2, 3] -- [2]
[1, 3]

Where Next? Top

Trending in Discussions Top

AstonJ
As the title says, please share what you’ve been up to with Elixir. Whether that’s been learning it, looking into it, making stuff with i...
2977 94592 917
New
cblavier
Hey there, It’s been more than a year since we started using LiveView as our main UI library and building a whole library of UI componen...
New
mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
heathen
Quite interesting article Google brought me. Didn’t find any mentions about it here. What do you think in general? Would you use togethe...
New
mhanberg
Hi everyone! The first release candidate for the Expert language server project is now available! We’ve published a press release detai...
New
AstonJ
Since we have deprecated our Erlang sections (as we have dedicated Erlang Forums now) let’s add this thread for those who’d like to post ...
New
Null-logic-0
What IDE or editor are you using for Elixir development? Personally, I use Zed, and I really like it, but sometimes I wish there were a ...
New

Other Trending Topics Top

JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Dmk
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
webofbits
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself. My main conc...
#ai
New

Latest on Elixir Forum

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews