News for hackers. Stuff that matters.
Re:A Docker-inspired Heroku clone in 100 lines of PHP by rand1012 on Monday December 21, 2015 @01:28PM (#10772507)
I have never found "X lines of code" to be impressive. Write clean code and polish it and make it readable. Who cares how long it is. Hackers brag about lines, not engineers.
Re:A Docker-inspired Heroku clone in 100 lines of PHP by diggan on Monday December 21, 2015 @01:46PM (#10772632)
Well, could be a reason this place is called Hackers News rather than Engineers News
Re:A Docker-inspired Heroku clone in 100 lines of PHP by gkoberger on Monday December 21, 2015 @01:37PM (#10772577)
The actual number doesn't matter. It's just shorthand for "It's easy and quick! This isn't a mammoth 10k-line library".
Re:A Docker-inspired Heroku clone in 100 lines of PHP by mbreese on Monday December 21, 2015 @02:17PM (#10772822)
It's also shorthand for "doesn't have feature X or support Y and hasn't really been tested!"
Re:A Docker-inspired Heroku clone in 100 lines of PHP by georgestephanis on Monday December 21, 2015 @02:42PM (#10772964)
In only 100 lines of PHP!

Requires Symfony.

Re:A Docker-inspired Heroku clone in 100 lines of PHP by dangrossman on Monday December 21, 2015 @03:35PM (#10773324)
It requires Silex, a micro-framework, not Symfony. Symfony is a much larger framework that isn't required. He just used two of its modular components, Request for HTTP request parsing, and Process for spawning subprocesses.
Re:A Docker-inspired Heroku clone in 100 lines of PHP by MichaelApproved on Monday December 21, 2015 @02:45PM (#10772978)
Requiring libraries/frameworks shouldn't detract from something like this. I'd be more worried about bugs and feature support.
Re:A Docker-inspired Heroku clone in 100 lines of PHP by ihsw on Monday December 21, 2015 @03:09PM (#10773150)
Nah, requiring Symfony is like requiring Django. Doesn't make much sense.
Re:A Docker-inspired Heroku clone in 100 lines of PHP by mod on Monday December 21, 2015 @03:46PM (#10773393)
It's actually Silex. Maybe that makes more sense.
Re:A Docker-inspired Heroku clone in 100 lines of PHP by aikah on Monday December 21, 2015 @05:46PM (#10774123)
Silex is hardly a "micro framework", it's basically Symfony without the configuration files. So it's a LOT of code. I like it by the way, always hated the Spring like insanity of Symfony, but let's not pretend Silex + all Symfony libs the framework has to import are small.

The irony is that for this very project, Both Silex and Symfony\Process are completely redundant, especially with PHP bloated core APIs.

Re:A Docker-inspired Heroku clone in 100 lines of PHP by Gigablah on Monday December 21, 2015 @06:53PM (#10774512)
That's not correct. Silex replaces the Symfony DI (or service locator, if you will) component with something much simpler called Pimple. You can read the code within a few minutes.

The only other required libraries for Silex to function are the event dispatcher, routing (which you can swap out for something like nikic/FastRoute), and the request/response stuff. I'm not sure if you think that's a "lot" of code, but if you're rolling your own you'd probably end up using the HTTPFoundation stuff anyway.

Re:A Docker-inspired Heroku clone in 100 lines of PHP by aikah on Tuesday December 22, 2015 @01:42AM (#10776251)
> That's not correct. Silex replaces the Symfony DI (or service locator, if you will) component with something much simpler called Pimple. You can read the code within a few minutes.

That's exactly what I said, what is the point of your message? With Silex there is no configuration through XML or YAML. What is not correct?

Re:A Docker-inspired Heroku clone in 100 lines of PHP by Gigablah on Tuesday December 22, 2015 @09:55AM (#10778030)
You ranted about it being a "lot" of code. The default Silex installation doesn't even bring in the Security component, which is probably what prompted your comparison to Spring.

Event dispatching + kernel (basically a handler) + request/response isn't particularly complex, is it?

Re:A Docker-inspired Heroku clone in 100 lines of PHP by Killswitch on Monday December 21, 2015 @04:52PM (#10773795)
But it's not requiring Symfony.
Re:A Docker-inspired Heroku clone in 100 lines of PHP by mschuster91 on Monday December 21, 2015 @03:45PM (#10773385)
> Requires Symfony.

Silex, not Symfony, and better to rely on trusted library code than to reinvent the wheel and introduce vulnerabilities...

Re:A Docker-inspired Heroku clone in 100 lines of PHP by Killswitch on Monday December 21, 2015 @04:52PM (#10773794)
But it's not 100 LOC if you don't reinvent the wheel! /s
Re:A Docker-inspired Heroku clone in 100 lines of PHP by mmanfrin on Monday December 21, 2015 @06:14PM (#10774283)
People like to specialize and seek extremes of different metrics. Do you think that the demoscene is not impressive because they could do much more with more than 4k of code?

This comment is an example of the type of negativity that is unhelpful and creates the toxic atmosphere HN is renown for, and I believe you know that considering you posted with a throwaway.