Elixir Programming Introduction - Complete Tutorial!

Поделиться
HTML-код
  • Опубликовано: 1 дек 2024

Комментарии • 76

  • @codebreakthrough
    @codebreakthrough  Год назад +9

    Let me know if you want more Elixir content!
    💰 FREE Software Dev Intro Course - calcur.tech/free-dev-course
    💯 FREE Courses (100+ hours) - calcur.tech/free-courses
    *Timestamps:*
    00:00:00 - Intro
    00:01:23 - Why use Elixir
    00:03:48 - Installation and Setup
    00:07:15 - Intro to Mix
    00:09:02 - Overview of Elixir Files
    00:10:52 - Running and Elixir Script
    00:13:40 - Compiling Elixir
    00:16:36 - Running an Elixir Application
    00:23:29 - Intro to Hex
    00:25:40 - Basic Types
    00:26:53 - Creating a Variable
    00:27:52 - Module Attributes
    00:29:01 - Atoms and Strings
    00:35:35 - Strings
    00:38:40 - More about Hex
    00:39:49 - Numbers
    00:47:39 - Compound Types
    00:47:53 - Dates and Times
    00:50:50 - Example App - Time Until the New Year
    00:56:27 - Tuples
    01:01:59 - Lists and Loops
    01:04:15 - Mapping
    01:04:47 - Structs
    01:11:46 - Building a Guessing Game - Taking User Input
    01:14:00 - if Statements
    01:15:07 - Random Number
    01:16:26 - Docs and Arity
    01:17:28 - Cases and Errors
    01:19:19 - Case
    01:22:23 - Lists
    01:24:16 - Append and Prepend
    01:25:29 - Comprehensions with Conditions
    01:27:22 - Functional Programming
    01:30:07 - Defining Custom Functions
    01:34:41 - What’s Next?

  • @alex6455
    @alex6455 Год назад +56

    My first job out of college requires me to learn Elixir. It’s a beautiful language but stuff like pattern matching is still unclear to me. This video could not have come at a better time. Thank you Caleb.

    • @AIMadeSimple007
      @AIMadeSimple007 11 месяцев назад +4

      I find this video to be good; however, it doesn't delve deeply into explaining pattern matching. It briefly compares it with destructuring assignment in JavaScript, but they are not identical. Pattern matching fundamentally involves attempting to match values to patterns. If successful, it can also deconstruct a value into its constituent parts, akin to destructuring. It's important to note that pattern matching is not only used for value deconstruction but also in control flow, such as determining which function to dispatch, Hope this helps

    • @samuraijosh1595
      @samuraijosh1595 8 месяцев назад +2

      the elixir syntax for pattern matching is too verbose, thwarting you from seeing the core idea of pattern matching, just ask chat gpt or gemini simple examples of pattern matching in Haskell. that shoulld visually explain itself, its a pretty simple concept really.

    • @laurent4027
      @laurent4027 3 месяца назад

      @@AIMadeSimple007 what is so poweful (ihmo) is that i love so much the strategy pattern in OOP and Elixir / FP let me do this kind of stuff natively through pattern matchingn it"s sooo powerful, elegant and intuitive.

  • @codex8797
    @codex8797 9 месяцев назад +20

    Thanks bro. 4 years ago I learned how to code with your C crash course. 4 years later I am in my last year of computer engineering, and am learning Elixir from you. You have had a huge impact in my learning carreer, and I am really thankfull for it. Greetings from Brazil!!!

    • @eacarvalho
      @eacarvalho 5 месяцев назад +3

      Não é engraçado aprendermos em inglês sobre uma linguagem BR?

    • @codex8797
      @codex8797 5 месяцев назад

      @@eacarvalho it sure is hahaha

  • @marto642
    @marto642 11 месяцев назад +8

    "And for seconds.... I will just call it seconds for *ease of pronunciation* " - You got a laugh out of me

  • @sharokhkeshawarz2122
    @sharokhkeshawarz2122 Год назад +3

    WHAT! This is one of the best coinsidense of my life, i litrally wanted to start learning elixir and you did a video 6 hours ago XD dang it, Your the one who tough me coding :) love you man!

  • @LeslieRussell
    @LeslieRussell Год назад +2

    two quick things. after a couple of days poking around in elixir and mix i realized that elixir mix give new learners an advantage because it has builtin testing suite.
    the way you show for testing your code works well but if you make use of the built in testing and write tests first you get a boost. especially if you try and follow tdd.
    you can add the credo package and set it to strict and that (quoting the package docs) acts like rubocop run mix credo and you get a report covering your code that offers suggestions for refactoring and idiomatic preferences.
    then run mix test and correct all your fails

  • @ArashAkbarpour
    @ArashAkbarpour Год назад +4

    New video just in time. Started the joy of elixir and need some really cool crash course. Thank you. Very appreciated if you do more on elixir .
    Keep on your good work Dear Caleb.
    Wish you the best.

  • @lacerdae
    @lacerdae Месяц назад

    Nice work, man. I had some knowledge on the basics of Elixir but you summed up the concepts well while giving some depth. Keep going

  • @LeslieRussell
    @LeslieRussell Год назад +4

    yes! much more elixir content please

  • @zscoder
    @zscoder Год назад +1

    Heck ya, I'm here for it 🤘🏼

  • @lunarwitch1967
    @lunarwitch1967 11 месяцев назад

    thanks m8, i tried two different teachers but your explanations are best so far!

  • @flubba86
    @flubba86 8 месяцев назад +2

    This is definitely the best beginner video on Elixer. I found your delivery style very easy to understand. My only criticism is about the tangents to basic fundamental concepts like hex and number systems. It's not necessary to explain those basics in such detail in a video like this.

    • @GeniusMBM
      @GeniusMBM 6 месяцев назад

      I think those small tangents can be helpful and insightful. You can always skip parts you don’t find necessary.

  • @KeithScally-w4y
    @KeithScally-w4y 4 месяца назад

    Great intro, thanks for putting this together!

  • @incognitohacks4850
    @incognitohacks4850 11 месяцев назад

    Loved your C series and now your doing elixir. I just started learning it as a functional language. W channel

  • @Jam-ht2ky
    @Jam-ht2ky Год назад +2

    More content on elexir would be much appreciated, saw your new video its awesome

  • @Jam-ht2ky
    @Jam-ht2ky Год назад

    Best elixir video, thank you again your videos are always of huge help and a great starting point for learning new things

  • @ajanyhc
    @ajanyhc 4 месяца назад

    On the 3rd way of running the app, I get the following compile error "(UndefinedFunctionError) function ElixirLS.LanguageServer.Dialyzer.Supervisor.start_link/2 is undefined (module ElixirLS.LanguageServer.DialnguageServer.Dialyzer.Supervisor is not available" , What am I missing?

    • @ajanyhc
      @ajanyhc 4 месяца назад

      I modified it to Supervisor.start_link([]) and all is well!

  • @HAAAAAA614
    @HAAAAAA614 8 месяцев назад +3

    22:40 Great video, but maybe, just maybe don't randomly open a light-themed page after being on a dark theme for the past 20 minutes page

  • @easypeasyrun
    @easypeasyrun 10 месяцев назад +3

    Caleb is an awesome teacher! I don't have a laptop to code. But, still I am getting the basics and feel of how powerful exilir is :).
    Thank you!!

  • @JohnWickXD
    @JohnWickXD Год назад +1

    Thank you so much Caleb❤

  • @Anibulus
    @Anibulus 8 месяцев назад +2

    It's a great tutorial. Works well for people without programming basses, and excelent for people who code. I mean, just need the sintaxis

  • @eritert
    @eritert Год назад

    Awesome. Since your C series was so good I am going to check this out.

  • @kangwamark24
    @kangwamark24 8 месяцев назад

    When I type in “iex -S mix” it keeps bringing an error saying a parameter cannot be found that matches parameter name ‘s’

    • @trevikpeterson
      @trevikpeterson 5 месяцев назад

      The ‘S’ needs to be uppercase

  • @freaklore
    @freaklore Год назад +1

    On Windows you would have to add .bat so: iex.bat -S mix

  • @Quenjii
    @Quenjii 11 месяцев назад

    Great video. I think it would've been really useful to show how to use functions defined in a module in another file.

  • @vibrancydevelopers.9420
    @vibrancydevelopers.9420 3 месяца назад

    Hi Caleb am new to phoenix and I am trying to install it on my windows machine and am getting an error (RuntimeError) tailwind is not available for architecture: win32. DO you know how I can fix this error?

  • @tim_from_braid
    @tim_from_braid Год назад

    Great video, would definitely like to see more

  • @TheRealCornPop
    @TheRealCornPop 4 месяца назад

    Awesome introduction. One small comment, it would be great if you explained why Time.new, Date.new, DateTime.new usage didn't compile. I get that adding the ! character works, but it would have been good to know why the failure occurred in the first place. It seems like those functions without the ! character return a tuple of {:ok, result}

  • @nayeemurrahman8221
    @nayeemurrahman8221 Год назад

    I am always getting this error on mac m1, when I do anything in the "mix new project" folder, eg: mix compile,
    Compiling 1 file (.ex)
    == Compilation error in file lib/learning.ex ==
    ** (ArgumentError) could not call Module.put_attribute/3 because the module Learning.MixProject is already compiled
    (elixir 1.15.7) lib/module.ex:2310: Module.assert_not_readonly!/2
    (elixir 1.15.7) lib/module.ex:2007: Module.__put_attribute__/5
    lib/learning.ex:2: (module)

  • @treangle
    @treangle 8 месяцев назад

    Banger! 🔥

  • @chopinplaya
    @chopinplaya 9 месяцев назад

    So how do you get the datetime code to compile without using bang? 50:40

  • @jsonkody
    @jsonkody 10 месяцев назад

    42:35 When I think about it this make sense since you know that every int could be float without loosing information AND integer division really looks more like a nonsense/bug than a feature

  • @Redyf
    @Redyf 7 месяцев назад

    Great stuff, thanks for sharing with us

  • @cryswerton-silva
    @cryswerton-silva 6 месяцев назад +1

    Nice!

  • @dumble_dev
    @dumble_dev 11 месяцев назад +2

    Elixir + phoenix, count me Subscribed🥳

  • @ksaitor-tv
    @ksaitor-tv 6 месяцев назад +1

    Awesome tutorial! But is it “put s” is it “puts”? 😅

  • @emetonjosolomon
    @emetonjosolomon 10 месяцев назад

    Def love this...

  • @nobudev
    @nobudev 6 месяцев назад

    More elixir/phoenix content please 🙏

  • @anusornchaikaew2567
    @anusornchaikaew2567 9 месяцев назад

    Thank you very much

  • @nicolaskevin4046
    @nicolaskevin4046 9 месяцев назад

    Thank you!

  • @zhigechen7318
    @zhigechen7318 Год назад

    Nice job! Caleb Curry!

  • @hikaru_hajime941
    @hikaru_hajime941 Год назад +4

    CLASH ROYALE/CLASH OF CLANS REF!!!!?

  • @lancemarchetti8673
    @lancemarchetti8673 9 месяцев назад

    Brilliant

  • @ya64
    @ya64 7 месяцев назад

    It’s the first time I heard hexadecimal being referred to as just “hex”.

  • @PaulSebastianM
    @PaulSebastianM 6 месяцев назад

    Elixir looks a lot like F#, except it is clearly influenced by Erlang, which it runs under.

  • @TJ-hs1qm
    @TJ-hs1qm 6 месяцев назад

    friendly reminder on how floating point works:
    ruclips.net/video/zzSmQvMOrm4/видео.html
    Notice that a function/calculation returning 2.0f could mean that the true result of the calculation was 1.99999999
    So the number 1.99999999 could be rounded to 2.0f when represented in single precision floating point.
    But a function returning an integer 2 will unmistakably represent the exact value 2.

  • @edgardevelops
    @edgardevelops 9 месяцев назад

    Anyone experiencing ElixirLS cannot connect to server. Just downgrade the plugin to v0.13.0

  • @JohnDoe-np7do
    @JohnDoe-np7do 6 месяцев назад

    Wow who wouldve taught learning crystal for fux would be beneficial 😂

  • @TedMosby-p9i
    @TedMosby-p9i Год назад +2

    hmm functional programming, his last name is "Curry" ... hmm

    • @AIMadeSimple007
      @AIMadeSimple007 11 месяцев назад +1

      So he should implement function currying in Elixir :)

  • @kidusabebe2645
    @kidusabebe2645 11 месяцев назад

    DAY 1 OF LEARNING ELIXIR.
    DEC-15-2023

  • @earl2907
    @earl2907 11 месяцев назад

    Trimming armor 5k

  • @shubhampawar7921
    @shubhampawar7921 8 месяцев назад +1

    An absolute useless video. I got my hopes but the video teaches you nothing about elixir but rather how to use built-in packages to do meaning less tasks.
    Didn't fully cover pattern matching, pipelines, concurrency , etc. did not cover what makes elixir stand out instead just repeated things that you can just read documentation about.
    This could very well be python tutorial or any other language tutorial because the real meaning of the language is not shown at all.
    To anyone reading I would recommend reading either the Programming in Elixir 1.6 or Adopting Elixir(my favourite) which give a great overview of why elixir and how to elixir

    • @barmaley-division
      @barmaley-division 6 месяцев назад +1

      All the video courses I've encountered, whether short or long, free or paid, have been much less helpful than almost any book on the subject. Books provide more organized, refined, and detailed coverage, and all the important concepts and contexts can be found within them. Still, some people are more comfortable with video or narrated formats rather than sitting with books (even if it sounds... weird... for someone who will inevitably have to read many manuals/guides/references as part of their development job). So, if someone needs a refresher or is okay with picking up bits and pieces on the go, this video might be useful to them.

  • @wassimyazbekk
    @wassimyazbekk Год назад +2

    3rd viewer

  • @andrew1550
    @andrew1550 10 месяцев назад

    Elixir triggers me, I thought this was a functional language. `Enum.each(array, fun)` is completely wrong! It should be `Enum.each(fun, array)`. How else can you compose functions together? Is there even currying?

    • @user-rl7hm7ix5n
      @user-rl7hm7ix5n 9 месяцев назад

      There is no automatic currying in elixir. But even with currying, there's no reason why each(arr, fn) would be "completely wrong". Wanting to curry just each(arr) and composing it with another function is something that happens, as far as composability goes there's no rule about what should come first.
      The order of arguments is a design choice based on what makes sense for the language (taking into account for instance what is the most common usage).
      It just happens that in elixir it's way more common to want the array in the first argument because of the pipe operator.

    • @Devfromnull
      @Devfromnull 9 месяцев назад

      The main reason is to facilitate piping using the pipe |> operator. This passes the result of the previous function call into the next function call. Its very common to see patterns like this:
      Enum.map(items, fn item -> item.id end)
      |> String.downcase()