News for hackers. Stuff that matters.
Re:Websites have evolved back to static HTML/CSS/JS files by jonny383 on Monday March 09, 2020 @01:26AM (#22523187)
There's nothing wrong with static HTML/CSS/JS. There's also nothing wrong with a rich SPA. And again, there's nothing wrong with using some kind of dynamic server-side HTML/CSS/JS presentation (like WordPress).

Where there is a problem is the culture of software engineering, and the tendency to select the newest technology stack of the day for inappropriate applications. I think any seasoned software engineer has acquired the skill of successfully selecting the correct architecture for the project goals (even if it is _boring_ to actually work on).

Whereas, take the junior to mid developer streams. Every time there's an opportunity to learn something new and break the grind from doing [X] for the past [Y] months, there tends to be unwarranted justifcation on why "we should use this new thing" despite there already being a well-known and battle-tested solution sitting right there.

For example: We need to build a basic company website. Someone from reception needs to be able to update the contact form and trading hours around five times per year. Someone from marketing needs to update product brochures once a month.

Seasoned engineer: Let's use any well-tested CMS such as WordPress and install a caching front-end.

Junior - mid engineers: EW WordPress! Doesn't that use PHP? Hahaha. Hahaha. Why on earth would we want to be known for using _PHP_!?!? We'd be _far_ better to just create a front-end on react and then write a microservice that will allow our staff members to update content. If marketing says SEO is necessary, we can _simply_ add a server-side rendering layer for the react front-end and deploy it onto a second microservice. And to make sure it all works, we can subscribe to some monitoring services, write a full test suite and CI pipeline. Everyone can install monitoring on their phones so if it ever goes offline, someone can immediately sign in remotely and debug which micro service is broken.

Re:Websites have evolved back to static HTML/CSS/JS files by pjc50 on Monday March 09, 2020 @07:12AM (#22524459)
We're back to "The boring solution has a long list of inconveniences and uglinesses that everyone knows about. If we chose the new solution, nobody would know where the bugs are and we can have exciting new ones."

Really the problem is that the standard solution hasn't improved. Backends are still a hassle in the 2020s. People keep reinventing CGI.

Every now and again I think "why doesn't someone just produce a simple standardised solution that would be cheap to host and easy to write", and have to lie down until the madness goes away.

Re:Websites have evolved back to static HTML/CSS/JS files by scoutt on Monday March 09, 2020 @09:18AM (#22525086)
> "The boring solution has a long list of inconveniences and uglinesses that everyone knows about. If we chose the new solution, nobody would know where the bugs are and we can have exciting new ones."

Is this C vs Rust again? (it's a joke, but go ahead, downvote).

Re:Websites have evolved back to static HTML/CSS/JS files by pjc50 on Monday March 09, 2020 @10:43AM (#22525750)
Oh, it's practically general purpose life advice. You could even apply it to some people's second marriages.
Re:Websites have evolved back to static HTML/CSS/JS files by jkoudys on Monday March 09, 2020 @10:01AM (#22525385)
Rust is great, but it's so young that even the ugliness we knew about from a couple months ago is better known than the ugliness of today. The latest stabilisation of async/.await has me hard at work forgetting all the pre-futures-0.3 stuff I'd learned.
Re:Websites have evolved back to static HTML/CSS/JS files by wilg on Tuesday March 10, 2020 @09:29PM (#22542029)
I have a hard rule to downvote whenever anyone asks to be downvoted or complains about being downvoted. Enjoy!
Re:Websites have evolved back to static HTML/CSS/JS files by etripe on Monday March 09, 2020 @07:46AM (#22524617)
Backends are still a hassle? In what way do you feel Spring (Boot), ASP.NET Core and the like don't solve the problem adequately?
Re:Websites have evolved back to static HTML/CSS/JS files by pjc50 on Monday March 09, 2020 @09:04AM (#22525007)
You still have to write one at all? And it's an entirely separate process from the frontend, and usually in an entirely different language? And many places hire different developers to do it?

Maintaining a static site is easy and places like github pages will host it for free; you can put a "SPA" in there if you like for no additional cost. But as soon as you need a backend it gets more complicated and expensive. Still cheap in absolute terms, but relatively more complicated. Oh and you need to keep an eye on it for security. I know the long list of reasons for this situation, but I'm questioning why it has to be this way.

Back in the 80s there were proprietary monolithic single-user systems for producing what were effectively interactive databases, such as dBase and FoxPro. There was also the legendary programmable hypertext system HyperCard. And yet developing a small web application to do something that could be knocked up with a few screens of dbase or hypercard is much more time-consuming.

Re:Websites have evolved back to static HTML/CSS/JS files by battery_cowboy on Monday March 09, 2020 @05:06PM (#22529803)
I use Dokku, which is like Heroku, but on my own server. To setup a backend, I just write the code with whatever I want (I use Elixir) and I use a local DB to test, using an env var to get the DB host. Then, I create an app on Dokku, a server, and deploy:

Dokku install:

    $> wget https://raw.githubusercontent.com/dokku/dokku/v0.19.13/bootstrap.sh;
    $> sudo DOKKU_TAG=v0.19.13 bash bootstrap.sh
Now, go to the server's IP or the domain you have setup previously and configure it with an SSH key and some other options.

Create an app:

On the server:

    $> dokku apps:create application_name
    $> dokku postgres:create application_db
    $> dokku postgres:link application_db application_name
Deploy the app:

On the client:

    $> git remote add dokku ssh://dokku.servername.tld:22/application_name
    $> git push dokku master
Once more on the server, to get TLS certs set up and auto-renewal (only the first time per application):

    $> dokku letsencrypt application_name
    $> dokku letsencrypt:cron-job --add
Then it just builds automagically, and as long as you use some sort of took to coordinate your database schema (for my use I use ecto migrations), then you don't need to do any more than this, really. You might have to do some limited configuration in your repo, but not much (add a .buildpacks file, then maybe a buildpack.config and a app.json).

For a static site, you literally push a repo with a `.static` file and an `index.html` in the root dir (you can do more complicated things, too).

It's not quite as powerful as k8s or whatever, but it can run small to medium sites easily, and it does have an Alpha-quality scheduler to push to k8s that I haven't tried yet, but should work as well as the Docker backend, eventually (and I'll switch to that when it's fully capable, too).

With DigitalOcean, I hear you can do 1-click Dokku servers if you don't want to do it yourself (I haven't tried this).

Re:Websites have evolved back to static HTML/CSS/JS files by path411 on Monday March 09, 2020 @05:05PM (#22529796)
Give someone an excel file and they are perfectly happy. Give them a web app to do the same process and suddenly their "needs" forces you to completely abstract all of the concepts to something entirely unrecognizable from the start.

It seems to me I see more and more a growing distance between how data is stored in a sql db and how the data is actually rendered or represented in the application.

Re:Websites have evolved back to static HTML/CSS/JS files by corebit on Monday March 09, 2020 @12:13PM (#22526566)
Oh gosh Spring Boot is such a dumpster fire. Dont even pretend its good!
Re:Websites have evolved back to static HTML/CSS/JS files by hnarn on Monday March 09, 2020 @02:25AM (#22523391)
For this typical use case, a statically rendered page with some kind of editing interface would work great, no need for databases.
Re:Websites have evolved back to static HTML/CSS/JS files by kugelblitz on Monday March 09, 2020 @02:52AM (#22523481)
Why is this downvoted? I'm a big fan of PHP, but I feel something like Netlify CMS + Jekyll on Netlify is appropriate for this. It would be super fast (statically generated and on Netlify CDN) and secure (no database or app scripts) and includes an editing interface.

With WordPress I don't worry about the PHP part, but for the tendency of people to bloat it by installing plugins and not updating it enough.

Re:Websites have evolved back to static HTML/CSS/JS files by sireat on Monday March 09, 2020 @03:13AM (#22523543)
How does something like Netlify CMS work for an end user?

I mean how do you skip the "storing some sort of state in DB including a users table" step?

It is very typical for a small to medium business site client to want a minimal CMS and ability to add a few more users with edit rights.

With Netlify CMS it seems the build happens from a git repo so wouldn't it require for end user to learn git?

I love how fast and easy it is to publish static sites on Netlify but I do not see how one could host client sites on Netlify without requiring constant hand holding.

Re:Websites have evolved back to static HTML/CSS/JS files by PaulWaldman on Monday March 09, 2020 @03:40AM (#22523661)
Netlify requires adding a few static assets to your site that handle authentication and CRUD actions. This then updates your git repo. The format of the posts are in Markdown, so it may not be the most user-friendly, but the end user would not have to learn git.

https://www.netlifycms.org/docs/add-to-your-site/

https://www.netlifycms.org/docs/add-to-your-site/

Re:Websites have evolved back to static HTML/CSS/JS files by crucialfelix on Monday March 09, 2020 @04:03AM (#22523760)
https://www.contentful.com/ works well for this.

Content, copy, even menu items, metadata etc can be edited by multiple normal people. Translations too

A static site can be set up to rebuild when someone updates content.

You could also fetch content with JavaScript on the page. That would work if it was just opening hours as in the parent example

Re:Websites have evolved back to static HTML/CSS/JS files by zeta0134 on Monday March 09, 2020 @03:54AM (#22523730)
Wordpress gets a hard pass for me specifically because (a) it has a plugin system that I've seen explode in practice far too often to trust, and (b) the task specifications provided by OP include marketing and management access to the editor. There is no stronger force behind pet features and rule breaking. I'd choose something easy to work with, but with an intentionally limited scope over anything with shiny bells and whistles in this specific case.
Re:Websites have evolved back to static HTML/CSS/JS files by jonny383 on Monday March 09, 2020 @03:17AM (#22523550)
Netlify and Jekyll are kind of more oriented towards develoeprs, not Janine in reception.

Regarding WordPress and plugins:

    <?php define("DISALLOW_FILE_MODS", true);
Re:Websites have evolved back to static HTML/CSS/JS files by KptMarchewa on Monday March 09, 2020 @09:40AM (#22525233)
I'd rather Janine ping me three times a year to change some string than deploy PHP with mysql.
Re:Websites have evolved back to static HTML/CSS/JS files by nojvek on Monday March 09, 2020 @10:37AM (#22525680)
Php with mysql is amazing. I don’t get the “i’d rather have Janine ping me three times an year”. What if you leave work? What if you are too busy with your next hobby project that you don’t give a shit about Janine? What if she wants to update brochures every now and then and your manager says you’re too expensive to help Janine.

Tech is about automation. Php + mysql still serves well in this era. Wikipedia still runs on it and it’s a pretty fantastic and responsive site. So does Facebook to some degree I suppose.

Re:Websites have evolved back to static HTML/CSS/JS files by KptMarchewa on Tuesday March 10, 2020 @01:14PM (#22537320)
>What if you leave work?

Next dev will have easier time changing string in plain, straightforward code or static site generator than migrating plugins from PHP 5.3 or whatever.

>Tech is about automation.

Tech isn't about "automating" things that ultimately cause you to do more work to maintain status quo. Tech isn't about spending week to automate things that take you 1 minute three times a year.

Re:Websites have evolved back to static HTML/CSS/JS files by dwild on Monday March 09, 2020 @11:37AM (#22526239)
>Seasoned engineer: Let's use any well-tested CMS such as WordPress and install a caching front-end.

I thought that was your junior response... you update it once a month, seems like WordPress is seriously overengineered for something managed internally. Static website + a 1h ticket once a month seems much better.

You'll save in performance, security, and it over a few years, it would take you less work time than doing a full WordPress.

If it's more than once a month, now it may be more interesting to go toward a WordPress, but that would be doubtful.

Re:Websites have evolved back to static HTML/CSS/JS files by p_l on Monday March 16, 2020 @08:52PM (#22600238)
then you find out that you need to run the site HA for reasons, and you learn just how much of a shitshow it is with WordPress.

Sincerely, someone with way too many Wordpress sites.

Re:Websites have evolved back to static HTML/CSS/JS files by msla on Monday March 09, 2020 @03:19AM (#22523558)
I'm not sure it's junior/senior so much as personal taste: Plenty of junior engineers use Vim and Emacs, neither of which are trendy in any meaningful way, and I'm sure there are senior engineers who use Visual Studio with all of its whiz-bang. Similarly with websites, some have ideas which need AJAX and, possibly, WASM, and others have ideas which need static sites or, at most, "slightly dynamic" websites with only a little JS mutating the DOM.

More specifically, it isn't always up to the engineers:

> We need to build a basic company website.

Marketing is inherently trendy and the people designing the website, as in dictating what it needs to do and look like, are the marketers, who are influenced by the "cool" websites they've seen. Marketers follow trends. It isn't really negotiable in that profession. The engineers do their best to deliver on what marketing wants, and if that requires a WASM re-implementation of NyanCat to prove that we're retro-hip and DownToFax, so be it.

Re:Websites have evolved back to static HTML/CSS/JS files by dirtnugget on Monday March 09, 2020 @11:25AM (#22526124)
> Plenty of junior engineers use Vim and Emacs

Pretty sure that’s not the case anymore, I have been a developer for 3 years and have never ever seen anyone use either of these for work

Re:Websites have evolved back to static HTML/CSS/JS files by Johan-bjareholt on Friday March 13, 2020 @08:41PM (#22572090)
Well, since you've only worked for 3 years I bet you haven't seen many different workplaces either. I've been a professional developer for 3 years and 80% of the people I know use either vim or emacs. The difference between you and me however is that I'm aware that I have been to very few workplaces and don't assume that most people use vim or emacs because of my limited experience.
Re:Websites have evolved back to static HTML/CSS/JS files by turtlecloud on Monday March 09, 2020 @03:56AM (#22523735)
The reason for choosing new technology on the developers part is for job security. If everything were still php you would have outsourced his job to India ages ago. The fact is that the developers need to do this because of the ding dongs mbas in management.
Re:Websites have evolved back to static HTML/CSS/JS files by volument on Monday March 09, 2020 @02:43AM (#22523447)
This feels like a response from a seasoned backend engineer. Seasoned frontend developers value user experience and design — thus the tendency to go "back to static" and rarely back to WordPress.
Re:Websites have evolved back to static HTML/CSS/JS files by jusssi on Monday March 09, 2020 @04:00AM (#22523753)
To me Wordpress sounds exactly a suggestion you'd get from someone who doesn't have to maintain it. I.e. frontend dev.
Re:Websites have evolved back to static HTML/CSS/JS files by kop316 on Monday March 09, 2020 @07:51AM (#22524635)
How so? I maintain two WordPress websites and really "maintaining" means I get an email telling me it automatically updated every so often. I spend more time on it restarting the server because it was updated to a newer kernel (it runs on Debian Stable, to give you an idea for how often that happens).

I do agree that if you need plug ins, that appears to get messy very fast, but the default WordPress site does everything I want and requires very little for maintenance.

Re:Websites have evolved back to static HTML/CSS/JS files by hombre_fatal on Monday March 09, 2020 @07:33AM (#22524558)
On the other hand, Wordpress is for the reality that most people don't have a developer on hand (nor should need one) to update their website.
Re:Websites have evolved back to static HTML/CSS/JS files by diegoperini on Monday March 09, 2020 @08:15AM (#22524742)
I believe the grand-grand-parent used Wordpress as an example to his/her argument. You can use any other battle tested CMS solution if Wordpress is too heavy for your needs.

For example, I like Ghost (https://ghost.org/) for my personal needs.

Re:Websites have evolved back to static HTML/CSS/JS files by 76543210 on Monday March 09, 2020 @08:56AM (#22524963)
Huh... Maybe I haven't done anything too complicated in WP, but I didn't find it bad.

Worst case I use a dedicated PHP page and MySQL. But in reality I think I usually put my code in functions.php(?) And it works fine.

Re:Websites have evolved back to static HTML/CSS/JS files by shirakawasuna on Monday March 09, 2020 @01:09PM (#22527122)
Have fun getting junior engineers interested in PHP, an objectively gross language. You'll get a stable system to begin with, but nobody younger than 45 who wants to touch it. It also has a large attack volume and curated security exploits that you buy into when you inevitably use plugins.

This article is about static HTML/CSS/JS. You can accomplish a good, modern CMS in halfway-decent languages using netlify and any static site generator framework you want without making your devs miserable.

Re:Websites have evolved back to static HTML/CSS/JS files by RileyJames on Monday March 09, 2020 @01:20PM (#22527265)
See, the beauty of the solution suggested is that no one has to write any PHP (You could probably avoid even seeing any, if that's your goal).

Wordpress does what is required out of the box.

In fact, you don't even require a developer to do it. It's a point and click operation of selecting a theme, installing a cache add-on, add an SEO add-on, and hell, there's probably a "office hours" plugin as well.

If the receptionist isn't a technophobe s/he can probably do it themselves.

If you want to assign resources, get a designer in to make it look pretty. Wordpress has everything else covered.

Re:Websites have evolved back to static HTML/CSS/JS files by ymolodtsov on Thursday March 12, 2020 @05:41PM (#22562102)
know a number of products from venture-backed startups written in PHP where most of the team is usually between 25-35.
Re:Websites have evolved back to static HTML/CSS/JS files by agumonkey on Monday March 09, 2020 @09:08AM (#22525032)
I get what you say but WordPress is a weak example. It's so fragile security wise (especially if some plugin holds you back on updates).
Re:Websites have evolved back to static HTML/CSS/JS files by lazyjones on Monday March 09, 2020 @01:57AM (#22523294)
Another problem is that Google and some other search engines have only just started interpreting JS and since they determine the fate of most projects based on their search index, you'd better use a design that Google is able to turn into indexed pages.
Re:Websites have evolved back to static HTML/CSS/JS files by ThePhysicist on Monday March 09, 2020 @03:15AM (#22523547)
Google was able to parse and execute JS for at least 6 years, I remember having a complex SPA in 2015 that didn’t pose any problem to Google.
Re:Websites have evolved back to static HTML/CSS/JS files by wyqydsyq on Monday March 09, 2020 @02:34AM (#22523424)
I can't see JavaScript SEO ever being a thing, especially when most people these days just add SSR to their stack and call it a day
Re:Websites have evolved back to static HTML/CSS/JS files by zelphirkalt on Monday March 09, 2020 @02:56AM (#22523494)
Except that usually someone from marketting or the reception still wont touch the website, because they think, that they can save time by delegating that back to the developers. Wordpress has some kind of terrible design decisions backed in and yes, there are many more elegant and long term effective ways (it's not about getting it online in 30mins) to build a company website.
Re:Websites have evolved back to static HTML/CSS/JS files by jonny383 on Monday March 09, 2020 @03:29AM (#22523608)
This is a cultural issue within a company that has nothing to do with a suitable technical solution.
Re:Websites have evolved back to static HTML/CSS/JS files by terpimost on Monday March 09, 2020 @06:56AM (#22524383)
So true about a website. The recent time I don’t even bother about hosting, I choose the most simple to manage and teach others. For a simple page there are services like https://tilda.cc . Gatsby suddenly improves Wordpress. And Kontent.ai is just a great editing experience with do_it_as_you_want frontend.
Re:Websites have evolved back to static HTML/CSS/JS files by thrownaway954 on Monday March 09, 2020 @09:15AM (#22525072)
the issue is that younger people want to do the use and learn the newest thing to advanced their careers, while us old timers just want to get shit done. you can't blame them, we we're all like that at one point, it's why we got into programming to begin with.

this is one reason why i fully believe companies should have a give each developer a half-day or day to work on new thing for the company so that new developer get to scratch that itch without trying to force using something new just for the sake of using something new.

Re:Websites have evolved back to static HTML/CSS/JS files by ProZsolt on Monday March 09, 2020 @04:51PM (#22529660)
My thought exactly.

Also, if companies stop requiring 4 years of experience in a technology that came out 3 years ago in their job description that would also help. Instead, let people transfer from similar technologies and let them learn it on the job.

Re:Websites have evolved back to static HTML/CSS/JS files by collyw on Monday March 09, 2020 @12:50PM (#22526901)
> I think any seasoned software engineer has acquired the skill of successfully selecting the correct architecture for the project goals (even if it is _boring_ to actually work on).

Some experienced developers get it, but I have argued with plenty who are busy keeping up with the hype cycle and resume driven development.

Re:Websites have evolved back to static HTML/CSS/JS files by drummer on Monday March 09, 2020 @05:25PM (#22529989)
Wordpress is awesome except for gutenberg. They shouldn't have gone down that route.
Re:Websites have evolved back to static HTML/CSS/JS files by vntok on Monday March 09, 2020 @05:37PM (#22530089)
Users love it though.
Re:Websites have evolved back to static HTML/CSS/JS files by lioeters on Monday March 09, 2020 @10:35PM (#22532257)
If by "users" you include developers who spend most of their time with the system, the two thousand 1-star reviews ¹ will beg to differ.

¹ https://wordpress.org/plugins/gutenberg/#reviews

Re:Websites have evolved back to static HTML/CSS/JS files by vntok on Tuesday March 10, 2020 @06:53PM (#22540767)
No, by "users" I meant... users. Those developers have basically nothing to do with using Gutenberg to write content, why do you think their opinion should prevail on that of actual users?
Re:Websites have evolved back to static HTML/CSS/JS files by drummer on Wednesday March 11, 2020 @02:00PM (#22548370)
It's also users not just developers if you read the reviews.
Re:Websites have evolved back to static HTML/CSS/JS files by mettamage on Sunday March 15, 2020 @09:19AM (#22583323)
Apologies to be so late to the discussion (I come from HN search as I'm searching for a good solution to build a simple website).

Why not use Wordpress --> static generator --> Netlify (aka free hosting)?

Re:Websites have evolved back to static HTML/CSS/JS files by 76543210 on Monday March 09, 2020 @08:53AM (#22524946)
>Junior - mid engineers: EW WordPress! Doesn't that use PHP

I related too hard.

I had an intern say something like this but didn't give a reason. So I asked "why?". He couldn't give me an answer.