Should I study HTML and CSS before Elixir?

Hello there,

I’m new to programming, but I want to start with functional programming. I would like to know two things:

  1. Should I study HTML and CSS first?
  2. Are they really essential for web development or does Phoenix replace them?
    I appreciate any help you can provide me. Thanks.
4 Likes

Hi @Hebert welcome and welcome to programming!

Especially when starting out, a bit of dabbling doesn’t hurt. Functional Programming and HTML / CSS are not very closely related, you don’t need to do one before the other. That said, playing around with a simple HTML file and some CSS can be very rewarding, so I would consider doing some HTML basics alongside your functional programming efforts.

HTML / CSS are indeed essential, but you don’t need to be an expert to get going. Phoenix doesn’t replace them, but rather in Phoenix you write Elixir code that generates html.

Taking a bit of a step back though, I would strongly caution against jumping into a web framework in any language if you’re new to programming. Take some time to learn HTML basics on its own, and take some time to learn the basic building blocks of a language.

You don’t need to be an expert at Elixir to use Phoenix, and there’s no harm in a bit of cargo culting when you get started, but you’ll be a lot less frustrated with your Phoenix code if you have a working grasp of Elixir fundamentals (and this holds true for any language / framework pair).

11 Likes

Oh my, if you are getting started with programming, elixir is one of the hardest languages to learn, because it is partly functional and includes a big feature set from the VM it is running on (OTP). I would recommend you to start it as simple as possible, you need first to understand the differences between MVC frameworks and API/spa applications, this will take you a little time until you map everything in your head.

3 Likes

I don’t know that I agree with that BUT it is also true that there isn’t nearly as much literature aimed at true novices in Elixir as there is in say Ruby, Python, or Javascript.

@Hebert if you try to get going in Elixir and are finding that you aren’t making much headway, please don’t be discouraged. I’d consider one of those other three languages to start with instead. If you start in Elixir and it works for you, I’d love to hear what resources you found helpful!

5 Likes

Another idea might be to start with something like Scheme/Racket, which will also encourage a functional style and which has a huge amount of educational content around it. Many of the ideas from Scheme will translate very well to Elixir.

One benefit, I will say, of Elixir: it’s extremely well documented. I find the Elixir docs to be a joy to browse, whereas other language references can be a bit of a slog.

4 Likes

I agree with that. In my personal experience when I started coding in elixir I was fresh from the university, there I had the experience of writing in classical OOP languages like java, c# but also in functional languages like scala. The first job I was hired at I was required to write elixir, and learning elixir took me a long time, even though we can say that elixir has a mix of functional, OOP and imperative languages combined. The problem is that if you want to understand on how to do anything meaningful in elixir, you need to know at least on how OTP works, and even to this day I find new things I didn’t know about OTP.

Should we compare this to ruby, it is a big difference, because even though phoenix and ruby on rails are very close as how to use them, ruby by itself is very basic langauge, with a very limited functionality.

2 Likes

You can make a website with just HTML and CSS, no programming language involved. They are essential. Most likely you will also use Javascript.

You can make a program in Elixir (or any other programing language) that runs, for example on the command line, without a website or any other user interface.

Functional programming and web development are two separate concepts, although can be used together, like with Phoenix. Start with the one that most interests you.

6 Likes

Hello Ben, and all the nice people who have helped me with this question.

This is my first time participating in any forum and I don’t feel so alone anymore. Thank you all for your kind responses.

I understand what you are saying, although I admit that I have read your answers several times to have a clearer idea.

Please allow me to explain my real concern: For a good few months I have been studying some Python and Java, learning the basics (variables, conditionals, loops, functions, etc.) in Collab and IntelliJ respectively. That has given me a very general idea of what programming is about.

But a friend of mine who is a programmer in Germany tells me that functional programming is much better for many reasons. So I went ahead to read a lot of forums about it, and I agree with him. Elixir seems to me an excellent alternative for my taste.
Although I am aware that it is not easy to learn, I have found good material that I think can help me to start from scratch. Elixir poses an enormous challenge and I love challenges.

My real concern is that most people on the forums I’ve read so far imply that it’s almost impossible to learn Elixir as a newbie, without knowing OOP first, and without having some programming experience. But a minority see it as an advantage because I wouldn’t have to unlearn many OOP features that would make the transition to FP more difficult.

Please give me your opinion on whether or not not knowing OOP is really a handicap for learning FP.

About HTML and CSS:
My wish is to become a backend developer, so I guess worrying about HTML, CSS, JS and Phoenix should be a topic for later right?

Forgive me for this long post, and thanks for taking the time to read it, but I just wanted to provide more context.

Good night everybody.

5 Likes

Hi @Hebert thanks for elaborating, it is very helpful.

At the phase of learning you are at, my personal philosophy is that curiosity and dedication are far more important than whether there are optimal learning materials. If you find yourself curious about Elixir, and you’ve already done some amount of programming in other languages, I think you’ll do just fine.

The “Programming Elixir” book by Jose Valim I think is a reasonably good place to begin. If you’re already familiar with the idea of variables, loops, and functions that should be plenty. I think the attitude you’re displaying here will get you far, and we’ll be here if you get stuck!

You can certainly punt on it for a little later. Your first foray into Elixir will likely focus on having to rethink mutability, and rethink how loops work. Once you’re comfortable with that, and comfortable with data manipulation, the next big hurdle with Phoenix / Backend dev really has more to do with databases. Let’s talk about backend work for a moment:

The Backend

At a basic level, Phoenix offers a relatively simple, functional approach to the universe of web frameworks. A request from the web comes in and is represented as a simple data structure, and then you transform (functional idea) that data structure into something that constructs a reply to send back, and voila!

So in one sense, you can hop straight from Elixir fundamentals into the basics of Phoenix since the core request / response model is a lot like the Elixir you will have done before.

Small side bar: I’ve been talking about Phoenix, but Phoenix’s core HTTP stuff is built on top of a simpler web framework called Plug. For basic request => response stuff I’d consider simply playing around with plug for a few weeks on its own. Phoenix ships with a LOT of batteries included to help get developers going, but the JS, CSS, HTML, and associated build tools it generates can be quite dizzying at first. If you start with a simple Plug request / response you’ll be oriented towards Phoenix’s approach a bit better.

So about databases: A HUGE part of “real world” backend work involves communicating with a database in order to fetch information that the request wants, or save information that the request has sent you. It’s at this point that familiarity with SQL and databases in general becomes the hurdle to climb. There are a lot of databases that you can talk to in some flavor of SQL, but in the Elixir universe I’d strongly recommend PostgreSQL. It’s very well supported, it works well from dev to production, and there’s a lot of learning materials for it.

When you generate a new Phoenix app it will include a library called “Ecto” for you, and Ecto helps you talk to SQL databases in Elixir. Personally I think it does a very good job of balancing making that easy, without hiding too much of how SQL works from you.

Personally, I’d consider taking a detour and doing some pure SQL educational material so that the basics of tables, queries, inserts, etc are at least mildly familiar to you. At that point you should be well prepared to generate and utilize a full Phoenix application.

P.S. Very final addendum: Avoid windows for Elixir dev. It works, but there are definitely Windows specific issues you’ll run into, and there are a LOT less developers here who use Windows, meaning that there are a lot less people who can get you unstuck from those questions. Linux or MacOS is where it’s at. If you absolutely must use windows, consider WSL2 so that you can have Ubuntu inside of windows.

8 Likes

Not at all. If anything else, some CS professors reported that if students pick FP first they learn it faster compared to those who had previous OOP background.

The “you should know OOP first” advice is people judging by their own experience. No malice on their part, just assumptions.

The whole idea of programming can be boiled down to: you get data in, you change it somehow, you export it out. That’s all that every software ever does. FP helps you think of programming exactly in those terms e.g. Enum.map changes a collection of records to another collection where each record has been modified by passing it to a function:

[1, 2, 3, 4]
|> Enum.map(fn x -> x * x end)

This yields [1, 4, 9, 16] which is not surprising if you can already read even a little bit of Elixir (basically pass each list element to the provided function and return a new list, in this case the function is squaring its argument; the old list is not touched – this relates to @benwilson512’s comment about immutability and it’s HUGELY important, you should not make another step until you fully understand mutability vs. immutability).

Conversely, a normal for loop in the imperative languages does it like so (and it changes the original list in the process):

list = [1, 2, 3, 4]
for i = 0; i < list.length; i++ {
  list[i] = list[i] * list[i]
}

I and many others like FP more because it shows you what does a transformation do, whereas imperative languages show you how something is done and leave the “what” to be interpreted and mentally parsed by you, the human reader. Which makes reading imperative code harder (IMO). This is also why people sometimes say FP is more declarative than OOP / imperative.

8 Likes

Totally agree with this.

Then I have very good news for you! The part of HTML/CSS you need to learn is just a couple of basic things. Take a day or two, when the time comes, and you’re good to go! I may be exaggerating a little bit, but the idea is there. It will just be a simple formality for you to complete, whenever you decide to learn it.

For JavaScript it’s a bit different but the basics shouldn’t be too difficult. We can even do without it sometimes if we are looking for a minimalist frontend design without certain animation and other effects.

To illustrate my point, for example, I hate CSS and I just know a couple of things and it’s enough for me to collaborate with other developers who are more frontend oriented. If I work alone, I can do something that may be a little graphically ugly, but it still shows up in the browser. :sweat_smile:
For something prettier I can use free or paid ready-made HTML templates.

Once you’ve learned the basics of HTML/CSS and Js, you just have to integrate your backend code into ready-made frontend templates.

There is nothing to worry about at all. You can learn the basics of HTML whenever you want or when the need arises. And it won’t take long.

3 Likes

If you plan to do web programming, you’ll need to get proficient at HTML. Fortunately, you won’t need to know all that much to get started. Also, don’t work too hard at learning CSS or JavaScript. As I understand what @chrismccord has been saying, Phoenix and LiveView will soon abstract most of their trickier bits.

For most use cases, you’ll need to know how to use relational databases (typically using Ecto and SQL). However, I’d suggest that you start out by ignoring all that. It’s quite possible (and a lot simpler) to create web sites that don’t use databases.

Although Elixir makes very heavy use of macros, you typically won’t need to write (or even read) many of them. So, learn the difference between functions and macros, and try writing some macros for fun, but stick with writing functions until you need to do something that requires a macro.

Similarly, Elixir uses a lot of recursion (which can bend your brain), but library functions and macros (e.g., filter, map, reduce) hide a lot of this in most Elixir applications. That said, do study and try writing some recursive code, because eventually you’ll have to write some in anger.

Some of the biggest challenges you will face have to do with learning (and keeping up with) the Elixir and Erlang tool sets. There’s a lot to learn here and more goodies arrive with great frequency. However, that’s also a large part of the fun…

-r

4 Likes

Welcome!

I think/gather past experience with OOP can both help and hinder in different ways.

If you want to learn Elixir/a functional language, go for it. There’s no shortage of learning materials and support.

Oh, and about HTML and CSS, having a decent grasp of the basics will serve you well.

2 Likes

Further to what everyone else has said, check out @radar’s free book which is aimed at those new to programming:

With regards to HTML and CSS, the good news is you could pick up the basics in a few hours - try the tutorials here:

Good luck and let us know how you get on :023:

4 Likes

Hi @Hebert, I am also new to programming and am entering by way of Elixir/Phoenix, interested in the back end as well.

I found that HTML was good for getting into first gear, so to speak. So I guess technically you don’t have to explore HTML/CSS before Elixir or any other language but I believe I benefited from doing so.

You might be seeing it possibly as months that you would have to commit to going through the fundamentals before finally getting into Elixir but I’ll tell you it’s more like a few weeks at most to be competent in basic HTML/CSS. Freecodecamp was good for me.

4 Likes

Good afternoon everybody,

I want to thank everyone who has contributed their valuable input and ideas. I have been carefully reading your tips, researching and collecting the materials that aim to help beginners like me. I really want to learn how to program in Elixir, and this is the list of resources that I have found, thanks to your suggestions and all the blogs that I have read here in the forum (There have been many). I think most of them fit my level.

Please select all the options you know are the best, and comment on the order in which I should study them. I’ll be very grateful.

BOOKS:

  • Elixir Succinctly
  • How to Design Programs
  • Joy of Elixir
  • Toy Robot
  • Introducing Elixir: Getting Started in Functional Programming
  • Learn Functional Programming with Elixir
  • Programming Elixir 1.6
  • Elixir in Action
  • Programming Phoenix
  • Adopting Elixir
  • Learn To Program ↣ Explanation below.
0 voters

Elixir Succinctly

Free Ebook - Elixir Succinctly
➫ I’m halfway through
➫ Free online book

How To Design Programs

How to Design Programs, Second Edition
➫ Taught in the Racket language
➫ Free online book to learn how to write elegant and well designed code, is what I read.

Joy of Elixir

Joy of Elixir by Ryan Bigg
➫ Free eBook, I’ve read great comments about it.

Toy Robot

The Toy Robot by Ryan Bigg
➫ It’s not free, but I already bought it.

Introducing Elixir: Getting Started in Functional Programming

Introducing Elixir: Getting Started in Functional Programming
➫ Maybe it is a good option to start me in this paradigm?

Learn Functional Programming with Elixir

Learn Functional Programming with Elixir
➫ Many of you have mentioned that this one is appropriate for beginners. I just wanted to include it in this list.
➫ I already bought it.
➫ Recommended several times by AstonJ and other members.

Programming Elixir 1.6

Programming Elixir 1.6
➫ I already bought it
➫ Recommended several times by AstonJ and other members.

Elixir in Action

Elixir in Action, Second Edition
➫ I already bought it
➫ Recommended several times by AstonJ and other members.

Programming Phoenix

Programming Phoenix 1.4
➫ Recommended several times by AstonJ and other members.

Adopting Elixir

Adopting Elixir
➫ It seems that it is for all levels according to the Pragmatic Bookstore page.

Learn To Program

Learn to Program, Third Edition by Chris Pine
➫ Finally, some of you have said that this book was the motivator to start programming, and that it laid the foundation for your career.
➫ I don’t know if going this way is more beneficial for me, since I’m not a programmer. What worries me is that Ruby is an imperative language and I am afraid that I will have to unlearn OOP things to learn Elixir later. Our friend benwilson512 recommended the following:

I want you to know that I’m not in a hurry, I just want to know if starting here turns out to be a better alternative. I have learned the syntax of Python and Java, doing some simple exercises throughout the year 2022. The only language I have learned at an advanced level is English, because I am from Colombia. :grin:

COURSES:

  • Discover Elixir & Phoenix ↣ ludu
  • The Complete Elixir and Phoenix Bootcamp ↣ Udemy
  • Elixir Course Online ↣ Prograils
  • Introduction to Elixir ↣ Linkedin
  • Elixir Course ↣ Github
  • Become an Elixir Programmer ↣ Educative
  • Elixir and Phoenix for Beginners ↣ KnowThen
  • Elixir for Programmers, Second Edition ↣ Video course.
0 voters

Discover Elixir & Phoenix ➫ ludu

Discover Elixir & Phoenix

The Complete Elixir and Phoenix Bootcamp ➫ Udemy

The Complete Elixir and Phoenix Bootcamp
➫ I already bought it

Elixir Course Online ➫ Prograils

Elixir Course Online | Prograils

Introduction to Elixir ➫ Linkedin

Introduction to Elixir

Elixir Course ➫ Github

Elixir Course

Become an Elixir Programmer ➫ Educative

Become an Elixir Programmer

Elixir and Phoenix for Beginners ➫ KnowThen

Elixir and Phoenix for Beginners

Elixir for Programmers, Second Edition ➫ Dave Thomas

Elixir for Programmers, Second Edition ➫ Video course by Dave Thomas .

In the mean time I am watching a wonderful course titled Crash Course Computer Science on YouTube, which have taught me a lot of great things about computers and programming in general.
I have a serious compulsive hoarding problem :wink:

Any suggestions about the order you guys would follow if you were new to programming or any extra material not on this list would be greatly appreciated.

That would be all. Thank you so much for your participation in this survey. I hope it helps me decide which way to go. And thank you very much for this forum. I found it an exemplary place to ask questions and get help.

Have you heard of analysis paralysis? :slightly_smiling_face:

The order doesn’t matter. Learning is messy. Just pick one and start. In the time it takes to analyse the options you can already at least have learned the basics.

4 Likes

Yep. Nowadays I wouldn’t instruct anyone to start with books at all.

CS is quite interesting and sadly I never studied it formally but it didn’t stop me from getting quite far in my career (though I did feel the gaps several times, can’t deny).

The value of computer-skill-related books these days to me is somebody explaining to you deeply and in detail, clearing the fog along the way. That’s invaluable and that’s super important for people who want to learn.

The rest? It can come naturally with enough practice. Or with dedicated books. From one point and on it becomes a personal choice really.

I’ll chime in again and say that learning SQL has been great reinforcement. Knowing the structure of queries and database principles has helped a lot. It’s allowed me to dive into Ecto and I’m having a lot of fun.

2 Likes

What I saw a lot at my workplace and when talking with a lot of developers, the tendency read a lot of books without applying them in practice. While those people could explain to you some of the most intricate details about a technology, they have a very big gap on how to apply the knowledge proficiently, and this is not only about with beginners.

The thing that a lot of those people lack is general understating of the technology, that in my opinion is the most important skill, be it for a company owner, manager or developer.

The hatred that I have currently for this industry are the fact that seniors that naturally learn those things, tend to hire these kind of people, thinking that they have the other skills required, leaving the people that can switch from different technologies without a possibility to apply for the job. I have countless companies in my country that would rather invest in students, having a great risk of failure, than in developers who want to switch to a different area or technology.

1 Like