-
-
Notifications
You must be signed in to change notification settings - Fork 61
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
Refactor rehype-mathjax
#45
Conversation
This comment has been minimized.
This comment has been minimized.
This comment is not request to update code. I'd like to ask you why you prefer to use ES5 syntax? For example, you write |
So this project wasn’t originally made by me, so it isn’t 100% using “my code style”. There are some consts! 😅 But most projects in unified do indeed follow my code style. I hope you don’t mind me refactoring the code you wrote! We are currently discussing this btw! I have a couple of thoughts about this. First: the most important thing is consistency. When I’m in a project that uses double quotes, or tabs, or semicolons, I follow those rules! Second: When building an app, on your own or with a team, pick whatever style you want! But as this is tiny open source modules that are running on many (sometimes old) computers that I don‘t control, I prefer making them work as much as possible (otherwise people become angry and raise issues 😉) Third, I started coding before Babel, ES5, or browser code on npm. When JavaScript had a single way to create a function, and a single way to create a variable. When the world was simpler (except for all the browser bugs) 😅 I still prefer that in most cases unless a) there is a much better way to do something, or b) I’m writing a script or an app.
I’m really interested in hearing your perspective on this! Is the way I write code readable to you? |
@wooorm Thank you for nice explanation. I agree your points but we have another way to satisfy your request with programming paradigm.
You and me love UNIX philosophy and KISS (Keep it Simple, Stupid). What does simple mean? Is it simple of syntax for you? It is simple of semantics for me. Biggest JavaScript community is moving to that paradigm, pure functional programming style. For example, React, Immutable.js. ECMAScript committee does also implement purely functional features in the specification, for instance, allow function, const declaration, syntax sugar of The syntax is important. Less tools is important. The readability is important. I totally agree with you. Although, syntax and tools is not so related to the making bugs directly because valid syntax works perfectly except misunderstandings of developer ;). We cannot validate of semantics without our efforts like TypeScript, eslint, const declaration as it is impossible to see the semantics physically, which is different from the syntax. That's why I prefer to the simple of semantics than the simple of syntax. ANYWAY, I appreciate your gentle explanation, and LGTM ❤️ If no one comment to this code anymore, we should merge this code. |
This comment has been minimized.
This comment has been minimized.
Released! Awesome ✨ Thanks @nzt for making rehype-mathjax! |
And thanks @Ir1d for the package name. Hope this one, with the |
Thank you guys for your excellent work 😘 This is much better than m y previous implementation! |
Builds upon GH-44 but:
</html>
)files
inpackage.json
/cc @nzt, @Ir1d would appreciate a review!