5 ms·
Show HN: PHP Code Generator – A scaffolding framework
- based2 12y agohttps://minuteproject.wikispaces.com/Propel https://minuteproject.wikispaces.com/Propel https://minuteproject.wikispaces.com/Php+doctrine https://minuteproject.wikispaces.com/Php+doctrine
- RossM 12y agoScaffolding in terms of code templates, rather than data model scaffolding.
- lkrubner 12y agoSo now we have PHP, which started as a lightweight script language, following Java down the road toward a more verbose style, and so now we need code templates? Java programmers have been doing this for awhile, they rely on IDEs such as Eclipse or IntelliJ to write some of the boilerplate for them, and that is important in a language like Java, which has so much boilerplate. But with Java, that boilerplate at least buys you something: static typing and type checks, which allows the compiler to check for bugs, and which offers immense benefits in terms of speed. In PHP, we get... what? Apparently PHP is now verbose enough that people feel the need to write code templates for it, but what benefit do we get in exchange for all of that boilerplate? PHP is still dynamic, and it is still very slow. This seems like the worst of all worlds.
- asocial 12y ago>Apparently PHP is now verbose enough that people feel the need to write code templates for it It isn't though. PHP is many things but overly verbose isn't one of them * . Although there does seem to be a drive by some developers to make PHP look and act as much like Java as possible. Maybe this comes from discomfort at PHP not being structured or strict enough out of the box for their liking. If you've only ever dealt with well-engineered languages which have a certain, coherent set of patterns and paradigms baked in, and which demand you write your code a certain way, and you approach PHP, you're going to have a problem. I don't know why a tool like this would be useful, but it wouldn't be because of the language. PHP exposes its own token parser - you can generate PHP code with much less abstraction than this. *classes like IteratorIterator aside...
- debacle 12y agoPHP has a real glut of talented programmers right now, which is why you're seeing the same overengineering that plagues Java. Fun problems have dozens of solutions because everyone wants to work on them. Templating is just one of those. Weird, case-specific conventions are another.
- Gigablah 12y agoThis isn't really anything new. Yii and Symfony have been doing code generation for years. Someone simply decided to create a library that's not framework specific.
- debacle 12y agoThe problem is that everyone is creating every library, over and over. It is a real problem in PHP that there is no single, polished solution and every framework is being reinvented (and breaking BC) constantly.
- Gigablah 12y agoThat's why I hope StackPHP gets some traction and more people create framework agnostic libraries (e.g. phpleague).
- debacle 12y agohttp://xkcd.com/927/ http://xkcd.com/927/
- Gigablah 12y agoThat's cute. What's your solution? Stick with CodeIgniter?
- lkrubner 12y agoOr go work on original problems that have not already been solved dozens of times. Projects like this are a waste of talent. There are clearly some smart programmers writing libraries for PHP. The question is, why do they keep writing the same stuff, over and over? All of humanity would benefit if some of these smart people focused on doing something domain specific (medicine, law, education) or dove deeper and helped re-invent the stack at a deeper level. Maybe re-invent PHP as a language that has primitives for concurrency. Or leave PHP and work on other problems that plague the tech industry (the obsoleteness of HTTP/HTML as a way of delivering documents, when people increasingly want software over TCP, not documents).
- Gigablah 12y agoSo this is basically a PHP version of Yeoman?
- angrybits 12y agoI have been writing an application that is a thin PHP application on top of a relational model that implements (what I hope is) a clever business. This framework would not solve a single problem I have had. None of the frameworks do, which is why I'm not using one of them. The only thing I really found lacking in core PHP was a way to manage the urls. (In this case, query strings.) I believe this would have been difficult on any platform, as the data is deeply hierarchical so the urls would be gnarly no matter what. So I wrote a class that understands the entity hierarchy and can generate query string sets that are needed for each level in the scope. I wish the PHP community would spend less effort trying to be rails and more effort on simply removing pain points of basic, idiomatic PHP development.
- EGreg 12y agoThis is done by http://platform.qbix.com http://platform.qbix.com as well. You may wish to look at http://platform.qbix.com/guide/models http://platform.qbix.com/guide/models
- Mahn 12y agoAs someone who has never used a code generator before, what is the use case for this?
- dawnstra8 12y agoIt helps you solve the problem quicker and more cleanly.