InterviewSolution
| 1. |
What Are The Cons Of Riot.js? |
|
Answer» The main cons of Riot.JS are as follows: State management is difficult: There are no ways to manage the state in a component or between the components. There are no steps between a state update and rend ender, and when there is need of updating a tag, all its children will be also be updated. This increases the need for plumbing each time the user adds COMPLEXITY to a Riot. Alternatively, the user COULD implement another library like Redux to keep state, which has its implications as well as challenges. Magic syntax: The Riot.JS development team made some odd choices when it comes to keeping to standards. There is some E56-like syntax, which is used in code examples that are not found elsewhere. Also, Riot.JS interprets user’s tag contents as JavaScript instead of HTML initially. For EXAMPLE, HTML attributes have no quotes. The toggle function definition will throw an error in any program and there’s no <script> like tag around the JavaScript. Thus one can easily work around, but there is the possibility of a stumbling block for non-professional developers, which are bad for reusability of your code. Not strict enough: An app, which is built with Riot is just a big object, residing in the global scope, that the user can easily traverse and change if NECESSARY. Even the internals are accessible too. When the app goes through problems it becomes tempting to build hacks and workarounds using the features. There may be unexpected side effects because of this are all too common in Riot.JS. The main cons of Riot.JS are as follows: State management is difficult: There are no ways to manage the state in a component or between the components. There are no steps between a state update and rend ender, and when there is need of updating a tag, all its children will be also be updated. This increases the need for plumbing each time the user adds complexity to a Riot. Alternatively, the user could implement another library like Redux to keep state, which has its implications as well as challenges. Magic syntax: The Riot.JS development team made some odd choices when it comes to keeping to standards. There is some E56-like syntax, which is used in code examples that are not found elsewhere. Also, Riot.JS interprets user’s tag contents as JavaScript instead of HTML initially. For example, HTML attributes have no quotes. The toggle function definition will throw an error in any program and there’s no <script> like tag around the JavaScript. Thus one can easily work around, but there is the possibility of a stumbling block for non-professional developers, which are bad for reusability of your code. Not strict enough: An app, which is built with Riot is just a big object, residing in the global scope, that the user can easily traverse and change if necessary. Even the internals are accessible too. When the app goes through problems it becomes tempting to build hacks and workarounds using the features. There may be unexpected side effects because of this are all too common in Riot.JS. |
|