julngomz

julngomz

Elixir + Functional Programming in 9-12 High School

Hello All,

I don’t know how to ask this question or if I am asking it in the right place, but I need some suggestions/guidance. I am currently taking EDU courses in university that revolves around designing and assessing curriculum in K-12 gifted students.

On of the main projects is designing a curriculum that uses the CSTA K-12 Computer Science Standards and Core Standards (I am in Iowa, so I’ll be using Iowa standards for Technology Literacy).

There is already a plethora of information in Scratch and Python, so I am trying to design something for Elixir and Functional Programming.

My questions are:

If you had to teach functional programming in K-12:

Where would you start?
How would you do it?
What would you teach?
Would concurrency be better off taught in another semester of the course, say two courses one in the fall the other in spring?
If you were in high school, what would you have wanted to learn?

Here is a quick outline that I have going on:

Unit 1: Getting Started: Background, Tools, Brief CS Overview
Unit 2: Computer Science Fundamentals: Variables, Conditionals, Functions
Unit 3: Data Types: Integers, Characters, Boolean, Atoms, Structures
Unit 4: Organizing Data: Modules, Functions,
Unit 5: …
Unit 6: …

Each unit will have a project at the end.

Thanks in advance!

Most Liked

bnly

bnly

For starters I think I’d leverage what they already know. For example, at lower levels they at least know what adding and multiplying are, so you can introduce the concept that you can have an “add” function that’s a bit like a box where you put in two numbers and get out a new one.

Higher grades have exposure to some algebra so you can work with that.

Anything that can be quickly used to solve real problems for them is also useful. For example just learning to use a REPL like iex as a fancy calculator already brings real value.

I’d show the absolute minimum in data structures and conditionals to get them writing code. So eg. you can start with just strings, numbers, lists, functions and if at the beginning. Bring in atoms, tuples, maps etc gradually, as a solution for a new problem.

I’d also try to introduce ideas of declarativeness vs imperative code for higher levels. This also fits with what they see in school, ie “let x = …”

Something a lot of educators miss is the importance of leaving mystery. If you can possibly get them to “hey, this is so complicated with all these if blocks I just wrote, is there a better way?” instead of pushing every conditional at them right away, I think it’s a better learning experience. So instead of “here are all the conditionals because this is the conditionals unit” I’d probably sprinkle them more.

It’s so tempting to be focused on making the order of modules look organized at the course plan level that it’s less fun. So eg. you could show them pretty early on how to bring in a dependency and use something like Req to access a fun API. They could do something like build a “what should I wear today based on the weather” project as one example.

Also obviously Elixir isn’t the only option for teaching FP – you could show them browser JS for example – but LiveBook seems like a no-brainer here for teaching Elixir.

Anything that can create games will get a lot of students excited. For concurrency maybe an early way to introduce it is “here’s how to do things in the background” and for higher levels you might even build a multiplayer game together or a messaging app.

Collaborating as a class on a bigger project could be interesting instead of everyone just doing smaller projects. It better reflects what building software looks like in the real world and you could build it on github/etc. too.

bnly

bnly

I like the LiveBook focus and “real world” orientation a lot.

Based on my own learning path with programming – I started from a young age – I think something I’d focus on is getting them quickly to self-directed because it’s a maker space, more like creative writing than eg. pure math where you’re just learning and solving problems for years.

A training wheels metaphor could be useful, where as soon as they’re on the bike, as much as possible you’re letting them steer and pedal, but helping them stay up until they’re good on their own. The training wheels to me would be things like computer science concepts and language details. They’re useful but ideally should be learned alongside doing stuff.

You’re right not all kids will want to program robots–but some might–others might want to build art, some might want to create a discord bot, some might want to make games. Someone could hook up an LLM wrapper and make a “do my English homework for me” bot, or more appropriately a homework helper at least.

There’s a lot to be said for the “case study” approach to learning, where you could deliberately have a few small but cool projects that pair real-world stuff (eg. save to a file, connect to a REST API etc.) with computer science concepts. And then it only takes a few of those before they can do their own thing. I’d get to “individual project” or “group project” early if possible.

Also we have to admit Elixir isn’t the ideal choice for every problem, since it’s best suited for things with networks and servers, but that’s a lot of stuff these days.

julngomz

julngomz

You’re absolutely correct but given that majority of the content that I have found is based on Python, Scratch or Minecraft I want to introduce another way of doing and approaching problems. Elixir might not be the right tool for every problem but it sure does make it easier to grasp the why and how something works.

I also program in C and Rust but that’s far more complex and I don’t want to bog them down with concepts such as the CPU, memory, pointer arithmetic and undefined behaviors. That will just put them off and stifle their creativity. I want them to have an idea, jot it down, and implement it.

My focus in CS is cloud computing and distributed systems and I find that working with Elixir I can express the ideas better.

Here are some projects that I want to implement — some might be complex:

  • HTTP Server/Client
  • TCP Server
  • WebSockets
  • Messaging App
  • Real-Time Interactions with PubSub (Drawing)
  • Kahoot-It Clone
  • Clinic/Coffee/Dentist Web App (Get them thinking on where they can implement elixir + phoenix)

Where Next?

Popular in Questions Top

siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New
Darmani72
If I have a post route which an argument: post /my_post_route/:my_param1, MyController.my_post_handler How would get the post params ...
New
Fl4m3Ph03n1x
About me? ( if you have nothing better to do than reading about some random guy in the internet :stuck_out_tongue: ) Hello all, this is ...
New
New
pmjoe
I have a relationship of love and hate with Elixir. Lots of things are just absolutely right, but there are some things that are kind of ...
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
Lily
In templates/appointment/index.html.eex: <%= for appointment <- @appointments do %> <tr> <td><%= appoi...
New
ycv005
I have followed this StackOverflow post to install the specific version of Erlang. And When I am running mix ecto.setup then getting fol...
New
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New
sergio_101
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New

Other popular topics Top

greenz1
I have a phoenix application from which a user can download multiple(5-6) files of size 1MB. I couldn’t find anything related to sending ...
New
electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod -- where is this set? Thanks.
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
jerry
Good day to you all. I have been struggling to get a query involving like and ilike to work. Can anyone assist me on this, please? pro...
New
chrismccord
This release brings a number of exciting features, including integration with the new Phoenix LiveDashboard and Phoenix LiveView. There h...
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers' Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New
AstonJ
Please see the new poll here: Which code editor or IDE do you use? (Poll) (2022 Edition) It’s been a while since we first asked this, I...
208 31107 143
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New
svb
Hi! Currently I want to submit a form by pressing the Enter key. However, since my input field is of type “textarea” this is just adds a...
New

We're in Beta

About us Mission Statement