-
-
Notifications
You must be signed in to change notification settings - Fork 138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Overhaul basic-syntax
and lasagna
#607
Conversation
I'm not sure about re-arranging the tests to follow Arrange, Act, Assert or Given, When, Then with additionally separated out input and expected values. The arrangement would allow easier implementation of a test generator for practice exercises, students would get used to seeing a test arrangement recommended for unit testing and many implementation details look much nicer when separating the data from the phases. Current code: public function testTotalElapsedTime(): void
{
$lasagna = new Lasagna();
$this->assertEquals(21, $lasagna->totalElapsedTime(layers_to_prep: 4, elapsed_minutes: 13));
} Arrange-Act-Assert: public function testTotalElapsedTime(): void
{
$input = [
'layers_to_prep' => 4,
'elapsed_minutes' => 13,
];
$expected = 21;
$subject = new Lasagna();
$actual = $subject->totalElapsedTime(...$input);
$this->assertEquals($expected, $actual);
} Also I would suggest using a common naming scheme for the tests. E.g. I usually use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall a great improvemen! I opened some threads on things I think we can improve.
Do not hesitate to discuss them.
The exercise will not change, as that would invalidate all submissions.
8daae6f
to
a8dd192
Compare
Thank you very much for all those improvements ! |
This very first concept and its concept exercise touch a lot of concepts coming later.
These must be introduced as much as necessary to understand the code and the requested solution, but not more.
So we have many short introductions and a bit more depth for the
about.md
. But what is "Basics" or "basic-syntax" then?The important decision guiding document (according to exercisms docs) is
design.md
, which was a copy from the Ruby track and not adjusted for PHP Basics. I analyzed the exercise (as this must remain mostly the same to not invalidate solutions) and re-wrotedesign.md
to inform further decisions. And answered the question "what to teach here" from this perspective.I then added missing conceptual information to
about.md
for little experienced programmers and condensed that document forintroduction.md
to address medium experienced programmers. I kept the chapter on code organisation inabout.md
and added a chapter on simple debugging. As I think this helps people who are stuck also, I addedvar_dump()
tohints.md
.I focused the exercise stub on doing the function bodies for the tasks from
instructions.md
by adding method definitions without body. As outlined indesign.md
I think it is not "basic syntax" to define the interface of methods, that is "user-defined functions" and "class basics".I intentionally chose comments for the function bodies and not throwing exceptions, as that would add another concept to touch.
Finally I added more value to the exercise tests by making their feedback more helpful and guiding.
The concept is connected to the prerequisite concepts as planned(has none)about.md
for in-depth discussion of the topicintroduction.md
with concise information to address a medium experienced programmer who is new to PHPintroduction.md
links toabout.md
for those who need / want more informationdesign.md
outlines goals, learning objectives, scope, unlocked concepts, prerequisitesinstructions.md
uses steps to drive towards the solutionhints.md
unstucks programmers without handing out the solution, mostly by refering to helpful sources to readhints.md
links back toabout.md
where reasonableAvoid named arguments to allow students to name parameters as desiredAdds to #578