Skip to content
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

This syntax error is protecting against a logic error #1

Closed
ljharb opened this issue Apr 1, 2020 · 7 comments
Closed

This syntax error is protecting against a logic error #1

ljharb opened this issue Apr 1, 2020 · 7 comments

Comments

@ljharb
Copy link

ljharb commented Apr 1, 2020

In your example:

function onRequest() {
<<<<<<< HEAD
  var screen = document.querySelector('.screen7');
=======
  var screen = document.getElementsByClassName('screen8')[0];
>>>>>>> refactor-overlay

By treating the conflict markers as comments, screen will silently be set to screen 8, instead of 7 - this could cause a much harder to triage production bug if the wrong screen got updated - perhaps because the logic below (that uses screen) did not conflict, and assumes screen 7.

@bathos
Copy link

bathos commented Apr 1, 2020

Indeed, I don’t understand the rationale in the readme. In the event that code is somehow deployed with merge markers, the last thing I would want would be for it to be (potentially) successfully executable ... with unknown behavior.

@rkirsling
Copy link

Let's not forget what day it is. 😅

@bathos
Copy link

bathos commented Apr 1, 2020

haha. it didn’t occur to me at all ... given this is more believable/coherent than many earnestly proposed things on e.g. esdiscuss, I think I’d readily fall for it again, too.

@rkirsling
Copy link

I did too, until I shared it with somebody who replied, "oh, I wanted to write an April Fool's proposal too!"

@ljharb
Copy link
Author

ljharb commented Apr 1, 2020

¯\_(ツ)_/¯ on the off chance it's serious, the point had to be made, and general opinion has been that april fool's day is supposed to be cancelled during covid-19 due to being in poor taste, so i thought it was better to be safe than sorry :-)

@fChristenson
Copy link

I had to reread the proposal a few times to make sure I understood everything correctly. It has to be a joke.

@ljharb
Copy link
Author

ljharb commented Apr 29, 2020

Closing per 81f8d9c

@ljharb ljharb closed this as completed Apr 29, 2020
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

No branches or pull requests

4 participants