Giter Club home page Giter Club logo

codegen-talk's Introduction

Source code generation with Gulp

Source code generation was a technique that was reasonably popular back in the 90s for the creation of N-Tier program, but has largely been subsumed by tools that generate proxies automatically on the client side, and ORMs on the server-side. Additionally, techniques like subclassing is reasonably effective in keeping the codebase tight.

Another popular use of code generation is the generation of state machines from source code. Again, improvements in programming languages with constructs like async/await in C# and Javascript mean these are less useful today.

However, they still retain some promise in the field of model driven engineering. The basic thrust of this is that large parts of a software is best written in a machine-like manner to improve readability and consistency. Code-generation ensures that consistency is maintained in large teams. As new ideas are introduced into the source code template, engineers will have to inspect the impact of these changes on all the files. While this sounds like hard work -- and it is. Over time, it ensures the entire code base is sound and consistently structured as if it were all written at the same time in the recent past.

Exercises

  1. Generates server.cs and client.js in dist

    $ gulp --gulpfile gulpfile-01.js

  2. Finds custom sections and replaces them with custom code

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.