News for hackers. Stuff that matters.
Re:Ask HN: If you are starting in 2024, what is the most pro... by demian32 on Saturday June 08, 2024 @05:37AM (#40616413)
For static pages, regular HTML and CSS will be sufficient. For dynamic ones, I would choose Laravel (a PHP framework). I'll give a rather unpopular opinion, but in the beginning, you don't need to become a master in PHP and know every function. The Laravel documentation will guide you step by step when you want to add authentication or create a simple feature for adding dynamic content. There are also plenty of community tutorials. If simplicity is important to you, I would advise against going the fullstack JS route. The Node.js environment or more specifically a framework like Next.js is very convoluted. You'll have to combine packages and functionalities yourself, and constantly changing versions will significantly complicate it.
Re:Ask HN: If you are starting in 2024, what is the most pro... by PurpleRamen on Saturday June 08, 2024 @06:46AM (#40616707)
> For static pages, regular HTML and CSS will be sufficient.

Not if we are talking about productivity, as asked here. HTML is rather simple to learn, but can be annoying enough to write. And let's not start talking about CSS is for a beginner...

Using some flavor of markdown and convert it to html would be far more productive. There is enough software around for enabling people a fast start, and you have the option to still enhance it with html&css (probably javascript too?).

Re:Ask HN: If you are starting in 2024, what is the most pro... by muzani on Saturday June 08, 2024 @07:33AM (#40616901)
I tried Hugo and Jekyll and such, but it felt out of flow, and I felt going through docs and setting up builds was more effort than just writing it in HTML. The true benefit of HTML IMO is being able to just save something in a plaintext editor and then open it right away.

These days you can probably just write whatever format you like and Claude or ChatGPT will convert it to HTML.

Re:Ask HN: If you are starting in 2024, what is the most pro... by shpx on Saturday June 08, 2024 @12:31PM (#40618664)
I spent hours researching the right Markdown to HTML renderer. Writing HTML by hand would've been faster. There's dozens of these frameworks and none are perfect.
Re:Ask HN: If you are starting in 2024, what is the most pro... by hiatus on Saturday June 08, 2024 @12:43PM (#40618765)
Or use something like strapdown and let the client handle rendering.

https://naereen.github.io/StrapDown.js/

Re:Ask HN: If you are starting in 2024, what is the most pro... by alright2565 on Saturday June 08, 2024 @04:09PM (#40619920)
The strapdown website works surprisingly well with Javascript disabled & is less than 50KiB excluding images. It does take (just barely) perceptibly longer to load than a traditional site.

But I've generally seen sites using this strategy to be a lot more bloated and slow, so please be considerate of that if you can.

Re:Ask HN: If you are starting in 2024, what is the most pro... by shpx on Saturday June 08, 2024 @04:35PM (#40620036)
When I clicked that link I saw a flash of unstyled content, so that's immediately worse than HTML.

My point was that if you count the time spent looking for the perfect renderer, HTML is faster and easier to write than Markdown unless you're writing a book. You just added another option someone has to spend time evaluating to the pile.

Re:Ask HN: If you are starting in 2024, what is the most pro... by hiatus on Saturday June 08, 2024 @04:59PM (#40620139)
There is no need to look for the "perfect" renderer. That reminds me of the authors that won't write unless they have the best notebook, pen, etc. Just write your content and throw strapdown on it. Who really cares if there's a flash of unstyled content?
Re:Ask HN: If you are starting in 2024, what is the most pro... by borisjoffe on Sunday June 16, 2024 @04:48PM (#40699971)
Also consider Pug (formerly called Jade). It's a bit more verbose than Markdown, but it's really nice because you can skip closing tags (it's indent-based like Python), can use CSS selector syntax (same as Emmet e.g. `div#someId.someClass`), and you can paste in regular HTML and have that work as well.

There's also file includes, template syntax like loops/if-statements, inherited templates, inline Javascript syntax, "filters" for including Markdown and other languages, and much more

Re:Ask HN: If you are starting in 2024, what is the most pro... by altdataseller on Saturday June 08, 2024 @05:44AM (#40616434)
What if you need javascript? What would you recommend in addition ti to laravel? Or is Laravel enough?
Re:Ask HN: If you are starting in 2024, what is the most pro... by kugelblitz on Saturday June 08, 2024 @10:16AM (#40617701)
I would argue adding JavaScript on top of Laravel will make you slower. You can use Blade as the templating engine (or how JS people would call "Server Side Rendering" but which has been default for most full stack frameworks). Otherwise you need to create 2 additional interfaces, one for backend and one for frontend. And an additional layer of error handling.

I personally prefer Symfony over Laravel because of it's modularity and extensibility, but Laravel has the edge on getting started quickly and available SaaS features (such as billing modules and stuff).

If you need SPA-ish features, you could use htmx and if you need some on-site interactivity, I like Alpine.js.

Re:Ask HN: If you are starting in 2024, what is the most pro... by pyronite on Saturday June 08, 2024 @11:56AM (#40618389)
Alpine + Livewire is the go-to stack for SPA-like Laravel functionality these days. If you "need" JavaScript for form purposes, Filament is well worth taking a look at as well.
Re:Ask HN: If you are starting in 2024, what is the most pro... by 0xblinq on Saturday June 08, 2024 @12:04PM (#40618446)
Checkout Inertiajs , it’s and adapter for Laravel to integrate it with react or vue