Skip to content

Change the '$$' identifier to a constant#1

Merged
sebastiaanluca merged 3 commits intosebastiaanluca:developfrom
imliam:master
Feb 26, 2018
Merged

Change the '$$' identifier to a constant#1
sebastiaanluca merged 3 commits intosebastiaanluca:developfrom
imliam:master

Conversation

@imliam
Copy link
Copy Markdown
Contributor

@imliam imliam commented Feb 25, 2018

PR Type

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Extend feature (non-breaking change which extends existing functionality)
  • Change feature (non-breaking change which either changes or refactors existing functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

What does it change?

Proposes a constant that is named appropriately so that any developer reading it in use can tell what it represents, and it uses an ID generated by uniqid() so as to not conflict with user input.

Why this PR?

The '$$' identifier has a few problems, and replacing it with a constant is an attempt to alleviate those:

  • '$$' is not a language construct like the RFC proposes, so people looking into the code will not be familiar with it and what it represents
  • When processing user input, '$$' could be a perfectly valid string and is now something that the developer must explicitly check for

How has this been tested?

Existing tests have been modified to account for this change.

The '$$' identifier has a few problems, and replacing it with a constant is an attempt to alleviate those:

- '$$' is not a language construct like the RFC proposes, so people looking into the code will not be familiar with it and what it represents
- When processing user input, '$$' could be a perfectly valid string and is now something that the developer must explicitly check for

The proposed constant is named appropriately so that any developer reading it in use can tell what it represents, and it uses an ID generated by uniqid() so as to not conflict with user input.
@sebastiaanluca sebastiaanluca changed the base branch from master to develop February 25, 2018 01:33
@sebastiaanluca
Copy link
Copy Markdown
Owner

Finally got some time to review this. Good points and excellent fix, thank you for this! I'll tag a v2 release in a moment.

@sebastiaanluca sebastiaanluca self-assigned this Feb 26, 2018
@sebastiaanluca sebastiaanluca self-requested a review February 26, 2018 21:11
@sebastiaanluca sebastiaanluca merged commit 2dc7d54 into sebastiaanluca:develop Feb 26, 2018
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 this pull request may close these issues.

2 participants