[top-secret] TDD-ing one's way to `Macro.prewalk/3`

Hello fellow Exercism practitioners!!

I’d love to kick off a conversation about one of the rather advanced-topic-based exercises in this track: top-secret.

Personally, when I started the exercise, I was not versed at all with Elixir’s metaprogramming facilities. So, while I did skim the the modules introduced in this AST concept, I absolutely missed the fact that there is tree traversal support… and, yup, I failed to catch that sentence from the instructions:

… We will traverse the whole AST with built-in tools in the last step …"

Watching the “Dig Deeper” video by Mike Zornek was a real eye opener… especially at the end when he took a hard right turn and pulled in the tree traversal bit.

Once I became aware of the facility, it was a matter of refactoring my decode_secret_message/1 into the right shape.

It occurs to me that the concept of tree traversal, and within that using a walker, and writing a visitor is a hefty chunk to understand. But that’s just me.

What do the track maintainers think: do you think that it’s more useful to allow folks to work all this out themselves? or would it be welcome to provide some kind of primer of this aspect of the exercise?

1 Like

Track maintainer here :wave:

This is a tricky question. Let me explain a bit about the assumptions on which Exercism is based. It applies to the whole platform, not just the Elixir track.

Assumption 1: everything you need to solve a learning exercise should be included in the exercise’s introduction (or previous learning exercises!)

Top Secret is a learning exercise, so the introduction tells you where to look for a function for traversing the AST.

Assumption 2: Exercism is not meant for people new to programming. A general knowledge of computer science and at least one programing language is assumed.

Which begs the question: is the concept of tree traversal covered by that assumption?

I don’t know. We didn’t explain it any further because it never occurred to me before that it might need explaining!

Top Secret is the Elixir learning exercise with the lowest completion rate (only 82%). Maybe that’s the reason why?

1 Like