|
|
|
|
|
by pritambarhate
3689 days ago
|
|
>>this markup-in-scripts thing is a big mental shift for me<< Yes for me too. While making web applications with JEE and PHP for a decade, every best practice article on creating maintainable web apps told me to keep markup and logic different. That too in different files preferably in different folders like Controllers, Views, etc. Same for not mixing JS and CSS with HTML. And in practice it worked very well for me. So when I saw React's approach of putting JSX straight in JS code, I was thrown off a bit. Even Angular 1.x felt wrong with adding nonstandard directives in plain HTML. Common wisdom before Angular was only to use standard HTML/XHTML that passes W3 Validator, then use JavaScript to enhance the page. But then I just made peace with Angular and React way of doing things. If I want to get the benefits of the Angular/React eco system, then I need to use their approach, and still make sure that I produce maintainable code. |
|