lara_crass liked a comment+100 XP
3mos ago
There are two sides to this.
I agree with the concept that is being introduced and think that sometimes things are done on a purist idea of these are the 'rules' and we should do it this way.
Some of the examples, as others have pointed out, actually go beyond what is nice and become a key part of what a modern application needs. Data types have been optional for a long time and PHP has probably suffered because of this. Removing them because you can is like saying 'we've managed without seat belts in cars for years - hey why bother!' (IMHO).
lara_crass liked a comment+100 XP
3mos ago
I strongly disagree on removing the type hinting. You shouldn't have to extrapolate from the code in the function what to pass it and what you'll get back. By removing these type hints you're doing the exact opposite of your stated goal for this lesson.
The type hinting reduces the cognitive overhead of determining parameter and return types, which is especially useful in large and complex applications, which are where reducing cognitive overhead matters the most. Further, it reduces programmer error and enables modern IDEs to offer better inspections to catch errors while writing.
lara_crass liked a comment+100 XP
3mos ago
I know that this is a very old post, but I want to share my point. Beyond the discussion of whether it's a good or bad practice, let's think together. In the migration process, perhaps you want to reverse the changes. So, by writing the insertion commands inside the migration, you can write some logic to reverse the changes. What you can't do in Seed in a practical way.