Skip to content

Coordination: Prepare for students code using PHP 8.4 #297

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

Closed
mk-mxp opened this issue Apr 14, 2025 · 5 comments · Fixed by #298
Closed

Coordination: Prepare for students code using PHP 8.4 #297

mk-mxp opened this issue Apr 14, 2025 · 5 comments · Fixed by #298

Comments

@mk-mxp
Copy link

mk-mxp commented Apr 14, 2025

Similar to what we did for PHP8.3 in #155 - For exercism/php#884 we need to have the representer ready to accept PHP 8.4 code from students. The representer itself may run on a different PHP version.

@homersimpsons Can you outline the required work to do here? An actionable list of tasks would be perfect, but any hints are welcome.

@homersimpsons
Copy link
Collaborator

homersimpsons commented Apr 26, 2025

@homersimpsons Can you outline the required work to do here? An actionable list of tasks would be perfect, but any hints are welcome.

To me there is nothing to do:

I will upgrade the base image of the prepresenter to php 8.4 as I did in e0def59.

@mk-mxp
Copy link
Author

mk-mxp commented Apr 27, 2025

I think the last normalization, "new MyClass()->method() to always use parentheses" is required. This was one of the PHP things I did wrong for years, and never learned it :) But it does not make any difference, and so is no "approach" on its own.

We should remove [\Deprecated], it makes no sense here.

I would see "using asymetric visibility" as a different approach to solve the encapsulation problem. So I'm against normalizing this. Normalizing it would also mean, students never see asymetric visibility in solutions. I'm sure we will have a concept around visibility one day and that should cover asymetric visibility also.

PS: Just for documentation - It's https://www.php.net/releases/8.4/en.php

@homersimpsons
Copy link
Collaborator

I would see "using asymetric visibility" as a different approach to solve the encapsulation problem. So I'm against normalizing this.

In practice, I do not think that we have any exercise about this. Hence, it is probably better to normalize this so the comments on representation could be more general.

@mk-mxp
Copy link
Author

mk-mxp commented Apr 28, 2025

@homersimpsons I don't understand the "so the comments on representation could be more general" issue. The representer does not comment on anything as far as I know. It provides "the normalized solution" to mentors, right? And it is used to identify duplicates of published solutions in the community solutions. Do you mean "mentors comments" could be more general?

I'm sure it will be long until students start submitting code with asymmetric visibility - and most probably they will start doing so when we ask for it in a concept exercise.

Anyways, I think it should be visible to mentors if such an advanced concept is applied to exercise solutions. So mentors can react to the use of it. If it's hidden, no questions around it can be asked or misuse pointed out.

@homersimpsons
Copy link
Collaborator

It provides "the normalized solution" to mentors, right?

Yes and no, when a mentor mentors a specific solution he does not see the normalized one. If you have access and go to https://exercism.org/mentoring/automation you can see the normalized solution on which you can comment, and when previewing and submitting the comment it is possible to see up to 3 non-normalized solutions that led to this normalization.

(If you do not have the required mentoring to have access you can create a pull request to add yourself to https://github.com/exercism/website-copy/blob/main/automators.json)

And it is used to identify duplicates of published solutions in the community solutions.

Yes, it is used to batch different solutions together, as well as to provide automatic comments for new solutions that have the same representation than an automated one. Currently it gives a feedback 41.8% of the time according to https://exercism.org/tracks/php/build.

Do you mean "mentors comments" could be more general?

I mean that a more diverse set of solutions will lead to the same representation, hence a comment will apply to more solutions.

About normalization:

Note that, while unimplemented, it is possible to apply different normalization based on the exercise name. Doing so would allow us to have avoid normalizing things that are relevant for the exercise.

Ultimately the goal would be to implement an Analyzer which I started in https://github.com/homersimpsons/php-analyzer but never put that much time in it (yet).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants