Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. Ruminating on code generation

Ruminating on code generation

Scheduled Pinned Locked Moved The Lounge
asp-netcomai-codingtools
22 Posts 13 Posters 4 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • honey the codewitchH Offline
    honey the codewitchH Offline
    honey the codewitch
    wrote on last edited by
    #1

    My father was a toolmaker. A toolmaker is essentially someone who creates tools that do things like stamp sheet-metal. He was brilliant. I could have seen myself involved in fabrication quite happily in a different life. My driving core is that I like to build - I just happened to settle on software. I especially like to build things for other developers. I suppose it's the toolmaker in me. :) I love writing code generation tools. Especially the ones that write code that's not realistic to do by hand, such as LALR parsers. Unfortunately, reading the room I feel like it's not a well understood art. Some of my most elaborate, really cool tools like Slang/Deslang[^] collect dust on this site, despite all the amazing things you can create with it[^] In the end it has sort of put me off. Maybe code generation just isn't cool enough for the cool kids.

    To err is human. Fortune favors the monsters.

    Greg UtasG Mike HankeyM P J D 10 Replies Last reply
    0
    • honey the codewitchH honey the codewitch

      My father was a toolmaker. A toolmaker is essentially someone who creates tools that do things like stamp sheet-metal. He was brilliant. I could have seen myself involved in fabrication quite happily in a different life. My driving core is that I like to build - I just happened to settle on software. I especially like to build things for other developers. I suppose it's the toolmaker in me. :) I love writing code generation tools. Especially the ones that write code that's not realistic to do by hand, such as LALR parsers. Unfortunately, reading the room I feel like it's not a well understood art. Some of my most elaborate, really cool tools like Slang/Deslang[^] collect dust on this site, despite all the amazing things you can create with it[^] In the end it has sort of put me off. Maybe code generation just isn't cool enough for the cool kids.

      To err is human. Fortune favors the monsters.

      Greg UtasG Offline
      Greg UtasG Offline
      Greg Utas
      wrote on last edited by
      #2

      I don't think it's a question of whether code generation is cool enough, but of use cases. A potential user must first have an application in mind that would benefit from a tool or framework. Then they have to learn how to use it to build that application. To overcome those hurdles, it's important to have some non-trivial examples that use the tool or framework.

      Robust Services Core | Software Techniques for Lemmings | Articles
      The fox knows many things, but the hedgehog knows one big thing.

      <p><a href="https://github.com/GregUtas/robust-services-core/blob/master/README.md">Robust Services Core</a>
      <em>The fox knows many things, but the hedgehog knows one big thing.</em></p>

      1 Reply Last reply
      0
      • honey the codewitchH honey the codewitch

        My father was a toolmaker. A toolmaker is essentially someone who creates tools that do things like stamp sheet-metal. He was brilliant. I could have seen myself involved in fabrication quite happily in a different life. My driving core is that I like to build - I just happened to settle on software. I especially like to build things for other developers. I suppose it's the toolmaker in me. :) I love writing code generation tools. Especially the ones that write code that's not realistic to do by hand, such as LALR parsers. Unfortunately, reading the room I feel like it's not a well understood art. Some of my most elaborate, really cool tools like Slang/Deslang[^] collect dust on this site, despite all the amazing things you can create with it[^] In the end it has sort of put me off. Maybe code generation just isn't cool enough for the cool kids.

        To err is human. Fortune favors the monsters.

        Mike HankeyM Offline
        Mike HankeyM Offline
        Mike Hankey
        wrote on last edited by
        #3

        My father (step father) was also a tool maker and a vary talented man but didn't bother to pass along any knowledge to me. But I've always been curious and eager to learn. I don't have the patience to do anything as precise as toolmaking but I love to create things.

        PartsBin an Electronics Part Organizer is finally available for download. JaxCoder.com

        1 Reply Last reply
        0
        • honey the codewitchH honey the codewitch

          My father was a toolmaker. A toolmaker is essentially someone who creates tools that do things like stamp sheet-metal. He was brilliant. I could have seen myself involved in fabrication quite happily in a different life. My driving core is that I like to build - I just happened to settle on software. I especially like to build things for other developers. I suppose it's the toolmaker in me. :) I love writing code generation tools. Especially the ones that write code that's not realistic to do by hand, such as LALR parsers. Unfortunately, reading the room I feel like it's not a well understood art. Some of my most elaborate, really cool tools like Slang/Deslang[^] collect dust on this site, despite all the amazing things you can create with it[^] In the end it has sort of put me off. Maybe code generation just isn't cool enough for the cool kids.

          To err is human. Fortune favors the monsters.

          P Online
          P Online
          PIEBALDconsult
          wrote on last edited by
          #4

          I also enjoy making software tools which help me or other developers. But no one else uses my tools. :( I also dislike using code written and published by other developers, I'd rather roll my own (in most cases).

          honey the codewitchH 1 Reply Last reply
          0
          • P PIEBALDconsult

            I also enjoy making software tools which help me or other developers. But no one else uses my tools. :( I also dislike using code written and published by other developers, I'd rather roll my own (in most cases).

            honey the codewitchH Offline
            honey the codewitchH Offline
            honey the codewitch
            wrote on last edited by
            #5

            It sounds like we're similar in that way. I have a whole ecosystem of code I use for IoT and it all works together beautifully. That's the advantage of rolling your own, but it sure is a lot of work!

            To err is human. Fortune favors the monsters.

            Mircea NeacsuM 1 Reply Last reply
            0
            • honey the codewitchH honey the codewitch

              My father was a toolmaker. A toolmaker is essentially someone who creates tools that do things like stamp sheet-metal. He was brilliant. I could have seen myself involved in fabrication quite happily in a different life. My driving core is that I like to build - I just happened to settle on software. I especially like to build things for other developers. I suppose it's the toolmaker in me. :) I love writing code generation tools. Especially the ones that write code that's not realistic to do by hand, such as LALR parsers. Unfortunately, reading the room I feel like it's not a well understood art. Some of my most elaborate, really cool tools like Slang/Deslang[^] collect dust on this site, despite all the amazing things you can create with it[^] In the end it has sort of put me off. Maybe code generation just isn't cool enough for the cool kids.

              To err is human. Fortune favors the monsters.

              J Offline
              J Offline
              Jacquers
              wrote on last edited by
              #6

              Maybe those code generators could become part of some low-code solution?

              1 Reply Last reply
              0
              • honey the codewitchH honey the codewitch

                My father was a toolmaker. A toolmaker is essentially someone who creates tools that do things like stamp sheet-metal. He was brilliant. I could have seen myself involved in fabrication quite happily in a different life. My driving core is that I like to build - I just happened to settle on software. I especially like to build things for other developers. I suppose it's the toolmaker in me. :) I love writing code generation tools. Especially the ones that write code that's not realistic to do by hand, such as LALR parsers. Unfortunately, reading the room I feel like it's not a well understood art. Some of my most elaborate, really cool tools like Slang/Deslang[^] collect dust on this site, despite all the amazing things you can create with it[^] In the end it has sort of put me off. Maybe code generation just isn't cool enough for the cool kids.

                To err is human. Fortune favors the monsters.

                D Offline
                D Offline
                David ONeil
                wrote on last edited by
                #7

                I suspect you are vastly overestimating the number of projects that really need code generators. And if I ever had a project that needed one, I would probably write my own, because while playing with parsing long ago I figured out a far simpler approach that I can actually understand. But I'm not cool, either, so don't pay attention to my opinion.

                Our Forgotten Astronomy | Object Oriented Programming with C++

                1 Reply Last reply
                0
                • honey the codewitchH honey the codewitch

                  My father was a toolmaker. A toolmaker is essentially someone who creates tools that do things like stamp sheet-metal. He was brilliant. I could have seen myself involved in fabrication quite happily in a different life. My driving core is that I like to build - I just happened to settle on software. I especially like to build things for other developers. I suppose it's the toolmaker in me. :) I love writing code generation tools. Especially the ones that write code that's not realistic to do by hand, such as LALR parsers. Unfortunately, reading the room I feel like it's not a well understood art. Some of my most elaborate, really cool tools like Slang/Deslang[^] collect dust on this site, despite all the amazing things you can create with it[^] In the end it has sort of put me off. Maybe code generation just isn't cool enough for the cool kids.

                  To err is human. Fortune favors the monsters.

                  L Offline
                  L Offline
                  Lost User
                  wrote on last edited by
                  #8

                  The Windows Store has a (developer's) tool section. If you never buy a ticket ...

                  "Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I

                  1 Reply Last reply
                  0
                  • honey the codewitchH honey the codewitch

                    My father was a toolmaker. A toolmaker is essentially someone who creates tools that do things like stamp sheet-metal. He was brilliant. I could have seen myself involved in fabrication quite happily in a different life. My driving core is that I like to build - I just happened to settle on software. I especially like to build things for other developers. I suppose it's the toolmaker in me. :) I love writing code generation tools. Especially the ones that write code that's not realistic to do by hand, such as LALR parsers. Unfortunately, reading the room I feel like it's not a well understood art. Some of my most elaborate, really cool tools like Slang/Deslang[^] collect dust on this site, despite all the amazing things you can create with it[^] In the end it has sort of put me off. Maybe code generation just isn't cool enough for the cool kids.

                    To err is human. Fortune favors the monsters.

                    L Offline
                    L Offline
                    Lost User
                    wrote on last edited by
                    #9

                    honey the codewitch wrote:

                    In the end it has sort of put me off. Maybe code generation just isn't cool enough for the cool kids.

                    Code generation was always cool. T4, DSL. Maybe you can explain it cooler?

                    Bastard Programmer from Hell :suss: "If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.

                    honey the codewitchH 1 Reply Last reply
                    0
                    • honey the codewitchH honey the codewitch

                      It sounds like we're similar in that way. I have a whole ecosystem of code I use for IoT and it all works together beautifully. That's the advantage of rolling your own, but it sure is a lot of work!

                      To err is human. Fortune favors the monsters.

                      Mircea NeacsuM Offline
                      Mircea NeacsuM Offline
                      Mircea Neacsu
                      wrote on last edited by
                      #10

                      I hope you guys don't miss the irony of all this: everyone complaining that no one wants to follow their path and prefer to make their own. Like my old boss used to say: managing programmers is worse than herding cats :laugh:

                      Mircea

                      D T S 3 Replies Last reply
                      0
                      • Mircea NeacsuM Mircea Neacsu

                        I hope you guys don't miss the irony of all this: everyone complaining that no one wants to follow their path and prefer to make their own. Like my old boss used to say: managing programmers is worse than herding cats :laugh:

                        Mircea

                        D Offline
                        D Offline
                        David ONeil
                        wrote on last edited by
                        #11

                        Mircea Neacsu wrote:

                        I hope you guys don't miss the irony of all this: everyone complaining that no one wants to follow their path and prefer to make their own.

                        For almost the ultimate example of this, read Qwertie's top comment thread in the second article she linked. :laugh:

                        Our Forgotten Astronomy | Object Oriented Programming with C++

                        Mircea NeacsuM 1 Reply Last reply
                        0
                        • D David ONeil

                          Mircea Neacsu wrote:

                          I hope you guys don't miss the irony of all this: everyone complaining that no one wants to follow their path and prefer to make their own.

                          For almost the ultimate example of this, read Qwertie's top comment thread in the second article she linked. :laugh:

                          Our Forgotten Astronomy | Object Oriented Programming with C++

                          Mircea NeacsuM Offline
                          Mircea NeacsuM Offline
                          Mircea Neacsu
                          wrote on last edited by
                          #12

                          Yah, I noticed that one but I didn't want to lay it on too thick :laugh:

                          Mircea

                          1 Reply Last reply
                          0
                          • honey the codewitchH honey the codewitch

                            My father was a toolmaker. A toolmaker is essentially someone who creates tools that do things like stamp sheet-metal. He was brilliant. I could have seen myself involved in fabrication quite happily in a different life. My driving core is that I like to build - I just happened to settle on software. I especially like to build things for other developers. I suppose it's the toolmaker in me. :) I love writing code generation tools. Especially the ones that write code that's not realistic to do by hand, such as LALR parsers. Unfortunately, reading the room I feel like it's not a well understood art. Some of my most elaborate, really cool tools like Slang/Deslang[^] collect dust on this site, despite all the amazing things you can create with it[^] In the end it has sort of put me off. Maybe code generation just isn't cool enough for the cool kids.

                            To err is human. Fortune favors the monsters.

                            J Offline
                            J Offline
                            jmaida
                            wrote on last edited by
                            #13

                            Don't give up the ship. Code generation is not restricted to generating actual code. (I use C ansi c90) Well designed libraries with well designed interfacing are as good as many code generators. I designed a pseudo-human language command line parser that used a giant table lookup process connected with the appropriate code templates to match. The key was the tree transversal database library used to glue it together. I designed it make the code generation process work for me which in the end made it easier for others to mimic and grow the process. I don't fully understand you work, but I am not a C++ guy so that makes it hard. Stay with it. Love your zeal. My lookup table example 2 = string 1 = number 5 = quoted string Parsed Syntax entry-point, "help table entry" "ROT", ROTATE, "ROTATE - interactive rotate currently edited part", "ROT_2", ROTATE_2, "ROTATE part - show euler angles(deg) for part", "ROT_2_1_1_1", ROTATE_2_1_1_1, "ROTATE part x y z - apply euler angles(deg) to part", "ROT_2_X_1", ROTATE_2_X_1, "ROTATE part axis deg - rotate part on X Y or Z", "ROT_2_Y_1", ROTATE_2_Y_1, "ROTATE part axis deg - rotate part on X Y or Z", "ROT_2_Z_1", ROTATE_2_Z_1, "ROTATE part axis deg - rotate part on X Y or Z", "ROT_X_1", ROTATE_X_1, "ROTATE X angle - rotate(deg) default part on X axis", "ROT_Y_1", ROTATE_Y_1, "ROTATE Y angle - rotate(deg) default part on Y axis", "ROT_Z_1", ROTATE_Z_1, "ROTATE Z angle - rotate(deg) default part on Z axis", "ROT_SCR_5", ROTATE_SCRIPT, "ROTATE SCRIPT \"file\" - create rotate command file",

                            "A little time, a little trouble, your better day" Badfinger

                            1 Reply Last reply
                            0
                            • L Lost User

                              honey the codewitch wrote:

                              In the end it has sort of put me off. Maybe code generation just isn't cool enough for the cool kids.

                              Code generation was always cool. T4, DSL. Maybe you can explain it cooler?

                              Bastard Programmer from Hell :suss: "If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.

                              honey the codewitchH Offline
                              honey the codewitchH Offline
                              honey the codewitch
                              wrote on last edited by
                              #14

                              Deslang and Slang are kind of hard to explain. I spent several articles trying, but the issue is you need background in the CodeDOM - pretty solid background actually, not only to appreciate it, but to understand it. The CodeDOM isn't well traveled technology. It's primarily used by ASP.NET and not touched by most people. Even if that weren't the case, there's the meta issue, and that is Deslang is a code generator generator. Yeah. A code generator generator. I use it in projects that generate code so that I can input C# "templates" and then modify them and fill them out in the generator app itself - turning these "templates" into full fledged source. And that source will be rendered in C#, VB.NET or potentially other .NET languages.

                              To err is human. Fortune favors the monsters.

                              J L 2 Replies Last reply
                              0
                              • honey the codewitchH honey the codewitch

                                Deslang and Slang are kind of hard to explain. I spent several articles trying, but the issue is you need background in the CodeDOM - pretty solid background actually, not only to appreciate it, but to understand it. The CodeDOM isn't well traveled technology. It's primarily used by ASP.NET and not touched by most people. Even if that weren't the case, there's the meta issue, and that is Deslang is a code generator generator. Yeah. A code generator generator. I use it in projects that generate code so that I can input C# "templates" and then modify them and fill them out in the generator app itself - turning these "templates" into full fledged source. And that source will be rendered in C#, VB.NET or potentially other .NET languages.

                                To err is human. Fortune favors the monsters.

                                J Offline
                                J Offline
                                jmaida
                                wrote on last edited by
                                #15

                                Understand it better. CodeDOM is new to me. Not a C# guy either. But I get the picture. Thanx

                                "A little time, a little trouble, your better day" Badfinger

                                1 Reply Last reply
                                0
                                • Mircea NeacsuM Mircea Neacsu

                                  I hope you guys don't miss the irony of all this: everyone complaining that no one wants to follow their path and prefer to make their own. Like my old boss used to say: managing programmers is worse than herding cats :laugh:

                                  Mircea

                                  T Offline
                                  T Offline
                                  trønderen
                                  wrote on last edited by
                                  #16

                                  Mircea Neacsu wrote:

                                  Like my old boss used to say: managing programmers is worse than herding cats :laugh:

                                  Old but good: Geek&Poke 2011-03-20: Coders[^]

                                  1 Reply Last reply
                                  0
                                  • honey the codewitchH honey the codewitch

                                    My father was a toolmaker. A toolmaker is essentially someone who creates tools that do things like stamp sheet-metal. He was brilliant. I could have seen myself involved in fabrication quite happily in a different life. My driving core is that I like to build - I just happened to settle on software. I especially like to build things for other developers. I suppose it's the toolmaker in me. :) I love writing code generation tools. Especially the ones that write code that's not realistic to do by hand, such as LALR parsers. Unfortunately, reading the room I feel like it's not a well understood art. Some of my most elaborate, really cool tools like Slang/Deslang[^] collect dust on this site, despite all the amazing things you can create with it[^] In the end it has sort of put me off. Maybe code generation just isn't cool enough for the cool kids.

                                    To err is human. Fortune favors the monsters.

                                    R Offline
                                    R Offline
                                    Ryan Peden
                                    wrote on last edited by
                                    #17

                                    For what it's worth, I think your projects are great. And I think the number of views and downloads are very respectable. Especially 37.7k views on the Parsley article. That is phenomenal compared to most articles on the site! When it comes to projects like this, you might find that getting many people to use them involves a fair bit of marketing. Using Mkdocs to create a simple GitHub pages site describing the project and giving some examples might would likely get more engagement than a CodeProject post about it. But it's quite a bit of extra work with no guaranteed return. Plenty of people think this stuff is cool don't leave a comment saying so. But the tens of thousands of views on articles you have written like this one tell me that plenty of people like and respect the work you do!

                                    1 Reply Last reply
                                    0
                                    • honey the codewitchH honey the codewitch

                                      My father was a toolmaker. A toolmaker is essentially someone who creates tools that do things like stamp sheet-metal. He was brilliant. I could have seen myself involved in fabrication quite happily in a different life. My driving core is that I like to build - I just happened to settle on software. I especially like to build things for other developers. I suppose it's the toolmaker in me. :) I love writing code generation tools. Especially the ones that write code that's not realistic to do by hand, such as LALR parsers. Unfortunately, reading the room I feel like it's not a well understood art. Some of my most elaborate, really cool tools like Slang/Deslang[^] collect dust on this site, despite all the amazing things you can create with it[^] In the end it has sort of put me off. Maybe code generation just isn't cool enough for the cool kids.

                                      To err is human. Fortune favors the monsters.

                                      M Offline
                                      M Offline
                                      MSBassSinger
                                      wrote on last edited by
                                      #18

                                      Code generators can be useful when they meet a target need. For example, I avoid Entity Framework (EF) whenever possible. I prefer a generic DAC and stored procedures instead of EF. That is my preference based on years of my experience delivering well performing, scalable apps. So that statement is not up for debate in this thread. The point of that is that it led me to write a code generation tool that creates the query, insert, update, delete (soft and hard), and restore (for soft deletes) stored procedures, and then writes the C# class(es) to encapsulate the data and to use the DAC to populate those POCO classes. What I found useful was to start with a template file for each type of file generated, then generate the output code. It saves me quite a bit of time in development, allows me to change the design of the classes by template rather than code change in the generator. The less time a developer spends on rote, repetitive coding, the more time they have to add quality.

                                      L 1 Reply Last reply
                                      0
                                      • Mircea NeacsuM Mircea Neacsu

                                        I hope you guys don't miss the irony of all this: everyone complaining that no one wants to follow their path and prefer to make their own. Like my old boss used to say: managing programmers is worse than herding cats :laugh:

                                        Mircea

                                        S Offline
                                        S Offline
                                        sasadler
                                        wrote on last edited by
                                        #19

                                        Ha. Yep, I've almost always followed my own path (firmware engineer - retired). I've built tons of tools in my career but almost all were specific to project I was working on. And in general, I was the only firmware guy so the tools would have been mostly useless for the Windows developers.

                                        1 Reply Last reply
                                        0
                                        • M MSBassSinger

                                          Code generators can be useful when they meet a target need. For example, I avoid Entity Framework (EF) whenever possible. I prefer a generic DAC and stored procedures instead of EF. That is my preference based on years of my experience delivering well performing, scalable apps. So that statement is not up for debate in this thread. The point of that is that it led me to write a code generation tool that creates the query, insert, update, delete (soft and hard), and restore (for soft deletes) stored procedures, and then writes the C# class(es) to encapsulate the data and to use the DAC to populate those POCO classes. What I found useful was to start with a template file for each type of file generated, then generate the output code. It saves me quite a bit of time in development, allows me to change the design of the classes by template rather than code change in the generator. The less time a developer spends on rote, repetitive coding, the more time they have to add quality.

                                          L Offline
                                          L Offline
                                          Lost User
                                          wrote on last edited by
                                          #20

                                          EF is not a replacement for stored procedures. EF is not a server-side DDL or DML. It is a client-side object to data mapper.

                                          "Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I

                                          M 1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • World
                                          • Users
                                          • Groups