-
Website
http://buildingbrowsergames.com -
Original page
http://buildingbrowsergames.com/2008/08/29/getting-started-with-a-templating-system-ruby-on-rails/ -
Subscribe
All Comments -
Community
-
Top Commenters
-
gabrielbianconi
1 comment · 1 points
-
Luke
82 comments · 1 points
-
spatlabor
1 comment · 1 points
-
HughCompton
2 comments · 1 points
-
obat jerawat
1 comment · 1 points
-
-
Popular Threads
If you were confused by my comment that "we've seen that the templating code (in the .html.erb files) gives us the ability to include partial pages to reuse sections of HTML, pull data from variables...". That statement is true only across all of the Ruby on Rails entries I've written so far. I showed only the conditional showing and not showing parts of the page and pulling data from a variable. If you want to see the first time I used a partial you can see that in The Login Page (Ruby on Rails) Part 2 (http://buildingbrowsergames.com/2008/08/25/the-...).
templates the first time they get used - so while there is some overhead,
that overhead is negligible after the first hit on your template - if your
server is fast enough, the overhead from that initial hit should be barely
noticeable.
In my experience, programming languages are typically designed the way they
are to increase developer productivity - Templating systems are just another
addition to your toolbelt to increase that productivity - they aren't a
silver bullet of any kind.
Also, I would be wary of optimizing a little too early - your statement that
"it's an overhead on your server" sounds like you may be prematurely jumping
to the conclusion that your templating system is what is slowing your game
down. As you can see by looking at the benchmarks at
http://shootout.alioth.debian.org/u64/benchmark..., Ruby
and PHP aren't what you should be using at all if you're concerned about
performance(at least not on a 64-bit Ubuntu machine, anyway) - if you wanted
your game to be as absolutely fast as possible on the cheapest hardware,
you'd write it in C++.
At the end of the day, it's your game. If you'd rather not use a templating
system, then don't! Maintaining your code is only your responsibility, and
you(or your team) will be the only ones who see it(or even worry about it,
chances are). So do what you like - but know that templates come highly
recommended.
would you be able to suggest a few references of systems that you indicate come highly recommended or that pre-compile. my app is not game oriented - just a case where different websites all hosted on the same server will all use a lot of the underlying code but appear and feel different.
I have been to the smarty website but there seems to be a lot of debate on whether that's overkill.