Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Well echoing what the author wrote - it’s quite easy to learn Elixir.

We have a new guy who started a bit less than a month ago.

He’s now already writing functional Elixir (no pun intended) and contributing to big code base.

One of the first things I told him is that “there is no magic in elixir”. What you see is what you get.

If you understand that everything is literally a function - life is easy and using the language becomes fun.



> If you understand that everything is literally a function

Except when it's a macro :-D


Come now, macros are just functions over syntax. ;-P

But yes, the only headaches I’ve had have been with hard-to-follow macros.

That said, the Phoenix Framework has some well-chosen macros that are a delight to work with. Furthermore, all these macros are defined in your source when you create a new Phoenix project—I feel that over all there is remarkably little magic in Phoenix, and what magic there is is easily inspectable.


I wouldn't say "remarkably little". There's "relatively little", esp. compared to Rails. I'd even say there's little magic compared to Django.

But try to peek under the hood of Phoenix.Helpers someday... And also, don't ask too many questions about how Ecto drivers work... I tried writing an ecto driver once and gave up. Props to the people who made the Sqlite3 driver.


Macros are extremely powerful, and like all really powerful things, they’re very easy to shoot yourself in the foot with… we’re lucky that the Phoenix team are some very capable wizards!


I'm still not entirely sure if I'll be an Elixir programmer, but I do appreciate the culture of the Elixir community. José definitely seems to be trying to Be the Change with respect to inclusivity.


The Elixir/Phoenix forums are a genuinely delightful place. Can’t recommend them enough. Great mix of beginner questions and best-practice discussions, and commenters tend to be quite knowledgeable and very friendly.


And doing it in a genuine way as well. Just living out the values, instead of beating it over everyone's head, and shouting "We're inclusive! Look at us! We're inclusive! Hey everyone check us out! Inclusivity!"


Metaprogramming in elixir (i.e. macros) will definitely feel like magic to most. It allows for really powerful abstractions, but doubtful the new guy would have been able to be productive in a month in a large codebase full of them. Your standard phoenix app, yes it is fairly straightforward.


But what does a large codebase full of macros would look like? It's an anti-pattern to have too much macros. They should be used as a last-resort option.


I wouldn't say it's an anti-pattern to have too much macros. Macros are a a tool to solve problems. If the problems require macros or at least benefit greatly then macros it is.


HN meta question: When I see all these double-returns at the end of each sentence, should I assume it's because someone is using Slack (or another chat program where mashing return after every statement makes sense) and a bot/script to make the post? That strikes me as a very unnatural way to punctuate in a textarea form.


I just type weird.

No bot.

What's the point of a bot?

I type that way because I have some kind of mental condition that makes me try to make things easy to read for everyone.


How can I get that kind of job, I would love nothing more than to be given the task of learning something for a company!


I did this twice this year at my current job. Each time I made a case for introducing something new and interesting (Typescript, and Elixir). It took some convincing, and finding the right projects to introduce these technologies, but it happened. The result is that I've shipped four projects with Typescript, and am in the middle of delivering a greenfield Phoenix (with LiveView) app.


What? There’s so much magic in Elixir and it’s ecosystem. Controllers in Phoenix, various handle_info overloads and requires implementations, misspelled atoms, pattern matching and mismatches with names structs, the implicit return… there’s so many footguns to fire at yourself.


> the implicit return

It's not magic, it's a regular feature of functional programming languages.


these days returning from the middle of a function seems like magic to me. What is this return keyword and what sort of control flow is it abstracting over??


pattern matching isn''t magic.... its pretty standard in FP languages, elixir just happens to match on value over type.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: