News for hackers. Stuff that matters.
Re:A Modern Web App in C by Scubabear68 on Monday October 12, 2026 @01:00PM (#50059322)
From the article, "WRITING HTML AND CSS IN C ISN'T TOO BAD".

Um, any and all string handling in C is pretty miserable.

Re:A Modern Web App in C by prophittcorey on Monday October 12, 2026 @01:03PM (#50059359)
To be fair, the HTML and CSS in C wasn't too bad.. the Youtube scraper was also written in C and that was a lot more painful :)
Re:A Modern Web App in C by sam1r on Monday October 12, 2026 @01:33PM (#50059829)
I can empathize entirely. After writing a scraper for html in C, outputting html in C is a piece of cake.
Re:A Modern Web App in C by PhilipRoman on Monday October 12, 2026 @01:18PM (#50059594)
Emitting strings is fine, it's the parsing that sucks.
Re:A Modern Web App in C by uecker on Tuesday October 13, 2026 @01:33AM (#50067180)
Of course, you could spend half an hour to write a string abstraction first before writing the parser, and which case this is not a problem anymore.
Re:A Modern Web App in C by Joker_vD on Monday October 12, 2026 @01:04PM (#50059385)
If you do it with the string functions from the standard library then yes, it is.
Re:A Modern Web App in C by prophittcorey on Monday October 12, 2026 @01:15PM (#50059540)
The standard string functionality is painful. I wrote my own string view and string builder that work with fixed size strings. No memory allocations, etc.
Re:A Modern Web App in C by feelamee on Monday October 12, 2026 @06:11PM (#50063788)
tell me where working with strings is not miserable? Practically, modern languages with RAII make it easy at the cost of perfomance (doing a lot of allocations). So, if you doing lot of string handling, you still need to think how to do it in performant way. If doing it a bit - why care about miserable.
Re:A Modern Web App in C by jiggawatts on Tuesday October 13, 2026 @12:23AM (#50066698)
You can "have your cake and eat it too" in Rust, C#, and I suppose C++ if you're a masochist.

These modern languages have both easy-to-use "owning" string types and a "string slice" type that can be passed around efficiently. Unlike C, in these languages a string and a slice are largely interchangeable, which makes them easier to use throughout not just your own codebase, but third-party libraries too.

For example, the Rust `httparse` crate `Request` type returns parsed fields as string slices, not strings, which means it doesn't allocate anything on the heap: https://docs.rs/httparse/latest/httparse/struct.Request.html