3 ms·
> But the name of the game in programming is "don't repeat yourself", that is, don't copy and paste text. You're post is mostly correct but completely out of c
by ramblerman 15y ago
> But the name of the game in programming is "don't repeat yourself", that is, don't copy and paste text.
You're post is mostly correct but completely out of context. How exactly do you divide HTML and the boilerplate that comes with it into subroutines?
- kragen 15y agoThe simplest way is to write subroutines to generate the HTML. But it's probably better to use templates; you stick your standard HTML "boilerplate" into one template and use a templating library to interpolate stuff into the middle of it, instead of making a zillion copies and editing each one. As for CSS, most of the time CSS's own cascading facility is sufficient to separate your "standard" CSS into one file and your other CSS in another file. But when it's not, there's also stuff like Sass.