Live data from Hacker News

Lumen – A micro-framework by Laravel

laravel-news.com

91–100 of 116 posts

Re: Lumen – A micro-framework by Laravel

#91
I've just created a project with lumen to have a look at it and lumen and all its vendor packages (with --no-dev and without tests) contain 1522 files and 102449 lines of code – according to cloc.

Am I doing something wrong or why does it call itself a "micro-framework". A newly created Slim project contains 7417 lines of code.

Re: Lumen – A micro-framework by Laravel

#92

Earlier quoted context omitted.

No. http://www.reddit.com/r/PHP/comments/2zhg6z/how_true_is_this... Read that and tell me that it is Ok..And see how that comment has been downvoted. That is PHP community for you. In 2015.

A single downvote on a subreddit is indicative of the PHP community as a whole? Well, shit, time to ditch the language... Why would you think the third value in ['ab', 'cd', '10', 'gh', '24'] would have a key of '10'? That's the value, not the key. The docs are quite clear on how this works: http://php.net/manual/en/control-structures.foreach.php foreach (array_expression as $value) vs. foreach (array_expression as $…

You've misunderstood. He only uses that (flat) array to populate the key-value array $c. His problem is that PHP oh-so-helpfully converts the string value to an int value. It's actually impossible to have string values as indices of an array when they are parsable as numbers in PHP. One of the many foibles that stem from conflating flat arrays and key-value maps. (For a real fun time, try reading the docs for array_merge.)

Anyway, it's not surprising. /r/PHP doesn't handle criticism well.

Re: Lumen – A micro-framework by Laravel

#93

Earlier quoted context omitted.

I've done some projects with Silex and it's not bad but I've found myself losing quit a bit of time because you can never really use most components exactly like in the Symfony standard distribution but the docs mostly show you that way. Also you have to be careful with dependencies version or you're quickly in Composer hell (because Symfony moves forward so fast). Always wanted to compare it with Slim but didn't tak…

>you can never really use most components exactly like in the Symfony standard distribution I'm glad its not just me. The documentation gave me problems. I started wondering why I didn't just use symfony in the first place.

Hehe, I'm in fact switching my two ongoing side projects from Silex to Symfony.

It also helps me keeping current with the framework since it's currently all the rage in the (French) PHP job market.

Re: Lumen – A micro-framework by Laravel

#94

Earlier quoted context omitted.

Anyone still hating on PHP in 2015 is doing it wrong.

No. http://www.reddit.com/r/PHP/comments/2zhg6z/how_true_is_this... Read that and tell me that it is Ok..And see how that comment has been downvoted. That is PHP community for you. In 2015.

It is ok. That's how the language is designed so that arrays cover both hash-map use cases and traditional numerically indexed array use cases. The behavior is well documented and in this specific example, using a == instead of a === would cause the desired result. The poster of that comment should RTFM.

Re: Lumen – A micro-framework by Laravel

#95
post #88

Earlier quoted context omitted.

Correct. The runtime uses a copy-on-write implementation when you pass an array by value. Duplicating an array in memory every time it is passed to or from a function would be awful.

> Duplicating an array in memory every time it is passed to or from a function would be awful. This might be because I originally learned PHP about 16 years ago, but I could swear this used to be the case. There's definitely a reason PHP has the reputation it has, although many of those glaring issues have since been fixed.

I started with PHP3 and also didn't know or care about that for a long time. Then Doctrine with its hydrators and PHP daemons became a thing in the workplace and all of sudden you have to be a bit more careful with data size and memory management.

Re: Lumen – A micro-framework by Laravel

#97
post #91

I've just created a project with lumen to have a look at it and lumen and all its vendor packages (with --no-dev and without tests) contain 1522 files and 102449 lines of code – according to cloc. Am I doing something wrong or why does it call itself a "micro-framework". A newly created Slim project contains 7417 lines of code.

How many lines of code should a micro framework have?

Re: Lumen – A micro-framework by Laravel

#98
post #56

Earlier quoted context omitted.

The framework's author addressed this on reddit: http://www.reddit.com/r/PHP/comments/32kajb/lumen_php_microf...

Interesting. I guess he/she is implying that Lumen is PSR-7 compliant than by the last sentence? Thanks!

Lumen uses the same request and response objects as Laravel, which extend Symfony's request and response objects, on which PSR-7 is based. If Lumen isn't PSR-7 compliant once that standard is finalized, it will be shortly.

Re: Lumen – A micro-framework by Laravel

#99
post #64

As someone who develops/maintains many high-IO requirement PHP microservices (as part of a service-oriented architecture, or, SOA), I'm torn on this one. Laravel is one of my favorite frameworks, especially since 5.0 given its noble attempt to adhere to contract-first/interfaced development and many best practices that in some ways prevent the "worst" kinds of code from being written. It's not static typing, but it's…

> Lumen still requires resources to be bootstrapped on request, and ultimately that (in the context of a framework) will lead to memory leaks in a loosely-typed language; no way around that.

Can you expand upon that or provide a link with more info? Why would it lead to memory leaks?

Re: Lumen – A micro-framework by Laravel

#100

Earlier quoted context omitted.

I'd say writing off an entire language with a vague anecdote is worth at least a little scrutiny or clarification.

People have been doing that with PHP for years. Yes, it's true that there's a ton of really bad code out there. But that's a measure of it's popularity. There's also a ton of bad C and Java out there. And yet, no one dismisses those languages because of that.

As far as I can tell, anecdotes, social proof, and familiarity play far more a role in the reputations of almost every language/tool than most engineers seem prepared to admit.

(But don't worry, dear reader -- you're probably the exception!)

PHP gets singled out for a bit of extra abuse (some perhaps justifiably, some not so much), but it's far from the only language whose popular conception is not so much based on thoughtful evaluation.

Post reply on HN