Live data from Hacker News

Show HN: Dumbo – Hono inspired framework for PHP

github.com

21–30 of 70 posts

Re: Show HN: Dumbo – Hono inspired framework for PHP

#21
You're requiring PHP 8.3 but not using some of the most powerful tools in 7+: strict types.

``` /* @var array Variables stored in the context */ private $variables = []; ```

This should be typed as `array` (heck, I'd argue ArrayObject instead) and all your classes should have `declare(strict_types=1);` at the top.

Your `Dumbo\Helpers` classes are basically static mine traps that you are unable to mock in unit tests. Why does `BasicAuth` expose a single static method but then calls a bunch of other static methods? What ends up happening in any class that uses any of your `Dumbo\Helpers` classes will always run whatever code is defined in these helper classes.

I'm unsure where the bootstrapping process begins. What file does your webserver need to call to handle a new request? I am hoping it is within a root-level directory and not at the root level itself. In other words, `/public/index.php` vs `/index.php`. Your quickstart in README.MD makes it pretty clear that you expect the latter, which is highly unsafe. See any number of poorly configured webservers that stop processing PHP for any reason but now show your site's full contents to anyone passing by.

I would strongly argue against _any_ magic in your framework. Specifically, routes: they should be explicitly defined. I still work with a legacy Symfony 1 framework project and I can't tell you how much I detest magic routing. For a modern example see how Symfony 2+ requires explicit route definition. Heck, how it requires explicit everything because magic should be left to magicians.

Your framework seems like it can only handle `application/json` and `application/x-www-form-urlencoded` requests, but not `multipart/form-data`.

Take these as positive criticisms of your work. It's "fine". I wouldn't use it, I would actively recommend against using it, but I would actively recommend against using anything that's not Symfony (or Laravel if I were drunk). I do not think your project is at the "Show HN" level - it is still far too under-developed.

Re: Show HN: Dumbo – Hono inspired framework for PHP

#22
post #12

Earlier quoted context omitted.

If a certain arrangement makes it more likely to write bad queries, and it requires extra care to write optimal queries, then it’s a worse interface to a database. I bet for really database intensive applications graphQL adds more work than it saves.

It’s not though. Especially since GraphQL makes no mention of databases. It’s a resource agnostic protocol. This isn’t a technical issue with GraphQL. It’s a culture issue among developers who shoehorn GraphQL and don’t use it appropriately As someone who works on very database intense application GraphQL saves me more work than its ever caused.

Any chance you can point to a good graphql implementation/framework that someone could use to learn best practices?

Re: Show HN: Dumbo – Hono inspired framework for PHP

#24

I don't see myself ever using anything other than Laravel, but love these kinds of projects just to see what new ideas they might spark for the wider PHP community. Also interested in https://tempestphp.com/

I was about to start looking for a PHP micro framework. I wish Lumen was still supported.

Re: Show HN: Dumbo – Hono inspired framework for PHP

#25

You're requiring PHP 8.3 but not using some of the most powerful tools in 7+: strict types. ``` /* @var array Variables stored in the context */ private $variables = []; ``` This should be typed as `array` (heck, I'd argue ArrayObject instead) and all your classes should have `declare(strict_types=1);` at the top. Your `Dumbo\Helpers` classes are basically static mine traps that you are unable to mock in unit tests.…

Appreciate the feedback, I'll work on it. I have lots to learn it seems!

Re: Show HN: Dumbo – Hono inspired framework for PHP

#26
post #24

I don't see myself ever using anything other than Laravel, but love these kinds of projects just to see what new ideas they might spark for the wider PHP community. Also interested in https://tempestphp.com/

I was about to start looking for a PHP micro framework. I wish Lumen was still supported.

Is FuelPHP or CodeIgniter still going? Those were my two favourites back in the day before Laravel came on the scene.

Re: Show HN: Dumbo – Hono inspired framework for PHP

#27

You're requiring PHP 8.3 but not using some of the most powerful tools in 7+: strict types. ``` /* @var array Variables stored in the context */ private $variables = []; ``` This should be typed as `array` (heck, I'd argue ArrayObject instead) and all your classes should have `declare(strict_types=1);` at the top. Your `Dumbo\Helpers` classes are basically static mine traps that you are unable to mock in unit tests.…

Out of curiosity, what do you dislike so much about Laravel?

Re: Show HN: Dumbo – Hono inspired framework for PHP

#29

You're requiring PHP 8.3 but not using some of the most powerful tools in 7+: strict types. ``` /* @var array Variables stored in the context */ private $variables = []; ``` This should be typed as `array` (heck, I'd argue ArrayObject instead) and all your classes should have `declare(strict_types=1);` at the top. Your `Dumbo\Helpers` classes are basically static mine traps that you are unable to mock in unit tests.…

Out of curiosity, what do you dislike so much about Laravel?

1) *magic* 2) Its ORM of choice uses ActiveRecord pattern which I find to be hideous. DataMapper is far superior 3) Its weird facade patterns is terrible

I can (and have!) gone in-depth into my misgivings with Laravel, but it is fine for most projects and teams. It has elevated the average codebase quality throughout the PHP community and introduced many engineers to what PHP can do. Its creator and community have been a large net-positive to PHP as a whole.

I still prefer Symfony:

1) explicit 2) DataMapper ORM by default 3) What I am used to

Re: Show HN: Dumbo – Hono inspired framework for PHP

#30

[flagged]

There is concurrency..

There is Unicode support

There is a proposal for generics https://wiki.php.net/rfc/generics

For me personally its not a deal-breaker, there are workarounds if needed.

but for your question, why not?

It's so frustrating to see people just suggesting the "Mainstream" without considering if OP even asked.

Edit : Unicode support is not native. So concede this one, but again not a deal breaker as a language IMO.

Post reply on HN