The tag has no usage guidance.

learn more… | top users | synonyms

-1
votes
0answers
19 views

JavaScript templating trick or treat?

I've recently been looking into using JavaScript for templating and I was wondering about the legibility of using this approach. I understand that JavaScript templating is a very common and much ...
1
vote
1answer
69 views

Get or infer template type from inherited member

So I have an assignment from college where I have to apply multiple metaheuristics to different problems. I thought that I should make everything as modular and reusable as possible to reuse ...
-2
votes
0answers
31 views

Can I use iPhone/ android icons on my templates [closed]

So I want to use Ionicons, and it contains iphone/android icons (such as close button 'X' icon, delete icon, etc.) The thing is that Im create a web template and I need to use these icons, is it ...
0
votes
1answer
29 views

Can I use an external Mustache template without Ajax?

I wrote up a site using Mustache to template it. Right now though, the template is embedded in the page, which defeats the purpose of using the template since I'll need to copy it to any other pages ...
0
votes
2answers
276 views

Why are the smart folks who write and adopt react.js okay with the way markup is tightly-coupled/buried inside Javascript?

Quite a while ago there was a concerted trend in the industry to move towards adopting templating to separate markup from logic, or something like that. The result was much more pleasing to the eye ...
1
vote
2answers
119 views

C++ Parametric Polymorphism

In the wikipedia article on Parametric Polymorphism, is the following commentary on C++. Can anyone explain what it's referring to when talking about "ad hoc aspects"? (I think it needs a ...
3
votes
1answer
955 views

Template Function: Passing Iterators

I am struggling with making a design choice in the following setup: I am writing (C++) functions which take a pair of iterators (to template containers) and compute a return value of the same type ...
1
vote
0answers
49 views

User-editable templates for reporting: alternatives to word? [closed]

Not sure if this is the right platform for this, but here goes :) Throughout my career I have been generating reports for users, and most of the times it always started from a Word template ...
5
votes
1answer
217 views

Command pipeline design question - where to place validation?

Here is the situation: I have a database and a class that is basically a representation of a set of fields of different tables in it. Let's call it Message. "Message" does not know of the database ...
1
vote
1answer
52 views

Is opening a templating engine to users a bad idea?

My site allows users to create custom HTML templates for their profiles (very much like Tumblr and the theme system), and I picked the Twig template engine for the site. However, I'm not sure if ...
19
votes
8answers
2k views

How to spread awareness for generic programming among team members?

I am staying in an environment, where people believe: Java generics are the feature exclusively used for library writing and not for the real coding. C++ is an OO programming language; template is ...
3
votes
6answers
313 views

Am I wrong to disagree with A Gentle Introduction to symfony's template best practices? [closed]

I am currently learning symfony and going through the book A Gentle Introduction to symfony and came across this section in "Chapter 4: The Basics of Page Creation" on creating templates (or views): ...
1
vote
1answer
82 views

Templating a member name

I'm writing a library that provides graphs for search algorithms. Usually you want to rank nodes using a priority queue. Normally you want to search for an specific node in the queue and lower its ...
5
votes
5answers
4k views

Template Functions and Function templates in C++

I came across a question which asked the difference between Function Templates and Template Functions in C++ and also Template Classes and Class Templates. I was under the impression that Function ...
6
votes
1answer
231 views

Whether to abstract small repeating code segments in HTML templates?

(The framework used in question is AngularJS so the question can be translated as "Whether to introduce Directives for small repeating code segments in Views") As a developer who focuses on Java ...
28
votes
10answers
4k views

Is template “metaprogramming” in Java a good idea?

There is a source file in a rather large project with several functions that are extremely performance-sensitive (called millions of times per second). In fact, the previous maintainer decided to ...
0
votes
2answers
2k views

How can I learn how to use Smarty effectively?

I have some experience in PHP4, but after learning the object-oriented parts of PHP, I'm having difficulty understanding how to use the Smarty template engine. The official documentation appears to ...
20
votes
4answers
2k views

What about LISP, if anything, makes it easier to implement macro systems?

I'm learning Scheme from the SICP and I'm getting the impression that a big part of what makes Scheme and, even more so, LISP special is the macro system. But, since macros are expanded at ...
7
votes
1answer
3k views

Does doxygen support templates for the HTML output?

I've documented my code for doxygen, but I don't want the default HTML it gives. I know I can customize it by providing custom CSS, headers, footers, etc. (like GNOME does), and how I can add common ...
1
vote
1answer
988 views

C++ Templates where the type is a shared_ptr

When creating template classes in C++, if the type upon which the template will be specialized is intended to be a shared_ptr type, is it better to make T a shared_ptr type or make T a non-pointer ...
1
vote
1answer
218 views

C++ Template Metaprogramming and Call By Need Evaluation

I recently wrote a fairly complex C++ meta function that boils down to: template <size_t N, typename val> struct Rec { using type = typename std::conditional<N == 0, val, ...
1
vote
2answers
144 views

Why is it bad if view engines encourage logic in templates

I once read this, because I wanted to see if handlebars is the right view engine for me or rather something else. A thing that I wonder since then is the following, why is it considered bad, if a ...
0
votes
1answer
42 views

Scoping template variables in “has-a” (compositional) relationships

I'm developing a new templating language for PHP, and one of the features is an object-oriented approach to nested child templates. For example, I can declare an object of type HtmlBuilder like this: ...
0
votes
1answer
241 views

Bootstrap licence free template

I´m creating a new website. For that I´m using a free bootstrap template. On top of my index page I have: A Design by W3layouts Author: W3layout Author URL: http://w3layouts.com License: ...
1
vote
1answer
524 views

Heredoc or an external template file in my bash script - how it affects readibility/maintanance?

I realise that this question may be down to personal preference but I'm pretty new to Bash / shell scripting so thought it'd be worth some research to see if there's some sort of standard/best ...
39
votes
9answers
7k views

What did people do before templates in C++? [duplicate]

I am not new to programming, but I am one that started a few years ago, and I do love templates. But in the before times, how did people deal with situations where they needed compile-time code ...
1
vote
1answer
118 views

Would this be considered a plugin or template type architecture?

I would like to build a system that basically offers the option to make various APIs interchangeable for usage to the end user. For example, the person using the software would have the option of ...
2
votes
2answers
250 views

How can I get better than O(N^2) space complexity for a type sequence search?

Suppose I have a type sequence through which I want to search: template <typename...> struct TypeSequence { using type = TypeSequence; }; I want to create a metafunction Search that returns ...
4
votes
1answer
2k views

What are the main differences between C++ templates and Java generics? [closed]

I'm a beginning C++ programmer coming from Java. It feels to me that C++ templates and Java generics are actually pretty similar. You use them in pretty much the same occasions and in the same way. ...
0
votes
2answers
158 views

Can I create a type, typedef or using statement that results in a different type if instantiated a second time or more?

Suppose I have a class that evaluates some computationally intensive function: class Value { private: int eval() { mCached = ExpensiveOperation(); return mCached; } static int ...
3
votes
1answer
372 views

Augmenting functionality of subclasses without code duplication in C++

I have to add common functionality to some classes that share the same superclass, preferably without bloating the superclass. The simplified inheritance chain looks like this: Element -> ...
5
votes
2answers
2k views

where exactly should python business logic be placed in django

I have just begun to learn Django/Python/Web Development. This problem has been troubling me for a while now. I am creating an application with multiple templates in Django. I have a views.py which ...
1
vote
2answers
168 views

Is it ok to start with templates in MVC development?

I'm new to web development and I've started working on a project in my company that uses DJANGO. I feel it flexible to start my development straight first from the templates. I think it will be easier ...
3
votes
1answer
327 views

Use a template to get alternate behaviour?

Is this a bad practice? const int sId(int const id); // true/false it doesn't matter template<bool i> const int sId(int const id) { return this->id = id; } const int MCard::sId(int ...
3
votes
5answers
185 views

Do input template languages exist?

When I have to create some textual representation of data, I can use a template language, so that my code does not have to worry about the structure of the output file - I can sometimes even write ...
0
votes
1answer
74 views

How should templates be named? [closed]

In D I can create templates like this: template Foo(A) { A add(A a, A b) { ... } A multiply(A a, A b) { ... } A concatenate(A a, A b) { ... } } What should a template be named ideally? ...
1
vote
1answer
213 views

heading in right direction? C++ and class templates

I'm working on some inherited code in C++ and am trying to use 2 classes with templates as I need 2-types of each class to operate on floating point or integer data (double v uint64_t to be exact). ...
-2
votes
1answer
374 views

Develop a website using mustache.js and PHP [closed]

I'm thinking of building a website using mustache.js to render the website and having PHP as the backend. The PHP will then mainly contain queries to the database and some SESSION checkings. ...
0
votes
1answer
186 views

How to make C++ template stack work with basic data types and compound variables?

Templates are nice for similar algorithms of different data types. Say I make a template stack of a basic data type... Stack<int> stck(10); stck.Push(5); I'd pop it... int x = stck.Pop(); ...
3
votes
4answers
458 views

What are the perks and drawbacks of using html templates versus building the html in-code [closed]

As far as I can see there are two ways of building a html page: "inside" the language (I'll call it building for lack of a better name) or outside the language (using templates). Let me explain a bit ...
5
votes
3answers
1k views

Differences betwen HTML templating systems

I'm looking at backbone.js and noticed that it supports various templating systems (they specifically refer to Mustache.js, Haml-js, and Eco, but I understand it can support even more)(like Pure and ...
1
vote
5answers
3k views

What file extension do you use for your template/view files in PHP? [closed]

I'm building a Model-View-Controller framework, and it has come time to decide how I will be creating and using view templates and layouts. Some frameworks use special extensions for these files. ...
-1
votes
1answer
49 views

Load all templates at startup?

I am developing a jQuery mobile app. In this app, i often use Mustache.js templates in separate html files. Actually, every template is needed by the user, but my app loads a template (via GET method) ...
10
votes
1answer
2k views

“C++ Templates: The Complete Guide” (c) 2002 — up to date with C++11?

The book C++ Templates: The Complete Guide, (c) 2002, looks very appealing to me, but as it's 12 years old, I'm concerned it may be out of date. There are some highly favorable Amazon reviews dated ...
3
votes
3answers
2k views

Arrays vs Objects in view template

I am wondering, in view templates, what would contribute to me choosing between using arrays or objects for getting things printed out in arrays {{$user->zip_code}} vs {{$user['zip_code']}} I'm ...
0
votes
1answer
4k views

What exactly is bootstrap admin-template and how it is supposed to be used

So this is my second ASP.NET MVC 4 project. It's decided that for this one we will use this template and it was said in a way that I felt really stupid for not knowing how exactly this template will ...
3
votes
1answer
4k views

Software Health Check Audit Template / Checklist [closed]

Does anyone know of a template / checklist that can be used to conduct a software health check. My team supports a number of legacy applications and we have been asked to present a score card to ...
2
votes
1answer
334 views

Main method templating

Now that I've gotten into a dependency injection groove, I find main methods for different applications all look basically the same. This is similar to stuff you might find on the Guice documentation, ...
4
votes
3answers
643 views

Custom PHP Template Engine

I've been developing a custom PHP template engine to suit just my needs and also to get a little more practice with PHP. What I did was to create a Template class that simply receives as constructor ...
2
votes
4answers
8k views

php templating with codeigniter

I am currently develop a website application in codeigniter, and I'd like to do something in PHP / CodeIgniter where I can make a common template for separate sections of the website. I was thinking ...