9 ms·
If anyone is on the fence on learning Elixir / Phoenix (Elixir's most popular web framework library) please do yourself a favor and give it a shot. If you're on
by nickjj 7y ago
If anyone is on the fence on learning Elixir / Phoenix (Elixir's most popular web framework library) please do yourself a favor and give it a shot. If you're on a time crunch and want the best bang for your buck on "why bother learning yet another language to write web apps in?" then watch this talk called "The Soul of Erlang and Elixir": https://www.youtube.com/watch?v=JvBT4XBdoUE https://www.youtube.com/watch?v=JvBT4XBdoUE
I'm not affiliated with the language but I just want to throw out that I've been around since the Geocities era as a web developer and I haven't seen a tech stack or platform this well thought out and so in tune with what makes developing (and testing!) modern web applications an absolute joy. There's really something special here. I see myself sticking with it for 10+ years with 0 regrets.
The best part about it is everything is ready today (and was before 1.9 too btw).
- neduma 7y agoThat was exactly my thought when I went thru release notes.
- freehunter 7y agoMy preferred way of learning a new language/framework is watching someone walk through creating a real app in that language/framework so I can see all the folders/files I need to touch and the thought process moving step-by-step. Unfortunately I haven't found much in the way of that for Phoenix, the stuff on Udemy is pretty outdated last time I checked. Any recommendations?
- AlchemistCamp 7y agoThat's exactly what I do at https://alchemist.camp https://alchemist.camp. Most the videos and all the intro-level ones are free. I've also put up about a hundred screencasts at http://youtube.com/alchemistcamp http://youtube.com/alchemistcamp.
- PopeDotNinja 7y agoLooks like a cool site. I'll check it out. My Elixir is Good. My Phoenix is not.
- AlchemistCamp 7y agoI'd say you're in good shape, then. Phoenix is really well-designed and doesn't have a lot of "magic" in it.
- aczerepinski 7y agoI’m building a side project in Phoenix right now. For me the learning curve is wondering whether Phoenix has a built-in or “everybody does it this way” solution to the problem I’m facing or whether it’s something I should implement myself. In Rails the answer is always “use this popular gem” and in Go the answer is always “roll your own”. Phoenix is somewhere in the middle.
- prodiguy89 7y agoThe good thing about Phoenix is you are not forced to go in any particular convention for everything, you can craft them yourselves from scratch. The bright side of this is you will only every little thing in the implementation and you'll know how to optimize it.
- PopeDotNinja 7y agoThe one time I really want to override something in a Phoenix app was deleting a response header bolted on by Cowboy (I think it was the server header). I couldn't find a work around, so I did something lame like intercept the formatted response and modify it. Some flexibility in that area would have been nice, but it was a pretty niche corner case on a not too important app, so a time crunch hack was my best option.
- nickjj 7y agoThe way I've learned so far was building my own app while skimming the docs and looking at successful open source projects like https://github.com/thechangelog/changelog.com https://github.com/thechangelog/changelog.com for inspiration and guidance. Basically error driven development and looking up things as needed. Of course also taking advantage of IRC / Slack / Forums when I get really stuck. But recently I read the Programming Phoenix 1.4 book (written by the authors of Elixir and Phoenix) and it really filled in a ton of gaps and made so many things click together. I can't speak highly enough about it. In fact, finishing that book today is what provoked me to write my comment here. The book might be exactly what you're looking for as like 5% of the book focuses on the super basics and a toy example, but 95% of the book focuses on building up a pretty real app and layering on features as you go. It's also up to date and feature complete even though the book is labeled as a beta release. By the time you finish the book, you exercise a ton of interesting things along the way (including how to take advantage of Erlang's VM to build features that would be 100x more effort and probably 10x worse in other tech stacks). You definitely don't just build a simple todo app. I don't even want to say what we build in the end because it feels like a spoiler. I only say that because when I hit the last section of the book I had no idea what was coming and was blown away by what it covers. It literally made me smile for hours just thinking about how badass everything is when it all comes together.
- freehunter 7y agoGlowing recommendation, I'll have to check it out!
- m45t3r 7y agoI concur. Programming Phoenix (I read the old version, 1.2 or 1.3, don't remember) and it is simply so well thought and helps you understand why Phoenix is not as magic as its appears in the start. I also recommend you to try to play with Plug. Things make much more sense in Phoenix after you understand how Plug works.
- tarunkotia 7y agoFor event sourcing in Elixir this is a very good walk-through: https://blog.nootch.net/post/event-sourcing-with-elixir/ https://blog.nootch.net/post/event-sourcing-with-elixir/ Another example is: https://github.com/AltTracker/alttracker https://github.com/AltTracker/alttracker It's an implementation of fully functional site. The beauty of Elixir is that the code is very readable.
- relativeadv 7y agohttps://pragmaticstudio.com/elixir https://pragmaticstudio.com/elixir https://pragmaticstudio.com/courses/unpacked-full-stack-graphql-with-absinthe-phoenix-react https://pragmaticstudio.com/courses/unpacked-full-stack-grap... These have been my go-to that seem to fit what you're describing. I hope this helps.
- mars4rp 7y agoI gave it a try, but for me after years of programming in C like languages the syntax is really hard. I know it is very similar to Ruby. I wish there was a ElixirC syntax that would also compile to Earlang.
- lliamander 7y agoAfter years of programming with C-like langauges, I actually came to really appreciate the syntax of Erlang. It's actually fairly simple and straightforward. I think the biggest issues people have with it are: * Capitalized variables names * use of comma, semi-colon, and period as clause delimiters It's interesting, but I think that Prolog-style syntax is probably the easiest to read if you don't have syntax highlighting available (though I don't think there is as much of a difference with syntax highlighting).
- dnautics 7y agoIMO, the use of header files is a bit baroque and I find it makes it harder to reason about your code. Erlang structs are also no fun at all.
- walterstucco 7y agoI think you might find one that suits your needs in this list https://github.com/llaisdy/beam_languages https://github.com/llaisdy/beam_languages
- rehemiau 7y agoIt seems similar to Ruby, but in the end it's more like Prolog
- giancarlostoro 7y agoOne thing I love about Elixir is I had read the Erlang book from Joe Armstrong ages back, and a lot of ideas and concepts still apply. I just didn't get into Phoenix cause PGSQL is a PITA on Windows, so I have to go back and try with MySQL instead.
- RussianCow 7y agoUse Vagrant! Then you don't have to install/run PostgreSQL natively at all, and can run it inside a Linux VM. https://www.vagrantup.com/ https://www.vagrantup.com/
- nickjj 7y agoYou could run PG in either WSL or a Docker container. I currently use Windows (where I spend 99% of my time in WSL) and everything runs great.
- wwweston 7y agoMaybe somebody else knows where to wave the dead chicken to make postgres under WSL work well, but my last two tries (Feb 2018, Nov 2018) suggested that trying to do so invites lots of yak-shaving, pain, and poor performance. And that's just using the package manager to install, if you want to build from source, it may not work at all. Stories to the contrary and hints how to make it work are welcome.
- anarazel 7y agoMight be worth retesting, we did some changes to PG to handle the unsupported syscalls more gracefully (warn once, and then not anymore) in a recent set of minor releases.
- RexM 7y agoWhat issues are you having getting Postgres setup in Windows? I've used the Windows installer[1] and have had no issues. [1]: https://www.postgresql.org/download/windows/ https://www.postgresql.org/download/windows/
- zerr 7y agoThe thing is, nowadays, statically typed languages became so ergonomic, there is really no reason to go with dynamic languages.
- enraged_camel 7y agoMost people who point to Elixir's lack of static typing as a weakness, or believe their productivity would be adversely affected by it, do so because they haven't actually used the language. Anyways, this subject occasionally comes up for discussion in the community. This post sums up my thoughts fairly well: https://elixirforum.com/t/static-vs-dynamic-typing/9824/3 https://elixirforum.com/t/static-vs-dynamic-typing/9824/3
- chessturk 7y agoI agree. I've sincerely asked for explanations what is missing when pattern matching is so similar to type inference. Combined with guard clauses and "let it fail" philosophy, what is the problem other than boilerplate? Is it lack of mechanical refactoring? Totally honest question for type enthusiasts, my other posts have been met with silence.
- 59nadir 7y agoIt's a near certainty that I've written an order of magnitude more elixir code than you have and I can say without a shadow of a doubt that elixir's lack of static typing definitely makes it less useful. Even if you disregard the modeling power that you can get from this there is an upper bound on any elixir project after which any work on it becomes less and less easy to do, as with all languages that lack a static type system. We write assertive elixir code as much as we can, but that doesn't mean that you can actually guarantee anything about a code path that is less traveled. dialyzer is also not the answer. Oftentimes we'll find ourselves in a situation where dialyzer complains because someone who made a major library simply doesn't use dialyzer. You might wonder why they don't in that case, because it would pick this particular issue up very easily, but the next time you run into some garbage error that dialyzer spat out that you are instantly reminded that you can neither trust it to be correct or safe, so people turn it off. Elixir has upsides: I think it's solidly the best language for creating servers of different kinds, but it's near useless after you pass a fairly short distance with it. I would absolutely never, in my personal endeavors (as opposed to my working contract) write an elixir server that actually tries to do anything meaningful itself other than just route messages to other servers.
- hinkley 7y agoI sometimes joke that microservices are half of Erlang, badly implemented (I guess Greenspun’s Curse is broken?). Elixir has been second or third on my todo list for a long time. With the scary news from Vue, it might have just jumped the queue.
- quells 7y ago> Scary news from Vue Do you have a link?
- ineedtosleep 7y agoHe's most likely referring to: https://news.ycombinator.com/item?id=20237568 https://news.ycombinator.com/item?id=20237568 Which is a bunch of FUD (see top comment by EvanYou).
- quells 7y agoThanks
- deleted 7y ago[deleted]
- di4na 7y agoThanks Robert Virding http://rvirding.blogspot.com/2008/01/virdings-first-rule-of-programming.html http://rvirding.blogspot.com/2008/01/virdings-first-rule-of-...
- hinkley 7y agoSee also, Stigler's Law. Or Poe's law, thus named in 2005, but based on a phenomenon that was well known by the time of Godwin's law.
- sansnomme 7y agoThe Authn/Authz story of Phoenix is a joke though compared to Rails/Devise or Django. The framework authors refuse to ship a first party implementation and instead leave it to the community. Problem is, the ones available are mostly extremely low level (ueberauth, guardian etc.) and you have to spend ages customizing it. On Rails it's literally two commands to set up user registration, email confirmation, password reset. Despite its supposed Rails roots, Phoenix has a long way to go (the greater irony is that the company behind Devise, Platformatec, is also the company behind Elixir). If you only need basic functionality and absolutely have to use Phoenix, Pow is a good choice: https://github.com/danschultzer/pow https://github.com/danschultzer/pow
- bitscrapper 7y agoAs someone who used Devise multiple times and always ended up regretting said choice in the long term, I am actually glad there is no Devise for Phoenix. In one day I can quickly get something up and running with Guardian and have full control over how my app does authentication. Password reset and confirmation are easily done with Phoenix.Token without a need to touch the database. Also, authorisation is a breeze on Phoenix. Take a look at Canada: https://github.com/jarednorman/canada https://github.com/jarednorman/canada - and it is only 10 LOC.
- pbowyer 7y ago> The Authn/Authz story of Phoenix is a joke though compared to Rails/Devise or Django. The framework authors refuse to ship a first party implementation and instead leave it to the community. I agree, but it's not unique to Phoenix. In the PHP world the otherwise excellent Symfony framework is only starting to add generation of authentication/authorization, and email confirmation and password reset remains the developer's responsibility. I see two reasons for this. 1. Frameworks see themselves as building blocks, not RAD systems. When the core framework developers are (mostly) working on APIs they don't see the need for approval/password reset. After all "you'll issue the user with a JWT so who cares about the rest (shrug)" 2. Flexibility to auth with anything. Apparently not bundling a system makes it more "flexible". I believe (1) to (a) be shortsighted and (b) we need RAD frameworks, of higher-level flexible components that can be bolted together. I believe (2) is wrong, and bundling standard auth flows does not reduce flexibility: you implement your own if you need something else.
- ncfausti 7y agoFantastic talk. I have been meaning to learn more about Elixr for a while now, and this video was perfect. Thank you!