6 ms·
I totally expected it to be a troll site. It's actually sensible advice. But, really, I suggest using other tools. We have nicer tools now.
by rbanffy 5y ago
I totally expected it to be a troll site. It's actually sensible advice.
But, really, I suggest using other tools. We have nicer tools now.
- fraktl 5y ago
- bayesian_horse 5y agoI guess sometimes you are forced to use tools you'd rather not.
- unfocussed_mike 5y agoI don't know that many nicer tools than Laravel, to be fair. Especially Laravel + Lighthouse, which is an extraordinarily neat GraphQL layer considering the huge deployability you get with PHP. PHP is progressing towards a nicer language in a way that JavaScript, IMO, is not. And taking tens of millions of programmers with it.
- BafS 5y agoYou should also have a look to api-platform (https://api-platform.com/ https://api-platform.com/), it's based on Symfony and you can create Rest or GraphQL APIs with ease.
- unfocussed_mike 5y agoThat does look interesting. I'm currently using Nuxt/Vue (static) on the front end, with Apollo (this latter bit I will probably swap out). What is nice about Lighthouse is that it is schema-first. I am far less fond of the "auto schema" approach that e.g. WP-GraphQL uses. (Though WP-GraphQL is not bad; I'm also using that in a project).
- conradfr 5y agoOr don't, if you have a business data model that is more complex than a hello world.
- tored 5y agoWhat tools? What server language today except PHP (and its forks) is actually designed for the web and works as the web was intended?
- rbanffy 5y ago> What server language today except PHP (and its forks) is actually designed for the web and works as the web was intended? I'd say Rails is a very nice DSL for building web applications that's written as an extension of Ruby. We have two dimensions here, one for how easily a language allows you to build a website, and how expressive, consistent and error-proof a language is. It's easy to build a simple website with PHP (as it was with ASP and JSP, or even Cold Fusion). I actually like that approach, that maps running scripts to state transitions. But I also like the consistency and expressiveness of Python, Java, Scala, or C# (which I have used). As languages, they are "nicer" (and that's completely subjective) than PHP, and that niceness more than compensates for being unable to write code inside templates.
- 369548684892826 5y agoRazor lets you write C# inside templates.
- sgjohnson 5y agoNobody in their right mind has put actual logic inside templates when doing PHP for a while now. PHP has supported strict typing for a while now, making it also fairly consistend and error-proof. There is nothing at all wrong with PHP and it's rapidly moving in the right direction.
- onion2k 5y agoWhat server language today except PHP (and its forks) is actually designed for the web and works as the web was intended? The implication of the question is that there's something designed into PHP that makes it better for working with web things. Why does the language need to be designed to work with the web? That part of any language can be filled out with a framework quite easily, and arguably that means it's much easier to change how the language is used. That seems to be the case with every major PHP application anyway - most use Laravel or Cake or Symphony or something. Just as most Ruby web projects use Rails, and most backend JS projects use Express, and Rust web projects use Poem, and so on. I don't think there's a good reason to design a language specifically for web projects. If that's how PHP works these days (I haven't used PHP in a decade or so), I'd suggest that might be a bad thing. It's very rigid, and if the language gets anything wrong that compromises the design of every project that uses it. Languages should provide simple primitives that frameworks and libraries build on.
- that_guy_iain 5y ago> But, really, I suggest using other tools. We have nicer tools now. Debatable really. Within the web development space the options are rather limited in my opinion. Options: * Spring based apps - Downside JVM is a Resource hog * Python, Ruby, etc - The web frameworks are in my opinion not as full featured. Same with CMS systems. Also requires more resources. Also have limited OO features. * Go, Rust, etc - Really good choices for APIs but their web frameworks are also really lacking. The tooling around PHP is really good and stable. The language itself, the downsides are very limited and the main one that remains valid is inconsistency of function parameters. The issues with bad code are generally the same ones that can be done in another langauge.
- mschuster91 5y ago> The language itself, the downsides are very limited and the main one that remains valid is inconsistency of function parameters. Usually one would have an IDE's auto completion to take care about function parameters, and in any case PHP8 has named parameters now to reduce whatever confusion (especially when optional parameters come into play) remains.
- xigoi 5y agoSure, auto-completion makes the code easier to write. But you can't make it easier to read.
- that_guy_iain 5y agoJetbrains shows you the name of the parameter while reading so that part is reasonably easy
- StreamBright 5y agoWe use Asp.NET and it is a giant surprise how good it is. We are unix ppl, Linux & MacOS so not a MS shop at all. We deploy to on-prem and AWS so no Azure.
- 5y ago
- chinathrow 5y ago> But, really, I suggest using other tools. We have nicer tools now. Citation needed. For folks not wishing to switch frameworks and tooling every year, you can get a lot done with PHP.
- rbanffy 5y ago> Citation needed. I really like Django as an opinionated framework. I have also used Flask, Falcon, and FastAPI, all with good results in their own niche. I also like Play and Scala and Spring Boot with Java. > For folks not wishing to switch frameworks and tooling every year, you can get a lot done with PHP. You can also get a lot done with wood and nails, but that doesn't mean it's the best tool for all kind of jobs.
- capableweb 5y agoComparing PHP to using wood and nails feels misguided. PHP is a web framework, which makes it easy to handle writing web applications. It's more like using Python for web stuff is wood and nails, while using PHP is using wood and a nailgun when you need to stitch planks together (or something like that). PHP is made for the web, and you can tell by the specialization of the API interface it offers, which ships with most things you need for doing web stuff, while most languages does not. Getting the body from a POST request is trivial in PHP, while in most language you'll use a library for that, or write a bunch of code.
- rbanffy 5y agoThe nail-gun is a surprisingly good analogy. There are lots of other things you can do with a hammer, from hammering nails, to shaping metals, to removing nails, to getting things unstuck. With a nail-gun you are kind of limited on what you can do.
- lpcvoid 5y agoI, for one, would chose PHP8 over Javascript all day, every day. And there seem to be millions like me.
- rbanffy 5y agoWell... I wouldn't recommend JavaScript. TypeScript is much nicer and removes a lot of the JS pitfalls.
- sdevonoes 5y agoAnd pulling ~67 dev dependencies just to be able to transpile TS to JS? No thanks. https://www.npmjs.com/package/typescript https://www.npmjs.com/package/typescript
- Loeffelmann 5y agoDo these dependencies actually matter when you deploy or are they just used for the actual compiling?
- El_RIDO 5y agoIf they are required for the compile and someone manages to get something malicious into them, they can certainly affect the produced/deployed artifact. See Ken Thompson, Reflections on Trusting Trust, 1984 https://www.cs.cmu.edu/~rdriley/487/papers/Thompson_1984_ReflectionsonTrustingTrust.pdf https://www.cs.cmu.edu/~rdriley/487/papers/Thompson_1984_Ref...
- 0x142857 5y agoThis comment shows perfectly that people has no clue what they're talking about, these dev dependencies will never be pulled into your project, they're just for typescript's own development.
- Ginden 5y ago> these dev dependencies will never be pulled into your project, Please, don't ruin "JS bad" thread with facts. It's rude.
- wraptile 5y agoAs someone who had to learn a bit of PHP recently, I really don't see why would anyone pick it up these days other than vendor/business lock in. Laravel is great but there are hundreds of equally as great frameworks on dozens of more moderns and better though out languages: go, python, nim, ruby etc. A bunch of useful functions expanded into the default namespace is no longer that special.
- ihateolives 5y ago> there are hundreds of equally as great frameworks on dozens of more moderns and better though out languages: go, python, nim, ruby etc Have you actually tried using for Nim for building a scalable web service or even just complex websites with auth of your choice? Nim does not even come close to what PHP has to offer in terms of solutions for every need you may have.