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

Add a complete code example for solving an equation in README (#102) #103

Merged
merged 1 commit into from
Jan 28, 2017
Merged

Add a complete code example for solving an equation in README (#102) #103

merged 1 commit into from
Jan 28, 2017

Conversation

karuppiah7890
Copy link
Contributor

@karuppiah7890 karuppiah7890 commented Jan 27, 2017

Fixes #102

@karuppiah7890 karuppiah7890 changed the title Add a complete code example for solving an equation (#102) Add a complete code example for solving an equation in README (#102) Jan 27, 2017
const steps = mathsteps.solveEquation('2x + 3x = 35');

steps.forEach(step => {
console.log("before change: " + step.oldEquation.print()); // e.g. before change: 2x + 3x = 35
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you put the comment above the line of code so the lines are max 80 characters?

thanks :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh. Now I see why you put the comments above the lines! Sorry!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@evykassirer But the earlier example for simplifyExpression also has comments on the same lin as the code and it leads to 92 characters in line 19!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ooo true.. I should follow my own rules more haha.

What do you think? Is it a lot more readable on the same line (so we should make an exception) or is better to put them all on the line above? I could go either way :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uh, it's more readable on the same line. But then, later, if we keep doing this, we might end up bringing scroll bars in the code block, and people have to scroll horizontally to see the end of the comment.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, let's keep it the way it is if it doesn't scroll horizontally

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haha, okay! In that case, we gotta keep some count on how much characters the README can take in before it goes for the next line so we don't put that many characters on a single line of code!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it can take 100 characters with ease without bringing in scroll bars. And a few more characters, from what I can see. Not more. And my code has only one line which has 100 characters and that's the max

@evykassirer
Copy link
Contributor

looks good! just one comment

@evykassirer evykassirer merged commit 5e0d94e into google:master Jan 28, 2017
@karuppiah7890 karuppiah7890 deleted the feature/modify-readme branch January 28, 2017 04:50
arbylee pushed a commit to arbylee/mathsteps that referenced this pull request Jul 14, 2017
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.

None yet

2 participants