简体   繁体   中英

HAML/CoffeScript vs HTML/JavaScript for React on Rails

I want to use React with Rails. I already know html/JS, Begineer at Rails and just finished some tutorials on official site on React. Now I want to lear to use React with Rails. I noticed that many tutorials are using haml + coffescript. After researching on those two I found that they make developing easier and code more readable. But some people say that they generate bad html and JavaScript.

Is haml + coffescript worth learning for using them with React on Rails.

One of the reasons why I am not sure whether to use or not hamls/coffescript is that official documentation for React is written for Javascript.

"Some people say that they generate bad html and javascript". Keep in mind that some people will always say anything (which, by the way, is probably why your question got downvoted: you're inviting an opinions war, and the SO community hates those.)

The main considerations that come to mind are:

  • How easy / hard will your learning curve be, with each technology stack?
  • Are both tech stacks "compatible" with React? (Given the prevalence of React / Rails tutorials you've found that use Coffee, it looks like they are.)
  • How familiar are you with Haml and Coffee? How familiar are you with pure Javascript? (I'd err on the side of the more familiar environment and learn things one at a time when possible.)
  • How much fun does it seem to be to write code using each tech stack? (You'll learn faster and write better code if you love it.)

It sounds like you can't make a bad choice here, but if Haml or Coffee are new to you, I'd err on the side of the simpler technologies for now. You can always upgrade in a few weeks, right?

Good luck and hope you enjoy it!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM