News for hackers. Stuff that matters.
Re:Show HN: IHP, a batteries-included web framework built on... by fimdomeio on Tuesday June 23, 2020 @03:36AM (#23610911)
I think enough time has passed that we're collectively forgetting the good reasons why so many moved from server side rendering, which I would say it was mostly the difficulty in make complex uis. Then it became a trend, now going old school seems appealing.

Anyway in my particular case if I had any project that was a good fit for server side rendering I would probably now go with php and some libraries but probably no framework. I've been looking at some "weirdly coded 90's style php projects". An while the code is a terrible mess there's also the magic that I can read everything that's happening pretty quickly because it's just there or in a file next to it and not hidden in a library and a sub-library with calls to functions that I never seen before.

Re:Show HN: IHP, a batteries-included web framework built on... by mhoad on Tuesday June 23, 2020 @04:05AM (#23611106)
I think the problem here is that you are setting up a situation where it is some binary choice between the insane complexity of SPAs and everything that entails and some random 90s style hand rolled PHP file.

There are a whole bunch of options between those two extremes and I can’t for the life of me think why people don’t talk about them more often.

For example, I think the new Hey.com implementation hasn’t received anywhere near the level of recognition that it probably should have.

It’s an entire email application with a single set of screens that power all web, desktop and mobile apps, does so with all the speed of an SPA, has no need for advanced state management, has the ability to push live updates on a per component basis on any screen and does it all in under 40kb of JavaScript.

Seriously go and look at the source code. I’ve only seen a tiny number of people talking about it like in this post https://dev.to/borama/a-few-sneak-peeks-into-hey-com-technol...

But to me the past few years of SPAs are starting to look more and more like a mistake to me where they became the rule when they should have probably been the exception.

Re:Show HN: IHP, a batteries-included web framework built on... by fastball on Tuesday June 23, 2020 @08:05AM (#23612767)
Unfortunately it is hard for me to comment on the hey.com web app as they currently have restrictive registration.

The benefit of building with a de-coupled JS frontend (SPA) and an API is that it can extended and adapted far easier than using server-delivered HTML.

If you have an API that delivers JSON/Protobuf/whatever, you can easily make new interfaces to that backend. If you are currently delivering a web app in HTML/JS, but decide you want a native Mac/iOS app written in Swift, you'll just end up building an API anyway.

Sure, there are plenty of websites that wont ever need additional interfaces, but if your goal is to make an app that can easily have new interfaces added to the mix, de-coupling is the way to start in my opinion.

Re:Show HN: IHP, a batteries-included web framework built on... by juhatl on Tuesday June 23, 2020 @09:02AM (#23613302)
You make a good point, and this is one of the reasons why I really like the Phoenix web framework (of the Elixir ecosystem). It firmly guides you towards building applications where Phoenix is only a single interface to your underlying Elixir application, and the web layer, by design, doesn't contain business logic, but rather just gives you a web-friendly way to talk to the application itself. The community has come up with the mantra of "Phoenix is not your application" to drive this point home.

This approach and separation of concerns also means that building e.g. REST or GraphQL APIs on top of your application is simple, as your web framework has no say in how the data is actually structured or queried.

Re:Show HN: IHP, a batteries-included web framework built on... by mhoad on Tuesday June 23, 2020 @03:32PM (#23619084)
I hear what you’re saying. I think the main thing I would push back on is the order in which you make those decisions however. Why take on all the additional cognitive overload from the start of the project because you might want a native screen at some point in the future? It’s basically another version of the micro services debate.

I think there is a heavy if unconscious bias among web developers now that the “one true way” to build web apps is to take the same methodologies and frameworks from Facebook and Google usually.

I’m obviously not the first person to point this out but trying to replicate the software development processes of some of the largest companies in the world is in no way correlated with a better anything (user experience, dev experience, code, time to market etc).

In fact I would take it further and say that there are a not insignificant number of new developers especially from the dev boot camp style pipelines who literally don’t even know how to build anything without reaching for one of these tools. We saw the same thing with people reaching for Bootstrap or now Tailwind for a long time and not knowing how to do anything outside of it. This isn’t to give them a hard time, I have been that kind of Stack overflow driven developer myself for a long time. I just think that maybe as an industry we have made some poor choices that have become gospel overtime and it might be worth revisiting that.

Re:Show HN: IHP, a batteries-included web framework built on... by jedieaston on Tuesday June 23, 2020 @10:14AM (#23614144)
To show off their frontend stuff, they left all of the JS available on https://app.hey.com without logging in. I think they plan on open-sourcing their improvements into new updates to Rails and turbolinks, eventually. If you've used Basecamp before it's fairly similar in speed, as far as I can tell (turbolinks + stimulus is responsible for that).
Re:Show HN: IHP, a batteries-included web framework built on... by DougBTX on Tuesday June 23, 2020 @04:33AM (#23611300)
Here's the library they've written: https://github.com/turbolinks/turbolinks
Re:Show HN: IHP, a batteries-included web framework built on... by mhoad on Tuesday June 23, 2020 @04:44AM (#23611358)
For the record it is worth mentioning that there is a major update pending for that library that handles some of the specific things outlined in the post I referenced above, however, even in its current iteration I think it is a much more sensible default to reach for than say React & Redux would be for a large number of applications.

There is a second library that they have used along side that for handling all of the app specific JavaScript here as well https://stimulusjs.org/

Re:Show HN: IHP, a batteries-included web framework built on... by tantaman on Tuesday June 23, 2020 @05:21PM (#23620464)
Tech is a circle that goes round and round.

Remember when everyone thought NoSQL was a good idea and wanted to get rid of their relational DBs? Nobody remembered _why_ we went to relational DBs until after all of their data was duplicated and inconsistent in NoSQL solutions.

I think the root of this is a lack of appreciation for or lack of knowledge of the history of software engineering.

Re:Show HN: IHP, a batteries-included web framework built on... by cies on Tuesday June 23, 2020 @04:00AM (#23611082)
> I would probably now go with php

seriously? 2020 and you'd pick php for a greenfield project?

and you mention this here, where we're discussing a project that provides: strong typing, typed safe queries, type safe templates, and more.

interesting.

Re:Show HN: IHP, a batteries-included web framework built on... by purerandomness on Tuesday June 23, 2020 @05:42AM (#23611729)
Today's PHP projects (at least the ones for which I've done consulting) are modern and clean code bases that use strict/strong typing, run static analysers and have stellar package management thanks to composer.

PHP 8 is due to be released this fall which improves the situation even more.

Symfone is the web framework that had the highest count of contributions over all frameworks in all languages.

The PHP community took a 180 degree turn from the 90's style flat files with a mix of HTML, SQL and code in the last decade. That times are gone (of course that kind of code is still laying around)

For someone who already knows PHP, starting a project in 2020/2021 in PHP is an excellent choice.

Re:Show HN: IHP, a batteries-included web framework built on... by cies on Tuesday June 23, 2020 @05:50AM (#23611802)
Which other languages are you fluent with? I find many that love PHP have a bit of a "when all you've got is a hammer" bias in favor of it.

I had the same! Then I invested in learning some Haskell/ Elm/ Reason/ Rust/ Kotlin: it changed my preferences for ever. I now look for proper sum types and (pattern) matchers, strong typing discipline and null safety.

Re:Show HN: IHP, a batteries-included web framework built on... by weego on Tuesday June 23, 2020 @06:40AM (#23612152)
I use Scala, Typescript, R, some Go and some Swift daily and have been using typed languages for 20 years+ and would still recommend PHP to someone wanting to throw together a brochureware site for the best cost/hassle ratio.

Almost no one is solving FANG problems, and people literally throw their clients/businesses money away on poor value because they've lost focus on what's important: delivering a solution for what they need right now, not what you want to spend your time playing with.

Also what is the big deal with type safe templates when you're literally just abstracting building HTML strings?

Re:Show HN: IHP, a batteries-included web framework built on... by purerandomness on Tuesday June 23, 2020 @05:54AM (#23611819)
I totally agree with what you're saying.

While PHP is still a joke compared to even Java which it very hard tries to become (which I think is a good thing), for someone who only knew PHP the entire time, the situation still got much, much better over the last decade...

Re:Show HN: IHP, a batteries-included web framework built on... by hazz99 on Tuesday June 23, 2020 @09:30AM (#23613645)
I am someone using React, NextJS and Typescript who really wishes they went with Symfony. It'd be so much simpler.

I've heard you can combine React with Symfony, which sounds really cool.

Re:Show HN: IHP, a batteries-included web framework built on... by cies on Tuesday June 23, 2020 @04:39PM (#23619918)
You may want to try some more functional languages to complement your experience: Reason/OCaml/F#/Haskel/Elm/PureScript or even the more OO ones that copy some features over: Rust or Kotlin.

React is not a language. TypeScript is very close to PHP, both in imperativeness, in OO-ness, in did-not-initially-support-it-but-sometimes-added-it-later-but-now-its-a-mess-ness, in BW-compatible-ness, in quirkiness.

Re:Show HN: IHP, a batteries-included web framework built on... by hazz99 on Tuesday June 23, 2020 @11:51PM (#23623874)
I’ve (informally) taught Haskell and I’ve used Elm/Erlang/Elixir/etc. I absolutely love functional programming and definitely regard it as the “ideal future”, but it’s not ready today. Especially the ecosystem.

I know React is not a language, but I listed the whole stack to compare it to IHP, which seems to try to combine everything. Which is good! I’d love a Django/RoR esque Haskell platform.

Re:Show HN: IHP, a batteries-included web framework built on... by radisb on Tuesday June 23, 2020 @04:37AM (#23611316)
I love when people are shocked because someone decides which tech to use based on the merits of the tech instead of what the current year tech fashion dictates. It's hilarious.
Re:Show HN: IHP, a batteries-included web framework built on... by tluyben2 on Tuesday June 23, 2020 @05:02AM (#23611489)
Or, you know, simple things like being able to easily attract people. No matter how I prefer Purescript/Haskell/Ocaml/F#/k or even Idris (not practical but I like writing things in it); if I need people fast, PHP/C#/TypeScript are just a better bet (I am surprised how easy it is to find good people with these skills now; seems unemployment hit these as well?).

But it depends on what you are doing ofcourse.

Re:Show HN: IHP, a batteries-included web framework built on... by cies on Tuesday June 23, 2020 @05:46AM (#23611762)
> if I need people fast

Exactly, this is a real reason for not using the technologically superior.

Re:Show HN: IHP, a batteries-included web framework built on... by tluyben2 on Tuesday June 23, 2020 @09:37AM (#23613723)
For many years we went for the tech that made us implement software faster than others. We picked productive languages (clojure/lisp) or languages to express more with less and with less bugs, we wrote frameworks, DSLs and even a few language etc; it worked indeed and we were faster. However, longer term (5+ years) it would be impossible to find people to update/support the code. The win at the start (sometimes a win that would have us win large fortune 1000 projects over the competition) would suffer in the long term from no-one (outside myself and maybe 1 other person) understanding how it works (other people left/went on to other things etc).

So now we just mostly deliver things in old, boring but very standard tech. Using almost written by us and definitely no custom low level stuff like we used to. Because we did all that work before, we know how to optimise for performance everywhere, how to optimise dbs, how to optimise frameworks and webservers. We do everything according to the standards and best practices; now we know that we can get people in 20 years to work on our code. But it is much much slower at the start; so much setup and plumbing. Very boring and tedious. I guess that's the point.

Re:Show HN: IHP, a batteries-included web framework built on... by cies on Tuesday June 23, 2020 @04:41PM (#23619949)
Now to what extend is Haskell already boring and old? :)
Re:Show HN: IHP, a batteries-included web framework built on... by tluyben2 on Tuesday June 23, 2020 @05:22PM (#23620477)
It'd old, but it's not boring!
Re:Show HN: IHP, a batteries-included web framework built on... by megiddo on Tuesday June 23, 2020 @09:05AM (#23613339)
It's a fantastic reason. Writing code is a job. A well-run business is dictated by factors that will usually dominate language design.

If these other languages were better in a holistic sense, businesses would switch.

I would argue against the "technically superior" position on three merits:

1. Finance, 2. Median productivity 3. Long-term product stability

Network effects mean that familiar languages will dominate. PHP, C#, and Javascript are familiar.

PHP has had staying power because it is extremely well-documented (with examples) for the novice, prioritizes backwards compatibility, and is reasonably if not very productive for most developers. The documentation section of PHP.net is probably the most important language "feature" of PHP - it trumps almost any language design feature you think is important.

It reads easily. It's easy to implement. It interacts natively with JSON in a completely fluid way. The database handling routines are rock solid and fast. The core language team spends a lot time improving the safety and performance of existing code. There's a good debug story.

It's its own templating language - no need to bolt on a hand-rolled templating mechanism. Just PHP all the way down. It prioritizes language features (reflection) that make writing libraries and frameworks easier. It promotes building reusable tools. Important features are pulled directly into the runtime, based on popularity in the ecosystem. The kitchen sink is included and it's portable.

Basically, it's a language that has been developed by people who actually have to build and maintain projects over a long period of time. A useful language is more than it's design.

Re:Show HN: IHP, a batteries-included web framework built on... by cies on Tuesday June 23, 2020 @04:46PM (#23620022)
So why do I see it going down the hole that Perl and ColdFusion are already occupying?

I see the other side: it's a sinking ship. FB comes to rescue PHP, but internally seems to like anything but PHP for greenfield projects: Java, C++, Erlang (chat msg broker), OCaml/Reason (messenger.com app), even Haskell is used for some spam filtering tool.

Re:Show HN: IHP, a batteries-included web framework built on... by cies on Tuesday June 23, 2020 @05:43AM (#23611739)
> the merits of the tech

In relation to PHP, really? Sure it has come a long way recently, but there's too much still in there that can never be fixed.

I dont think what IHP delivers is some sort of "fashion": they choose to be server-side only, pretty old school. The typing discipline is not very fashionable either: old, time tested, established, but not often leveraged for the development of simple websites/webapps.