Live data from Hacker News

Show HN: PHP Code Generator – A scaffolding framework

about.asika.tw

1–10 of 28 posts

Re: Show HN: PHP Code Generator – A scaffolding framework

#4
So 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.

Re: Show HN: PHP Code Generator – A scaffolding framework

#6
post #4

So 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 b…

>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...

Re: Show HN: PHP Code Generator – A scaffolding framework

#7
post #4

So 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 b…

PHP 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.

Re: Show HN: PHP Code Generator – A scaffolding framework

#8
post #7
post #4

So 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 b…

PHP 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.

This 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.

Re: Show HN: PHP Code Generator – A scaffolding framework

#9
post #8
post #7

Earlier quoted context omitted.

PHP 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.

This 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.

The 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.

Re: Show HN: PHP Code Generator – A scaffolding framework

#10
post #9
post #8

Earlier quoted context omitted.

This 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.

The 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.

That's why I hope StackPHP gets some traction and more people create framework agnostic libraries (e.g. phpleague).
Post reply on HN