Earlier quoted context omitted.
And in the code in C it looks like this, which is also a proper solution, I did not measure the time, it took me to write that. 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;
That would fail on a user supplying a multiple where you don't expect. > If multiple fields are used (i.e. a variable that may contain several values) the value returned contains all these values concatenated together with a newline character as separator.
30 years of tags
91–100 of 103 posts
Re: 30 years of <br> tags
#92Earlier 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.
I am off similar vintage to the author. I have no idea when Apache first supported SSI , but personally I never knew it existed until years after PHP became popular. I would guess , assuming that `Options +Includes` cannot be done by unprincipled users, that this being a disabled-by-default feature it was inaccessible to majority of us.
"src/modules/standard/mod_include.c" says:
/*
* http_include.c: Handles the server-parsed HTML documents
*
* Original by Rob McCool; substantial fixups by David Robinson;
* incorporated into the Apache module framework by rst.
*
*/
Rob McCool is the author of NCSA HTTPd so it seems there is direct lineage wrt. this feature between the two server implementations.Re: 30 years of <br> tags
#93Earlier quoted context omitted.
My point is that treating it as the tree it is, is the only way to really make it impossible to produce invalid HTML. You could also actually validate not just syntax, but also semantic. > Not a lot of tree oriented output as you make it libraries. That was actually the point of my library, although I must admit, I haven't implemented actually streaming the HTML output out, before having composed the whole tree. It i…
There was a system with dependent types that ruled out invalid html at compile time, even dynamically generated html (rather than a runtime error, you would get a compile error if your code did something wrong) https://github.com/urweb/urweb http://www.impredicative.com/ur/ Needless to say it wasn't very practical. But there was one commercial site written in it https://github.com/bazqux/bazqux-urweb (the site still…
Ur/Web is not very practical for reasons other than type safety: the lack of libraries and slow compilation when the project gets big. The language itself is good, though.
Nowadays, I would probably choose OCaml. It doesn't have Ur/Web's high-level features, but it's typed and compiles quckly.
Re: 30 years of <br> tags
#94Earlier quoted context omitted.
You can use entities to create static sites in advance, or by including support in the browser. sgmljs can do both, and simply using shared headers/footers for static site generation from markdown and other SGML partials is explained in [1]. [1]: https://sgmljs.sgml.net/docs/producing-html-tutorial/produci...
I think you're missing the point here. None of these things were available to users writing HTML for web browsers in the 1990s.
Re: 30 years of <br> tags
#95Earlier quoted context omitted.
Not sure, why you are getting downvoted, as that was pretty much the case before HTML5.
Not one of the downvotes, but: as far as I'm aware, there was never any syntax which could be used for HTML transclusion in the browser. There may have been SGML or XML syntaxes proposed for it, but none of them were actually implemented in this context.
Re: 30 years of <br> tags
#96Re: 30 years of <br> tags
#97> 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…
I put that in a little bash script so.. I don't know if you call anything that isn't CI "manual" but I don't think it'd be hard to work into some pipeline either.
I kind of miss it honestly.
Re: 30 years of <br> tags
#98Earlier quoted context omitted.
You can use entities to create static sites in advance, or by including support in the browser. sgmljs can do both, and simply using shared headers/footers for static site generation from markdown and other SGML partials is explained in [1]. [1]: https://sgmljs.sgml.net/docs/producing-html-tutorial/produci...
I think you're missing the point here. None of these things were available to users writing HTML for web browsers in the 1990s.
Re: 30 years of <br> tags
#99> 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 =…
> That's folk wisdom, but is it actually true? "Hundreds of lines just to grab a query parameter from a URL." No, because... > In practice you would probably parse all parameters at once and maybe use a library. In the 90s I wrote CGI applications in C; a single function, on startup, parsed the request params into an array (today I'd use a hashmap, but I was very young then and didn't know any better) of `struct {cha…
Isn't that CURL?
Re: 30 years of <br> tags
#100Earlier quoted context omitted.
There was a system with dependent types that ruled out invalid html at compile time, even dynamically generated html (rather than a runtime error, you would get a compile error if your code did something wrong) https://github.com/urweb/urweb http://www.impredicative.com/ur/ Needless to say it wasn't very practical. But there was one commercial site written in it https://github.com/bazqux/bazqux-urweb (the site still…
It's still written in Ur/Web. And the type-safety of Ur/Web is the reason I started writing it -- I couldn't imagine myself using untyped JavaScript. Ur/Web is not very practical for reasons other than type safety: the lack of libraries and slow compilation when the project gets big. The language itself is good, though. Nowadays, I would probably choose OCaml. It doesn't have Ur/Web's high-level features, but it's ty…
What do you think about Typescript? I mean it's unsound but - it sounds like an ok compromise