News for hackers. Stuff that matters.
Re:Ask HN: Weirdest hack that you ever saw in production? by C4stor on Sunday March 25, 2018 @11:03AM (#16672468)
Honestly, that sounds pretty normal, or at least ok, to me. Auto-generation of code is one of my primary daily tools, and I think it's just right for whole categories of problems. I currently generate a good third of my compiled sources, and also generate a rudimentary typescript library out of my source code to be used by the my colleagues.

That being said, I usually work in Scala which provides language-based tools for that, so it definitely helps with avoiding the "dark magic" sentiment you may have had.

But why was it done that way ? It reduces boilerplate, copy-paste errors, code duplication, in ways sometimes not made possible by inheritance or composition.

Re:Ask HN: Weirdest hack that you ever saw in production? by ups101 on Sunday March 25, 2018 @01:13PM (#16673164)
Did you consider the point about code being defined only at build-time, not being available for inspection by the developer? That sets it apart from most auto-generating code scenarios I've seen.
Re:Ask HN: Weirdest hack that you ever saw in production? by mikelevins on Sunday March 25, 2018 @12:59PM (#16673080)
Hey, I'm a common lisp programmer. I'm down with automated code generation. But in Lisp or in Scala, as you say, it's in-language, so you can see what's going on by reading the code. This was different.