From 057e560dc3ebfe3a2ad782eed92e3843023de61d Mon Sep 17 00:00:00 2001 From: Kah Goh Date: Tue, 3 Oct 2023 00:17:01 +0800 Subject: [PATCH] Remove suggestions from Elixir's Lasagna (#2273) The function naming, regular expression and String suggestions aren't applicable to the exercise anyway. --- tracks/elixir/exercises/lasagna/mentoring.md | 28 -------------------- 1 file changed, 28 deletions(-) diff --git a/tracks/elixir/exercises/lasagna/mentoring.md b/tracks/elixir/exercises/lasagna/mentoring.md index 1825b01ef..78f8f455e 100644 --- a/tracks/elixir/exercises/lasagna/mentoring.md +++ b/tracks/elixir/exercises/lasagna/mentoring.md @@ -17,31 +17,3 @@ defmodule Lasagna do def alarm, do: "Ding!" end ``` - -## Common suggestions - - -If a solution uses names like `is_cooked` and `is_ready`, -it can be pointed out that Elixir has the following naming convention: -- `is_foo` should only be used for macros that can be used in guard clauses, -- `foo?` should be used otherwise. - -Sources: -- https://github.com/rrrene/elixir-style-guide#predicates -- https://github.com/christopheradams/elixir_style_guide#predicate-macro-names-with-guards -- https://github.com/lexmag/elixir-style-guide#predicate-funs-name - -### Usage of regular expressions - -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 `Regex.match?(~r/\?$/, input)`. - - 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 `String` module and the functions it offers. - -### Hint functions for the truly stuck - -- [`String#trim/1`](https://hexdocs.pm/elixir/String.html#trim/1) -- [`String#ends_with?/2`](https://hexdocs.pm/elixir/String.html#ends_with?/2) -- [`String#downcase/2`](https://hexdocs.pm/elixir/String.html#downcase/2) -- [`String#upcase/2`](https://hexdocs.pm/elixir/String.html#upcase/2) -- `String.upcase(input) != String.downcase(input)` if there is a letter present.