Change variable name $self to more descriptive names depending on where it gets used #21

Closed
opened 2024-08-24 04:39:02 +00:00 by nu · 0 comments
Owner

To prevent confusion like #14 and also just for general code clarity purposes, I'm thinking it makes sense to change $self to have a more descriptive name depending on where its being used, like how I'm already using $set/$_set in DBIx::Class ResultSet-related modules. I'm thinking the following:

  • $app in CharmBoard.pm
  • $c in CharmBoard::Controller namespace
  • $m in CharmBoard::Model namespace

Templates will also need to be changed, I think to $c.

This additionally should make it more clear that $self is not functionally the same throughout all namespaces (i.e. how in Model context it seems to be impossible to access session data through $self, and also to access wider app params, you need to go through the route $self->{app}, or $m->{app} once this change is put into effect)

To prevent confusion like #14 and also just for general code clarity purposes, I'm thinking it makes sense to change `$self` to have a more descriptive name depending on where its being used, like how I'm already using `$set`/`$_set` in DBIx::Class ResultSet-related modules. I'm thinking the following: - `$app` in `CharmBoard.pm` - `$c` in `CharmBoard::Controller` namespace - `$m` in `CharmBoard::Model` namespace Templates will also need to be changed, I think to `$c`. This additionally should make it more clear that `$self` is not functionally the same throughout all namespaces (i.e. how in Model context it seems to be impossible to access session data through `$self`, and also to access wider app params, you need to go through the route `$self->{app}`, or `$m->{app}` once this change is put into effect)
nu added the
code clarity
label 2024-08-24 04:39:10 +00:00
nu added this to the Workable alpha/beta project 2024-08-24 04:39:56 +00:00
nu closed this issue 2024-08-24 04:46:11 +00:00
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: nu/CharmBoard#21
No description provided.