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)

Last Post!

mercyf

mercyf

Wish I learned programming at that age or earlier…

Where Next?

Popular in Questions Top

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
vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
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
aalberti333
As the title describes, I’m trying to run Enum.map() over a list of key/value pairs, where the value is a map. My data looks like this: ...
New
dblack
I’ve got an issue with an app and I’ve no idea of how to troubleshoot it. I’m hoping someone here might have seen something similar. I p...
New

Other popular topics Top

Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
New
dokuzbir
I want to highlight html closing tags when i click a html tag. That works in .html files but doesnt work for html.eex templates. How can...
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
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
shijith.k
I am trying to start a new phoenix project with elixir 1.9, but mix phx.new does not work. It says that ** (Mix) The task "phx.new" could...
New
sergio
Kind of like when jquery came out, it was super necessary. Existing drag and drop libraries have a bunch of baggage to support old browse...
New

We're in Beta

About us Mission Statement