Live data from Hacker News

Reddit 1.0 source code

github.com

91–100 of 117 posts

Re: Reddit 1.0 source code

#91
post #72

Earlier quoted context omitted.

I still don't get why non-code templating ever became popular. Especially that I saw it becoming popular in PHP , which itself is a better templating language than the templating languages people were using. Instead, people created plethora of languages that slowly accrued Turing-completeness with them, because religious adherence to "no code in views" is stupid. That said, glue-strings-together templates are still a…

>I still don't get why non-code templating ever became popular. Because if you're working on a team, not everyone on your team may be a programmer, particularly if they're just working on layout design, and the problem that templates solve in that regard don't require complete access to raw code. Separating one from the other makes it easy to focus on one versus the other. Just look at how messy a complex Wordpress t…

> but I don't know whether or not you could get something like XHR out of it, and by extension, avoid the problem of HTML as concatenated strings.

.. I meant XHP, not XHR, can't edit it now. Oops.

Re: Reddit 1.0 source code

#92

Never played around with Lisp, so excuse the ignorance. Is this typical to construct HTML in Lisp? This feels incredibly verbose and error prone, not to mention confusing and hard to grok. Good luck having a designer mockup/write HTML. (defun login-panel () (pbox "login/register" (:form :id "logform" :class "nomargin" (:table :style "border-collapse: collapse" (:tr (:td :colspan "2" "username:")) (:tr (:td :colspan "…

> This feels incredibly verbose and error prone, not to mention confusing and hard to grok.

That looks a lot less verbose, error-prone, confusing & hard-to-grok than actual HTML, don't you think? Or do you actually prefer the HTML below?

    
        
            username:
            
            password:
            
            remember me
            
            
                
            
            what's my password?
        
    
For my money, the S-expression HTML is much easier to read & understand.

Re: Reddit 1.0 source code

#93
post #90

Earlier quoted context omitted.

https://github.com/Clozure/ccl/blob/master/lib/case-error.li... %assertion-failure doesn't look like an accessor. http://clhs.lisp.se/Body/f_car_c.htm car described as "accessor", not named %car . No public function in CL is named this way. In fact, the character % doesn't make an appearance at all: http://www.lispworks.com/documentation/lw50/CLHS/Front/X_Per... I've never named a function or macro %something in 18 y…

Sure, sure. But while it's definitely not in the standard, I do see it all over, and it's something I picked up from reading a lot of other people's lisp. SBCL internals, for example. You might not like the convention and chose not to follow along with it, but I would be surprised if, after 18 years of lisp, you had never seen it before, and would choose to misspell an accessor to prevent a clash instead of naming it…

I've never seen this outside of internals.

In application code, this is just a smell.

To prevent clashes, there are packages.

What will you do if three or more modules want the same function name? Tack on %%, %%%, ...

Re: Reddit 1.0 source code

#94

Never played around with Lisp, so excuse the ignorance. Is this typical to construct HTML in Lisp? This feels incredibly verbose and error prone, not to mention confusing and hard to grok. Good luck having a designer mockup/write HTML. (defun login-panel () (pbox "login/register" (:form :id "logform" :class "nomargin" (:table :style "border-collapse: collapse" (:tr (:td :colspan "2" "username:")) (:tr (:td :colspan "…

> Is this typical to construct HTML in Lisp? This feels incredibly verbose and error prone, not to mention confusing and hard to grok. Good luck having a designer mockup/write HTML.

Do you mean that (:td :colspan "2" "username:") is verbose and error-prone compared to username:, or what are you comparing it to? That code is probably denser than I would have written it, but I don't see any issue related to the fact the HTML is being generated from Lisp.

This example doesn't take advantage of it, but writing HTML in Lisp is easier and less error-prone than regular HTML, because you can abstract patterns and factor things.

Re: Reddit 1.0 source code

#95
post #92

Never played around with Lisp, so excuse the ignorance. Is this typical to construct HTML in Lisp? This feels incredibly verbose and error prone, not to mention confusing and hard to grok. Good luck having a designer mockup/write HTML. (defun login-panel () (pbox "login/register" (:form :id "logform" :class "nomargin" (:table :style "border-collapse: collapse" (:tr (:td :colspan "2" "username:")) (:tr (:td :colspan "…

> This feels incredibly verbose and error prone, not to mention confusing and hard to grok. That looks a lot less verbose, error-prone, confusing & hard-to-grok than actual HTML, don't you think? Or do you actually prefer the HTML below? username: password: remember me what's my password? For my money, the S-expression HTML is much easier to read & understand.

You may find varying answers depending on who you're asking and if they have any experience with Lisp.

As someone who doesn't, the HTML example is 100% easier to read in my opinion coming from a Rails developer. You don't have to go against the grain to get the output you desire, you can just write it as it is intended to be rendered.

Re: Reddit 1.0 source code

#96
post #41

Earlier quoted context omitted.

Maybe having it be open source would represent a security risk? https://github.com/reddit-archive/reddit1.0/blob/master/data...

I mean, it shouldn't. Humanity is perfectly capable of building secure web services without having to keep the way it works a secret. You don't publish your encryption keys with your source code, which is what your security should be depending on. And what's more, Reddit themselves did not even use that excuse in their official statement for it, even though to me their excuse felt even less logical. Basically, they d…

When I worked there, it mostly came down two two things that leaked into every product: anti-abuse (spam mostly), and ads/tracking.

Anti-abuse is useful to keep secret because it includes tools that make spammers think they're successful. I think it's a little more nuanced than the "open source code is more secure argument", which I totally agree with - but the anti-abuse includes active mitigation measures that constantly evolve; and in this case, obscurity to how this all works is actually valuable.

A reddit-specific ad or metrics implementation isn't useful to anyone else, and it was a tough sell that the codebase should be made more complex only to accommodate configuration for a small handful of users. I know, because I made the argument that we should when I created the open-source reddit-mobile repo, which was originally broken up into plugins like the reddit python codebase. Eventually it just wasn't feasible to maintain as a 2-5 engineer team rebuilding a 10-year-old website in a couple of months. That's a story for another time.

Personally - I find it sad, and I think it got rid of one more thing that made Reddit special. Unfortunately, the only metric you can attach to this is "how much longer does it take us to ship shit", and thus, it died.

Re: Reddit 1.0 source code

#97
post #90

Earlier quoted context omitted.

https://github.com/Clozure/ccl/blob/master/lib/case-error.li... %assertion-failure doesn't look like an accessor. http://clhs.lisp.se/Body/f_car_c.htm car described as "accessor", not named %car . No public function in CL is named this way. In fact, the character % doesn't make an appearance at all: http://www.lispworks.com/documentation/lw50/CLHS/Front/X_Per... I've never named a function or macro %something in 18 y…

Sure, sure. But while it's definitely not in the standard, I do see it all over, and it's something I picked up from reading a lot of other people's lisp. SBCL internals, for example. You might not like the convention and chose not to follow along with it, but I would be surprised if, after 18 years of lisp, you had never seen it before, and would choose to misspell an accessor to prevent a clash instead of naming it…

To be explicit, the old Lisp convention I know of, which is not a super common one but one I've definitely used quite a bit, is that you might name a slightly lower-level/more primitive version of a function with a %-prefix.

So if we have a user-email function that is just an object slot accessor, We could have %user-email that actually does a database query. I can't remember for sure, but I wouldn't be surprised if I'd seen a double %%-prefix used, too.

You don't always want to put those functions in separate packages (traditionally in Lisp, packages are relatively heavyweight--e.g. an entire web server framework might have only one or two packages).

Another similar example might be the convention of defining a macro with the name my-macro, and a function that actually implements much of the macro, or is an equivalent of the macro that takes a thnk, that is named my-macro*.

(24 years of lisp here--I wouldn't be surprised if the conventions of mainstream lisp during the earliest six years were somewhat different than the following decades.)

Edited to add: Now that I think about it, this convention may have been heavily used in the Macintosh Common Lisp community.

Re: Reddit 1.0 source code

#98
post #44

Never played around with Lisp, so excuse the ignorance. Is this typical to construct HTML in Lisp? This feels incredibly verbose and error prone, not to mention confusing and hard to grok. Good luck having a designer mockup/write HTML. (defun login-panel () (pbox "login/register" (:form :id "logform" :class "nomargin" (:table :style "border-collapse: collapse" (:tr (:td :colspan "2" "username:")) (:tr (:td :colspan "…

> Good luck having a designer mockup/write HTML. What you are looking at was designed by a designer. Maybe you think another designer you know could make something that looks better if only they could use their own tools, instead of tools that this designer liked to use. I remember an age when I would receive photoshop "designs" that I would have to re-code in HTML. Then they got dreamweaver and thought they didn't n…

That's why I like JSX so much. After 10+ years of trying different ways to output dynamic HTML, JSX is by far my favorite. I wanted to elaborate why, but I just figured that I don't know. I just like it better than everything else I've ever used.

Re: Reddit 1.0 source code

#99
post #90

Earlier quoted context omitted.

Sure, sure. But while it's definitely not in the standard, I do see it all over, and it's something I picked up from reading a lot of other people's lisp. SBCL internals, for example. You might not like the convention and chose not to follow along with it, but I would be surprised if, after 18 years of lisp, you had never seen it before, and would choose to misspell an accessor to prevent a clash instead of naming it…

I've never seen this outside of internals. In application code, this is just a smell. To prevent clashes, there are packages. What will you do if three or more modules want the same function name? Tack on %%, %%%, ...

Only in implementation internals? I'm fairly certain I've encountered it in other unexported package symbols in library code, things like struct constructors where you want a "smarter" "make-my-struct" function. But perhaps I misremember.

> What will you do if three or more modules want the same function name? Tack on %%, %%%, ...

Certainly not!

I think your points are all very fair: it would be a smell, and is evidence of a need for improvements at a more structural level. It just smells a little less than a seemingly purposeful misspelling to my nose.

Re: Reddit 1.0 source code

#100
post #90

Earlier quoted context omitted.

Sure, sure. But while it's definitely not in the standard, I do see it all over, and it's something I picked up from reading a lot of other people's lisp. SBCL internals, for example. You might not like the convention and chose not to follow along with it, but I would be surprised if, after 18 years of lisp, you had never seen it before, and would choose to misspell an accessor to prevent a clash instead of naming it…

To be explicit, the old Lisp convention I know of, which is not a super common one but one I've definitely used quite a bit, is that you might name a slightly lower-level/more primitive version of a function with a %-prefix. So if we have a user-email function that is just an object slot accessor, We could have %user-email that actually does a database query. I can't remember for sure, but I wouldn't be surprised if…

Thank you, and thank you to the grandparent.

It's quite fantastic to be schooled by old-time lispers (only 6 years of lisp here).

Post reply on HN