Earlier quoted context omitted.
Ampersands are ASCII, but also need to be encoded to be in a parameter value.
Yeah, but you can totally choose to not allow that in your software.
30 years of tags
41–50 of 103 posts
Re: 30 years of <br> tags
#42> For that, you needed CGI scripts, which meant learning Perl or C. I tried learning C to write CGI scripts. It was too hard. Hundreds of lines just to grab a query parameter from a URL. The barrier to dynamic content was brutal. That's folk wisdom, but is it actually true? "Hundreds of lines just to grab a query parameter from a URL." /*@null@*/ /*@only@*/ char * get_param (const char * param) { const char * query =…
Good showcase. Your code will match the first parameter that has as a suffix, no necessarily exactly (username=blag&name=blub will return blag). It also doesn't handle any percent encoding.
Re: 30 years of <br> tags
#43> At one company I worked at, we had a system where each deploy got its own folder, and we'd update a symlink to point to the active one. It worked, but it was all manual, all custom, and all fragile. The first time I saw this I thought it was one of the most elegant solutions I'd ever seen working in technology. Safe to deploy the files, atomic switch over per machine, and trivial to rollback. It may have been manua…
Re: 30 years of <br> tags
#44> For that, you needed CGI scripts, which meant learning Perl or C. I tried learning C to write CGI scripts. It was too hard. Hundreds of lines just to grab a query parameter from a URL. The barrier to dynamic content was brutal. That's folk wisdom, but is it actually true? "Hundreds of lines just to grab a query parameter from a URL." /*@null@*/ /*@only@*/ char * get_param (const char * param) { const char * query =…
> HTML represents a tree and string interpolation is the wrong tool to generate a tree description. Yet 30 years later it feels like string interpolation is the most common tool. It probably isn't, but still surprisingly common.
Building the tree on the server is usually wasted work. Not a lot of tree oriented output as you make it libraries.
Re: 30 years of <br> tags
#45Earlier quoted context omitted.
I think they meant that from a vanilla HTML standpoint
Sure, but later in the article it says that when PHP came out it solved the problem of not being able to do includes. Which again... server-side includes predate PHP. I think that this is just an error in the article any way you slice it. I assume it was just an oversight, as the author has been around long enough that he almost certainly knows about SSI.
Re: 30 years of <br> tags
#46Earlier quoted context omitted.
Most commenters seem to miss that this is the throwaway code for HN, with a maximum allocated time of five minutes. I wouldn't commit it like this. The final code did cope with percent-encoding even though the project didn't took any user generated values at all. And I did read the RFCs, which honestly most developers I meet don't care to do. I also made sure the percent-decodation function did not rely on the ASCII…
I get that, but your initial comment implied you were about to showcase a counter to "Hundreds of lines just to grab a query parameter from a URL", but instead you showed "Poorly and incompletely parsing a single parameter can be done in less than 100 lines". You said you allocated 5 minutes max to this snippet, well in php this would be 5 seconds and 1 line. And it would be a proper solution. $name = $_GET['name'] ?…
name = cgiGetValue (cgi, "name");
if (!name) name = SOME_DEFAULT;
If you allow for GCC extensions, it looks like this: name = cgiGetValue (cgi, "name") ?: SOME_DEFAULT;Re: 30 years of <br> tags
#47What a comprehensive, well-written article. Well done! The author traces the evolution of web technology from Notepad-edited HTML to today. My biggest difference with the author is that he is optimistic about web development, while all I see is shaky tower of workarounds upon workarounds. My take is that the web technology tower is built on the quicksand of an out-of-control web standardization process that has been…
But I don't agree that the system is bound to collapse. Rather, as I read the article, I got this mental image of the web of networked software+hardware as some kind of giant, evolving, self-modifying organism, and the creepy thing isn't the possibility of collapse, but that, as humans play with their individual lego bricks and exercise their limited abilities to coordinate, through this evolutionary process a very big "something" is taking shape that isn't a product of conscious human intention. It's not just about the potential for individual superhuman AIs, but about what emerges from the whole ball of mud as people work to make it more structured and interconnected.
Re: 30 years of <br> tags
#48Earlier quoted context omitted.
Sure, but later in the article it says that when PHP came out it solved the problem of not being able to do includes. Which again... server-side includes predate PHP. I think that this is just an error in the article any way you slice it. I assume it was just an oversight, as the author has been around long enough that he almost certainly knows about SSI.
PHP's initial release announcement mentions includes as a feature that can be used even if the server does not have SSI support: https://groups.google.com/g/comp.infosystems.www.authoring.c...