Skip to main content
Post Closed as "Duplicate" by gnat, user40980, Bart van Ingen Schenau, Kilian Foth, user22815
Question Protected by gnat

what What did people do before templates in c++C++?

Not a newbie programmerI am not new to programming, but I am one that started one 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 generation like templates? I'm guessing horrible, horrible macros (at least that's how I'd do it), but googling the above question only gets me pages and pages of template tutorials.

There are many arguments against using templates, and while it typically boils down to readability, "YAGNI""YAGNI", and complaining about how poorly it is implementimplemented, there is not a lot out there on the alternatives with similar power. When I do need to do some sort of compile-time generics and do want to keep my code DRYDRY, how does/did one avoid using templates?

what did people do before templates in c++?

Not a newbie programmer but one that started one 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 generation like templates? I'm guessing horrible, horrible macros (at least that's how I'd do it), but googling the above question only gets me pages and pages of template tutorials.

There are many arguments against using templates, and while it typically boils down to readability, "YAGNI", and complaining about how poorly it is implement, there is not a lot out there on the alternatives with similar power. When I do need to do some sort of compile-time generics and do want to keep my code DRY, how does/did one avoid using templates?

What did people do before templates in C++?

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 generation like templates? I'm guessing horrible, horrible macros (at least that's how I'd do it), but googling the above question only gets me pages and pages of template tutorials.

There are many arguments against using templates, and while it typically boils down to readability, "YAGNI", and complaining about how poorly it is implemented, there is not a lot out there on the alternatives with similar power. When I do need to do some sort of compile-time generics and do want to keep my code DRY, how does/did one avoid using templates?

spelling, formatting, tags
Source Link
gnat
  • 20.8k
  • 29
  • 115
  • 295

Not a newbnewbie programmer but one that started one 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 generation like templates? I'm guessing horrible, horrible macros (at least that's how I'd do it), but googling the above question only gets me pages and pages of template tutorials. 

There are many arguments against using templates, and while it typically boils down to readibilityreadability, "YAGNI", and complaining about how poorly it is implement, there is not a lot out there on the alternatives with similar power. When I do need to do some sort of compiletimecompile-genericstime generics and do want to keep my code DRY, how does/did one avoid using templates?

Not a newb programmer but one that started one 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 generation like templates? I'm guessing horrible, horrible macros (at least that's how I'd do it), but googling the above question only gets me pages and pages of template tutorials. There are many arguments against using templates, and while it typically boils down to readibility, "YAGNI", and complaining about how poorly it is implement, there is not a lot out there on the alternatives with similar power. When I do need to do some sort of compiletime-generics and do want to keep my code DRY, how does/did one avoid using templates?

Not a newbie programmer but one that started one 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 generation like templates? I'm guessing horrible, horrible macros (at least that's how I'd do it), but googling the above question only gets me pages and pages of template tutorials. 

There are many arguments against using templates, and while it typically boils down to readability, "YAGNI", and complaining about how poorly it is implement, there is not a lot out there on the alternatives with similar power. When I do need to do some sort of compile-time generics and do want to keep my code DRY, how does/did one avoid using templates?

Source Link
IdeaHat
  • 895
  • 1
  • 6
  • 12

what did people do before templates in c++?

Not a newb programmer but one that started one 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 generation like templates? I'm guessing horrible, horrible macros (at least that's how I'd do it), but googling the above question only gets me pages and pages of template tutorials. There are many arguments against using templates, and while it typically boils down to readibility, "YAGNI", and complaining about how poorly it is implement, there is not a lot out there on the alternatives with similar power. When I do need to do some sort of compiletime-generics and do want to keep my code DRY, how does/did one avoid using templates?