karmapa / ketaka-lite

📖 A multifunctional Tibetan text editor
MIT License
3 stars 2 forks source link

ECMAScript Function Bind Syntax #56

Closed yapcheahshen closed 9 years ago

yapcheahshen commented 9 years ago

instead of

onclick () { }

kmsheng commented 9 years ago

thanks, i'll try that

kmsheng commented 9 years ago

Answer to your question: No, I don't think that's a cleaner syntax. It's pretty much the same to me.

yapcheahshen commented 9 years ago

JSX is designed for non-programmer, so I think it will be better to move the complexity from JSX tag to the function body.

kmsheng commented 9 years ago

How do you assume JSX is designed for non-programmer ? any references or links ?

yapcheahshen commented 9 years ago

https://www.youtube.com/watch?v=x7cQ3mrcKaY at 14:39 , Pete Hunt mentioned With JSX, It's easy for designers to contribute code.

that is why I think JSX is designed as a declarative way for designer to migrate from HTML/template.

2015-10-21 0:54 GMT+08:00 kmsheng notifications@github.com:

How do you assume JSX is designed for non-programmer ? any references or links ?

— Reply to this email directly or view it on GitHub https://github.com/karmapa/ketaka-lite/issues/56#issuecomment-149631418.

kmsheng commented 9 years ago

Pete Hunt was just saying JSX is friendly to designers. Have you thought about why react component doesn't separate the view and controller files like angular? The philosophy of React of doing this is because they think controller and view are supposed to be together, that's actually called a controller view pattern. We modify view and controller in the same file.

Based on this, I don't think removing double semicolons will help. When a designer modify the component file, it's already a mess and they need to be trained. There's nothing to do with the double semicolons.

yapcheahshen commented 9 years ago

this is a minor coding style issue, I am fine with any style. you can use whatever you like, as long as it is easy to maintain , easy to understand and easy to use by the programmers (not me) in Dharma treasure association.

2015-10-21 14:49 GMT+08:00 kmsheng notifications@github.com:

Pete Hunt was just saying JSX is friendly to designers. Have you thought about why react component doesn't separate the view and controller files like angular? The philosophy of React of doing this is because they think controller and view are supposed to be together, that's actually called a controller view pattern. We modify view and controller in the same file.

Based on this, I don't think removing double semicolons will help. When a designer modify the component file, it's already a mess and they need to be trained. There's nothing to do with the double semicolons.

— Reply to this email directly or view it on GitHub https://github.com/karmapa/ketaka-lite/issues/56#issuecomment-149797811.

kmsheng commented 9 years ago

Haha, good to hear that : )

I could've removed all double semicolons with arrow functions binded, just don't feel like doing it. I am fine with double semicolons, it doesn't bother me. If it's a serious performance issue, then I'd be very happy to change em.

Anyways, it was very nice to discuss with you about this kind of topic : )