While everything content inside conditionals could be wrapped in divs/spans to make it play nice, it seems weird to have to add markup just to be able to write reasonable JSX. We had some discussion in the chat, and I agree that most of this is probably just "old-school template habits", however, returning multiple tags is biting me in the ass a lot. FreeMat v4.0 - Online Documentation IF-ELSEIF-ELSE Conditionals Instruction Section: Flow Control Usage The ifand elseaffirmations form a controller structure for conditional execution. there are a lot of situations in which one has to change surrounding code simply because one added a tag, or because one removed a tag. I realize that this perhaps is approaching it from the perspective of old-style templates, but from where I'm standing now, these things seem to make it quite cumbersome in more complex situations. Preprocessor conditionals can test arithmetic expressions, or whether a name is defined as a macro, or both simultaneously using the special defined operator. Or do you think there are better ways one should use to structure the code? Am I missing something? A conditional is a directive that instructs the preprocessor to select whether or not to include a chunk of code in the final token stream passed to the compiler. While it may not be a big deal, it's weird that the syntax for an if-statement. Simple, intuitive and good output? Conditionals Intuitively this should be relatively easy to fix in JSX by simply automatically wrapping such as arrays. The easy part problem is simply that we currently cannot return more than one tag before having to resort to arrays. So in my opinion, something is clearly wrong here, adding a conditionals should never require you to be working with arrays and rewriting inline text to use JavaScript string literals instead, or in general require you to massacre your code.
0 Comments
Leave a Reply. |