3 ms·
Considering how easy templating is with Flask, I don't understand who someone would write HTML directly in the controller the way the author did. I agree that F
by workhere-io 13y ago
Considering how easy templating is with Flask, I don't understand who someone would write HTML directly in the controller the way the author did. I agree that Flask is great, though.
- adnam 13y agoIt was just an example.
- workhere-io 13y agoAn example that beginners would be likely to be inspired by. It wouldn't have been much harder to write a single line of render_template('something.html') and then write the HTML for the template in a separate code section.
- straws 13y agoYou wouldn't even need to have a separate section — you could get the point across well enough with a simple render_template('error.html')
- emmelaich 13y agoAn example should demonstrate what it is meant do demonstrate, nothing more. Anything else is a distraction. Using render_template would have left us wondering whether there was anything relevant to the task in render_template, or at best interrupting the reader's flow.
- Walkman 13y agoit's worse even more then. An example should show a GOOD practice.