During a mentoring session, I noticed the mentoring notes for Elixir’s Lasagna states the following points:
If a solution uses names like
is_ready, it can be pointed out that Elixir has the following naming convention:
is_fooshould only be used for macros that can be used in guard clauses,
foo?should be used otherwise.
This exercise can be solved without regular expressions and a student could be encouraged to try to do that.
- Regular expressions are not known for their readability.
String.ends_with?(input, "?")is more obvious than
- It is a good habit to use simple tools for simple problems and advanced tools for advanced problems.
- Elixir developers should be familiar with the
Stringmodule and the functions it offers.
I suspect the notes are for a different exercise or outdated? I don’t see why a student would name a method like
is_cooked , use regular expressions or need to use any of the string functions in this exercise (the example solution at the top of the page doesn’t even have any of those things)…