New to programming, how should I proceed in learning Elixir?

I work in IT as a network admin and am new to programming. There are a lot of resources for learning Elixir but it seems that not many are truly geared towards individuals without programming experience.

I am looking for recommendations such as what resources and in what order, etc.

Any insight would be greatly appreciated.

Regards,

Rich

2 Likes

In order to understand elixir, you need to understand how functional programming works first. As you might already know, there are a lot of differences between OO and functional programming. I guess Wikipedia have a lot of resources regarding this subject. This knowledge is necessary for you to think in functional way. If you think that is enough, you can try out the elixir-lang getting started page. It have a good overview about elixir. Programming Elixir is another good resource. Then you can learn one of elixir framework, Phoenix. If Elixir is your first destination, then it is great. Because youā€™re not yet affected by OO mindset. But be aware, most of programming job you meet is going to be OO. English is not my native, I hope you understand what Iā€™m saying :slight_smile:

1 Like

Youā€™ll find tons of valuable info about which direction to pick in this thread:

4 Likes

I think that the Programming Elixir book by Dave Thomas is probably the one that is most readable without prior programming experience. Of course, the guides on the elixir-lang.org website are meant to be great beginner-material as well.

Of course, most of us have been programmers for a longer amount of time, which makes it hard to think from the mindset of a novice, and which therefore makes it harder to write guides/books that do not assume certain ā€˜base understandingsā€™ that we take for granted.

So most importantly: There are no dumb questions. We here at the forum are there to help when something is unclear to you :slight_smile: , so ask away!

4 Likes

What are your goals? If you want to find immediate employment you will have very limited options in the short term basically Dockyard and a small number of startups and a small number of consulting shops. Itā€™s also very likely you will be expected to know Ruby and Elixir. In a longer term knowing Elixir will be enormously valuable given the evolution of hardware the model that BEAM offers will be the optimal option for prob. 80% of apps going forward with to be honest no viable alternative.

I have to say it seems telling someone whoā€™s never coded before that there are differences between OO and Functional Programming seems a bit beside the point. Heā€™s got no OO habits to unlearn.

ā€“
Onorio

7 Likes

Muhifauzan, thank you for your response. I will read up more regarding functional programming.

1 Like

Karolsluszniak, thanks for your response. I have definitely kept an eye on that thread. Itā€™s cost me a little bit of $$ having purchased many of the books listed :slight_smile:

1 Like

Hi Rich,

Start with the smallest and simplest things you can do. Have you gotten Elixir installed on a machine where you can play with it? Do you have a good text editor (e. g. Sublime Text)? If youā€™ve got all that then choose a relatively simple task and try to figure out how to make it happen. Thereā€™s a reason that most first applications are simply printing a short string to the console. Remember the small and simple task doesnā€™t have to be anything practical. Itā€™s more important to grasp the concepts underlying the coding language than it is to produce something practical right out of the gate.

The most important thing is to realize thereā€™s no ā€œcorrectā€ path to learning how to write codeā€“in Elixir or any other language for that matter. And each of us learns differently. Some learn better via books and text and some learn better via video. If you know which style works best for you, please share that and we can give you a bit more guidance.

Speaking only for myself I taught myself to code by using the language docs I had and simply typing the code examples they had in the book and running them. Once I got the output I expected I would go back and carefully modify the code and then re-run it to see what happened. That helped me not only to learn the language it also helped me to understand why the code was written the way it was.

ā€“
Onorio

6 Likes

Thanks Qqwy. I have slowly been reading through Daveā€™s book. I think my biggest hurdle at this point is trying to apply the concepts Iā€™ve read in the books to something Iā€™d like to work on.

For instance, I have a file that Iā€™d like to parse. It contains a computerā€™s routing table and Iā€™d like to retrieve the information regarding a specific prefix (e.g. 2.2.2.2).

I have the following:

route = with {:ok, file} = File.open("routes.txt"),
              content = IO.read(file, :all),
              :ok = File.close(file),
              [prefix] = Regex.run(~r/2.2.2.2/, content)
         do
                  "Prefix: #{prefix}"
         end

IO.puts route

When I run iex routing-table.exs it correctly outputs 2.2.2.2

Two things: could I simply the code? How can I utilize something like IO.gets to dynamically take user input and search for that input instead of my static 2.2.2.2?

3 Likes

Andre1sk, my immediate goals are for self-development. Iā€™d like to add the ability to code to my skillset. I am not sure that I will be seeking employment in the near future. Iā€™d like to use programming to assist me in my current employment, like devops. Who knows where it goes from there, perhaps one day I will code for a living.

1 Like

Onorio, thanks for the insight. I have Elixir installed and am using Atom for text editing. I think that I learn by briefly going over the concepts and then by doing. Lastly using books and perhaps videos to supplement or fill in gaps.

2 Likes

If thatā€™s the case then I would start with books. Start by typing sample code from the book and try to understand what the sample code is telling you. Then modify the sample, re-run it and see what happens to see if youā€™ve understood it right.

1 Like

Will do

4 Likes

For DevOps type thingies Elixir is a very good match in my opinion. If you need to to absorb preprocess and store large number of event streams etc. with good HA and throughput guarantees Elixir/Erlang is a very good match.

2 Likes

@ thinkpadder1, thanks for sharing the writing a command app in Elixir link! That is pretty helpful.

1 Like

If I were ā€œnew to programmingā€ right now, I would pray that someone would point me towards How to Design Programs, 2e and convince me to stick with it [1]. Your immediate reaction would likely be ā€œwhy Racket - never heard of itā€? The short explanation is that Racket is a ā€œfamily of languagesā€, i.e. Racket has multiple dialects from a very basic one for beginners up to advanced ones that support OO and static typing (itā€™s earlier name was PLT Scheme - so yes, at its core Racket is a functional language) that were designed to teach you many of the varying concepts that are important in programming/program design in general.

Now I understand that everyone wants to learn their first ā€œuseful programming languageā€ as soon as possible [2] and that most people would prefer to work in just one, their favorite language but the reality is that software developers have to work in multiple languages, not only serially (in time) but also in parallel. The first language you learn is going to have a tremendous impact on how you are going to think about programming. For some time your mind is going to treat ā€œprogrammingā€ and ā€œyour first languageā€ as equivalent.

Elixir may not be a bad choice as the first ā€œapplied programming languageā€ but every ā€œapplied programming languageā€ tends to have its own (domain) focus and its own quirks - both of which can get in the way of learning your next language whatever that may be. Racketā€™s goal is to teach you a general way of thinking about programming and program design - so that it will be easier to assimilate the languages that follow.

From The Structure and Interpretation of the Computer Science Curriculum [2004 PDF]

In general, we believe that the HTDP project has validated the usefulness of functional programming and functional programming languages in the first programming course. We have found that teaching Scheme for Schemeā€™s sake (or Haskell for Haskellā€™s sake) wonā€™t work. Combining SICP with a GUI-based development environment for Scheme wonā€™t work better than plain SICP. The two keys to our success were to tame Scheme into teaching languages that beginners can handle and to distill well-known functional principles of programming into generally applicable design recipes. Then we could show our colleagues that a combination of functional programming as a preparation for a course on object-oriented programming is an effective and indeed superior alternative to a year on just C++, Java, or a combination.

We are hoping that other functional communities can replicate our success in different contexts. We suggest, however, that using plain Erlang, Haskell, or ML and that teaching programming in these languages implicitly will not do. We all need to understand the role of functional programming in our curricula and the needs of our students.

FYI: back in 2004 OO was still seen as essential (rather than widely misapplied).

[1] Because it would save me from having to go through the agony of having to unlearn bad habits and ineffective / counterproductive mental models that result from the ā€œquirksā€ that any applied programming language invariably has.

[2] Either because they already have something in mind that they want create or to become quickly ā€œemployableā€.

See also: Why Racket? Why LISP?

12 Likes

Thanks Peerreyndersā€¦I will check out the info that you referenced.

In regards to that last point, I have confess Iā€™ve always been conflicted between ā€œLearn A Language To Be ā€˜Employableā€™ā€ and ā€œLearn A Language Because It Opens My Mind To New Approachesā€. Iā€™ve been fortunate in that I can still work with languages which I donā€™t care for but which keep me in a day job :slight_smile:

1 Like