16 points · by aviraldg · 13y ago · 14 comments
----
Ever since I was a kid, I loved making things - origami, board games, "robots", and so on. Naturally, when I first got my hands on a computer, I fell in love with it, just because I could create so many things with it. My personal interest back then, was videogames, so I started with creating simple text based games in BASIC. It wasn't the actual programming that interested me, but just the power, and the excitement of creating something new.
Now, I've picked up most of the major programming languages and I regularly hack on web dev projects. I've noticed that a large majority of websites/apps are simply CRUD apps with minor modifications here and there. Yet, we continue to create such apps manually, thus wasting hours of dev time on something that trivial. I do recognise that this is an obvious oversimplification, but why can't we just build one solid, well-engineered and well tested multiplatform solution for CRUD apps, and get done and over with it?
If I'm correct in my assumption that most developers are motivated not by the code they write, or the architectures they engineer, but the actual effect that those things have (as I mentioned earlier), then wouldn't it be much better for us to create higher level tools for working with CRUD business logic and focus our attention on the actual "hard" problems in CS, like AI, which could have a much greater impact on the world?
Seriously though, my knee jerk reaction was to write all the reasons this couldn't work. But instead, I think you should go ahead and start trying to build it. In the end even if you fail you'll have learned a great deal, and at least have created some code worth turning into libraries.
There are plenty of CRUD generators, but they are basic and just create bare bone CRUD. A lot of programmers don't even use the existing CRUD generators because they do things that aren't wanted.
Now you have this elaborate tool that's going to get insanely complex if you want to really cover everything. You will be spending your time tweaking the generator's config files and adhering to its restrictions. I only made mine generate code for 1 language too, I couldn't even imagine trying to support multiple languages.
Eventually you're going to monkey patch in so many stupid rules because you run into sites that need something you didn't think of, and then it's going to get into this jumbled mess of insanity that makes you want to kill people whenever you use it.
The solution is to leverage your code editor and create snippets that get you 90% of the way. Now you have the annoying boiler plate out of the way but you have end points and their respective http handlers separate for each resource.
Now if you need something specific it's as simple as editing the resource that needs something specific and you don't have to worry about anything.
You trade in some code duplication for modularity and simplicity. I'm going to make this trade all day, especially when you can eliminate most of the grunt work with snippets in your editor.
You want to maximize productivity?
1. Make some snippets for whatever tech you use.
2. Create an extremely basic project skeleton and put this on github. Then clone it for new projects.
3. ??
4. Profit.
That said, this is what our team set out to do. We just released on github the full client for a new type of CRUD app generator http://github.com/urbien/urbini focused on mobile web apps. Cloud backend is not open source, but is free to use.
Developer creates a Model in Web UI on the phone, tablet or a modern desktop browser, and the app prototype is done. Backbone.js models are generated and are sent to the browser when you point it to your app. Model definitions, templates, views, css, images are saved to appcache and LocalStorage and the data for models are saved to IndexedDB/WebSQL and are automatically synced with the server in background via CRUD. Is that what you had in mind?
- Business logic
- Workflow
- User interaction
You cannot have a "one size fits all" solution for the above. Hope this answers your question.
Eventually you'll see for yourself that you can't make the scaffold generators do X, Y, or Z custom requirements yourself and you'll probably drop this notion.
Libraries and frameworks can make repetitive tasks easier, but there's nothing out there yet that's going to write the majority of a non-trivial App for you.
Anyway, I guess I got the title for the post wrong. The main point here is that:
1. CRUD is repetitive.
2. CRUD is boring.
3. Why don't we solve better, harder problems and leave CRUD to the non-programmers?