Skip to main content

Questions tagged [code-generation]

138 votes
27 answers
33k views

If something can be generated, then that thing is data, not code. Given that, isn't this whole idea of source code generation a misunderstanding? That is, if there is a code generator for something, ...
112 votes
22 answers
134k views

After reading the book The Pragmatic Programmer, one of the arguments I found most interesting was "write code that writes code". I tried searching over the net for some more explanations or articles ...
51 votes
5 answers
15k views

I'm developing a .Net application that uses google protocol buffers. Historically the application used the approach, advocated by the protobuf-net team, of decorating the classes with attributes ...
Dave Hillier's user avatar
  • 3,938
33 votes
6 answers
10k views

Why not have the compiler take a program like this: function a(b) { return b^2 }; function c(b) { return a(b) + 5 }; and convert it into a program like this: function c(b) { return b^2 + 5 }; ...
moonman239's user avatar
  • 2,063
23 votes
8 answers
6k views

I have a C header that is generated from a CSV file and a Python script. The C header mainly contains a list of #define constants. I want to be able to detect manual changes to this header during ...
9a3eedi's user avatar
  • 2,099
22 votes
4 answers
71k views

Is there an easy way to visualize the step between assembling code to machine code? For example if you open about a binary file in notepad you see a textually formatted representation of machine code....
user12979's user avatar
  • 375
13 votes
4 answers
4k views

One of my colleagues likes to use automatic code generators, which create large amounts of code that is poorly documented and very hard to maintain. Is the cost of using a code generator worth the ...
Mumbles's user avatar
  • 469
13 votes
6 answers
20k views

In response to my question regarding Java source code generation, I received this answer warning me about potential maintenance problems: mixing auto-generated code always pose a risk of someone ...
Tony the Pony's user avatar
12 votes
2 answers
1k views

tl;dr Some widely used programs, which generate html, will only generate opening paragraph tags, and not closing ones, assuming that the browser will properly close paragraphs. On the face of it, it ...
blueberryfields's user avatar
11 votes
1 answer
10k views

I have simple POCO classes, like this: public class Book { public string BookId { get; set; } public string Name { get; set; } //etc... } I want to get all those classes and generate ...
Yurii N.'s user avatar
  • 341
11 votes
2 answers
667 views

This is part of a series of questions which focuses on a project called the Abstraction Project, which aims to abstract the concepts used in language design in the form of a framework. Another ...
Allen Clark Copeland Jr's user avatar
10 votes
4 answers
2k views

This is part of a series of questions which focuses on the sister project to the Abstraction Project, which aims to abstract the concepts used in language design in the form of a framework. The ...
10 votes
5 answers
4k views

Consider a situation where a class implements the same basic behavior, methods, et cetera, but multiple different versions of that class could exist for different uses. In my particular case, I have a ...
Parker Hoyes's user avatar
8 votes
3 answers
2k views

In this and this stack overflow questions, the answers state that C as a compiler backend is a bad idea. But why? C has many compilers that can heavily optimize it. Every platform has a compiler ...
Kied Llaentenn's user avatar
8 votes
4 answers
4k views

My team doesn't write tests for generated code (e.g. some POJOs). An engineer that I greatly respect recently wrote this on the subject: Research over the past 10 years has revealed that generated ...
Justin R.'s user avatar
  • 189

15 30 50 per page
1
2 3 4 5