Projects for a Beginner

Ah, okay, seems “easy”

I kinda don’t understand docs… And it’s in a language I’ve never touched either.

OTP is also included in Elixir.

Have You heard about GenServer? Supervisor?

It’s about that…

Nope. Never heard about any of those. Maybe bc I’m bad at any language I touch and I don’t stay in the same lang for much time(I dunno what do on them), but it could be any other reason.

Here is the Elixir doc.

It’s right after the Getting Started section.

Sorry, I don’t understand docs.

Imagine You could turn any sequential code into concurrent mode…

You could use hundred of thousand of processes, each isolated from the others, each doing it’s work, and communicating via message passing.

In case one fail, it is isolated from others, the rest continue without noticing… and special processes (supervisor) could detect these failures, and repair.

There is a reason why data is immutable, and why FP is more appropriate.

But it is so very different from what You know it looks like alien code.

iex1> spawn fn -> IO.puts "From: #{inspect self()}" end
From: #PID<0.852.0>
#PID<0.852.0>
iex2> spawn_link fn -> 1/0 end
** (EXIT from #PID<0.847.0>) shell process exited with reason: an exception was raised:
    ** (ArithmeticError) bad argument in arithmetic expression
        :erlang./(1, 0)

Interactive Elixir (1.12.3) - press Ctrl+C to exit (type h() ENTER for help)
[error] Process #PID<0.861.0> raised an exception
** (ArithmeticError) bad argument in arithmetic expression
    :erlang./(1, 0)
iex(1)>

It’s easy to start a process with spawn.
It’s possible to link processes together, with spawn_link

What You see is a process failure (1/0), killing the console, but the console is magically restarted by a supervisor.

You can see processes in the console too…

iex(1)> Process.list
[#PID<0.0.0>, #PID<0.1.0>, #PID<0.2.0>, #PID<0.3.0>, #PID<0.4.0>, #PID<0.5.0>,
 #PID<0.6.0>, #PID<0.7.0>, #PID<0.10.0>, #PID<0.42.0>, #PID<0.44.0>,
 #PID<0.46.0>, #PID<0.47.0>, #PID<0.49.0>, #PID<0.50.0>, #PID<0.51.0>,
 #PID<0.53.0>, #PID<0.54.0>, #PID<0.55.0>, #PID<0.56.0>, #PID<0.57.0>,
 #PID<0.58.0>, #PID<0.59.0>, #PID<0.60.0>, #PID<0.61.0>, #PID<0.62.0>,
 #PID<0.63.0>, #PID<0.64.0>, #PID<0.65.0>, #PID<0.66.0>, #PID<0.67.0>,
 #PID<0.68.0>, #PID<0.69.0>, #PID<0.70.0>, #PID<0.71.0>, #PID<0.72.0>,
 #PID<0.79.0>, #PID<0.80.0>, #PID<0.81.0>, #PID<0.83.0>, #PID<0.86.0>,
 #PID<0.87.0>, #PID<0.88.0>, #PID<0.89.0>, #PID<0.90.0>, #PID<0.92.0>,
 #PID<0.93.0>, #PID<0.94.0>, #PID<0.95.0>, #PID<0.96.0>, ...]

Wot…
Sorry I got lost pretty fast in there.

I saw your Reddit post and you shutting down a lot of the suggestions. Seems to be the same thing over here.

Also let me help you a little bit: specify what confuses you so that people can adjust accordingly.

Just saying

isn’t exactly helpful.


You’re also going to need to work on this otherwise it’ll be impossible for you to work with other people. If you don’t ever intend to work with others, I guess you could forget about what I said. But being able to read other people’s code is also a valuable skill that makes you a better programmer, so at least try to not give up after reading for 5 seconds.

Another thing: even Jose Valim (the guy that created the language you want to learn about) reads other people’s code. During Advent of Code he looked through someone else’s solution that used Nx, and he learned new things from it. He didn’t say, “ugh this is too hard, I give up! I don’t know how to read other people’s code and I don’t want to!”. He just read it and took the time to understand it. Even if you don’t want to work with others, being able to read and being comfortable with the process means you could improve.

So this

Erm…

I just don’t understand other people’s code and their logic around it… I just don’t understand it.

means you’re too impatient to go through the learning process, which is necessary as a programmer. You won’t always be spoonfed answers and you will have to find answers by going through existing codebases to learn how they implemented what you were looking for. You’re missing out on an essential process. If you don’t want to do this then maybe progressing past being a beginner programmer isn’t what you want? This doesn’t just apply for Elixir after all.

If you want to learn how you process code in your brain, you can read about “The Programmer’s Brain” (The Programmer's Brain). This teaches you how to read code, and how your brain processes it. If you don’t even want to read this, nobody can help you because you’re making it impossible to be helped.

What I got from this thread is that you found a lot of basic stuff difficult. So what good does aiming for a harder project do? You also admitted it in your Reddit post:

I’m kinda bad in Elixir, but I remember that it has a builtin date-time library…

And what can I do with the number package? I’m kinda lost, sorry.

I’m really bad when it comes to creativity.


Only you know what things you enjoy making, and only you know what level of understanding you have. Since you’re also picky, I don’t know how good asking others for suggestions would do. I could suggest to make a CLI-based text adventure style game (like a visual novel except without the visual stuff) but in your Reddit comment you didn’t know what a CLI was. If you say you’re not creative then just make something extremely uncreative like an inventory system you interact with through the CLI. If you don’t even want to learn to make CLI tools, web front-ends to your app, or even the mere interacting with a web API (doesn’t even mean you’re making a website), you’re making it impossible for you to do anything.

5 Likes

The ability to read docs is a prerequisite for everything in programming.

1 Like

Also since people are recommending to watch Jose’s Advent of Code streams, recently I’ve been working on compiling the important bits of his streams into shorter videos. So you don’t have to manually scrub through hours of footage because I have spent countless hours doing just that for you.

I have done Day 1 to 6 so far, and I’m working on Day 8 right now.

I upload them here: https://www.youtube.com/channel/UCUa0_AVebTfZzyzXjfB4dJQ/featured. If anyone is interested, you could subscribe since I’ll be uploading his streams whenever I’m done with the editing.

The playlist is over here:

If you give it the time, Jose usually reveals what he’s thinking. So yeah, great to watch.

4 Likes

You’re being very hard on yourself, but at the same time seem to be protecting yourself from any challenges. It’s a common paradox, but an unhelpful one. Each time you say “I’m bad at …” it would be worth probing that a bit rather than assuming there’s an absolute barrier in your way. Being “bad at reading other people’s code” isn’t a fixed characteristic like having blue eyes. It just means there’s a skill waiting for you to attain (by practising it).

Programming is hard enough as it is (for almost everyone). You’ll slow your own progress by retreating from every aspect of it you find difficult. Believe me, many other programmers find it much harder than it might seem from the outside. People vary in how sensitive they are to this, and in how open they are about expressing it, but it’s just a hard thing to do, and comprises many skills which have to be gained painstakingly and with much frustration.

It might help people here to help you if you reframe your situation a bit. Tell us a bit more about your experience to date. If you don’t like web stuff, what do you like? Is there anything you’d love to make? What do you find hard about the docs, specifically. Which docs? What Elixir did you cover (and where from)? I’m not suggesting you answer all those questions exactly. Just give people a bit more to go on - as I think you can see in this thread, they want to help

5 Likes

Good suggestion. I’ve watched a couple, and in a way it’s kind of encouraging to see that even “programming heroes” like Jose must ease stepwise towards a solution. Just like the rest of us.

Would agree that advent of code is a good way to do this :slight_smile:

Elixir koans use tests to run through concepts like sigils, strings, or tasks. It has the left hand side of a match and the right hand side is usually ___ and looking for you to fill in the blank to make the test pass. You move through each test and each section until you’re done and all the tests pass.

It’s less work than Exercism as you’re just filling in blanks. The compiler errors can sometimes give you the exact answer. I find it more useful than just the docs because I’m doing something to reinforce the learning, even if it’s trivial.

Koans from a programming perspective are typically language agnostic so if you’re not familiar with them I can understand how the website and GitHub doesn’t explain much. Not all koans work this way exactly but they’re intended to be this lightweight.

Exercism and specifically the mentoring portion is directly responsible for my ability to comprehend Elixir code when I struggled for months or possibly years learning on my own. I cannot recommend it enough.

As an aside, it would be a fun learning project to put together a web app presenting the koans. Or it might be possible to do something with Livebook.

It would be useful to try both I think. There is something to the existing workflow though where you essentially run a watcher and change any file you want. Livebook would be much more approachable through an instance on Fly.io as it doesn’t require running it locally or through Docker. Elixir is much easier to install now but that can be a huge barrier to entry for some people. I feel like that idea is definitely worth pursuing.

Indeed, koans in a livebook would be nice. But disqualifies for OP for reasons of webstuff.
But one could put together the idea of text-adventure and interactive koans to some saga of a cruel Elixir-riddler-magician’s dungeon. :scream:

I wasn’t suggesting it for the OP - it was just an aside prompted by the OP mentioning the original koans being a bit opaque, which I can understand for a beginner. A livebook or unique web app presenting the koans could be more approachable for many. I might have a crack at it myself.

Yea, most of the things sent here are way too hard for me.

Kinda not pretending to? I’m not gonna be good anyways.

I don’t have the money, sorry.

I try to read it, I just don’t understand it.

You don’t know about me, but I’ve learning all things people said me to learn. Regex, common languages, etc.

You guys did send hard things, lol.But I’m wanting a thing to test what I’ve learned at the basics because that’s what I did in other languages.

I don’t even know what I ate for breakfast…

I’m not that picky, it was just too hard for me. I’ve already done a text-based game, in Command Line.

What’s an “inventory system”?

I just don’t want to use web at all. If it’s CLI it’s ok.

I just don’t understand it, sorry.

Advent of code is too hard for me, I could only do 1 and 2, the rest I can’t even understand the questions. Even if watch it, I wouldn’t understand what he’s doing or what I’m supposed to do.