This issue is a discussion for contributors to collaborate in getting Leap ready to be featured in 48in24. Please refer to this forum topic for more info.
We will be featuring Leap from Jan 16th onwards.
Staff jobs
These are things for Erik/Jeremy to do:
Check/update exercise in Problem Specifications
Create + schedule video
Community jobs
For each track:
Implement Leap
Add approaches (and an approaches introduction!) for each idiomatic or interesting/educational approach.
Add video walkthroughs (record yourself solving and digging deeper into the exercise).
Highlight up to 16 different featured exercises (coming soon)
Existing Approaches
You can use these as the basis for approaches on your own tracks. Feel free to copy/paste/reuse/rewrite/etc as you see fit! Maybe ask ChatGPT to translate to your programming language.
I will write an approach for C++. If I am too slow, or someone else has already done something, then please use the corresponding GitHub issue for further C+±related discussions.
I’ll post some thoughts on what might be interesting to discuss regarding this exercise. I’ll use separate posts to allow for people to easily reply to a single item.
These discussion points can be used for both the video Jeremy and I will be doing and as points to consider improving/fleshing out approaches with.
If you have any thoughts on my suggested discussion points of have other things to discuss, please let us know by posting them here in this topic.
As the logic for determining whether a year is a leap year involves both AND and OR clauses, it is important to understand in which order these clauses are evaluated. This is known as operator precedence.
We could discuss:
Why do we need operator precedence?
Do all languages have operator precedence? (spoiler: nope! LISPs famously don’t have this “problem”)
Is operator precedence different between languages? (probably not for AND and OR)
How does operator precedence work applied to leap?
I’d be happy to draft an introduction and a few approaches to the exercise in either Elixir or Cojure if that’s helpful and nobody else is already working on it.
Mostly copying was my initial approach when I offered to help. Then I looked at approaches in a few different tracks and quickly realised that the value of that might be limited unless the source language is very similar.
But copying might save time. Shouldn’t the approach depend on how much time a contributor has and how much time is left until the week?
Said that, after writing the Elixir approach to Leap, I’m planning to reuse large parts of it for Clojure…
I agree with @michalporeba’s answer for this. I think where languages are very similar with regards to the solution, then copying+pasting is basically gonna work great. So comparing the top two community solutions for Leap in C# and Ruby suggest this would be entirely copy/pastable from C# to Ruby:
Of the C# Approaches I think all of them could copy to Ruby just fine for Leap actually. Even the pattern matching one would work in latest Ruby.
But for other exercises I guess more work would be required. However, copy + paste via LLM definitely feels like it might be a very quick win. (I’m tempted to give maintainers a button to press that would generate a PR by taking one approach and transcribing it via ChatGPT to a different language - anyone interested?)
I tried last night using ChatGPT 4 to adapt what I have written for Elixir track to Clojure track. I thought the languages were similar enough, both functional. It was fast, and not necessarily incorrect, but not very useful either. I will have to do a lot of editing and proofreading before I submit a PR.
I took a lot of inspiration from the Java Script track to implement the C++ material, which was reasonably fast to edit. I added some information from Eric’s suggestions, cut the JS-specific info, and will add a performance benchmark.
I also explored some more convoluted approaches. I should see and check what ChatGPT suggests on that front.
An update from me on leap approaches for Elixir and Clojure.
Elixir is nearly ready to merge the first draft to see how it looks on the page. I believe it will be merged at some point today.
As for Clojure, I need a little bit of help. The pull request was automatically closed, as expected, but despite linking to this post, it was never reopened. Who maintains the Clojure track? Can @ErikSchierboom help? For now, the latest code/text is available here.