Live data from Hacker News

Ask HN: What is the most beautiful piece of code you've ever read?

news.ycombinator.com

391–394 of 394 posts

Re: Ask HN: What is the most beautiful piece of code you've ever read?

#391
post #100

Bash fork bomb (do not run, this will crash your system if it's not configured properly): :(){ :|:& };:

That got my unix account suspended at university....

:-) DOS'ing the system is frowned upon.

Re: Ask HN: What is the most beautiful piece of code you've ever read?

#392
post #342
post #7

John Carmack's Fast Inverse Square Root: https://en.wikipedia.org/wiki/Fast_inverse_square_root#Overv... . The first time I really and truly felt that people approach problems differently from how I, by default, go about them.

If you enjoy this sort of thing, this book is full of bit twiddling algorithms you never thought possible: https://www.amazon.com/Hackers-Delight-2nd-Henry-Warren/dp/0...

How do I get a job in /this/ area? I couldn't care much to do JavaScript programming, but this is awesome.

Re: Ask HN: What is the most beautiful piece of code you've ever read?

#393
post #232

Curiously Recurring Template Pattern (CRTP) [0] in C++. class Derived : public Base [0] https://en.wikipedia.org/wiki/Curiously_recurring_template_p...

That's awesome. I ran into this situation in C#, and looks like it is useful in some cases. https://zpbappi.com/curiously-recurring-template-pattern-in-...

tl;dr: "Generally, whenever you need the derived class information in the base class, you are probably looking for CRTP."

Re: Ask HN: What is the most beautiful piece of code you've ever read?

#394

Earlier quoted context omitted.

Rebol was closed source back when open source was really starting to take off with Perl and Linux. It is seriously cool (I agree), but the interpreter is a little slow. Red still has a little ways to go, but could be a game changer some day. The project is insanely ambitious, but I'm optimistic.

The main (IMO sad) reason REBOL sits in a weird half-life position of "not quite dead, but..." is that, while REBOL Core is open, the GUI parts (which are crossplatform, and run on Linux) are still closed source. It's a bit like .NET Core. Great to base a business on... not so great to tinker around with. Arguably the second (tinkering, learning) comes before the first (using what you've learned to build a business).…

Just to clarify it's Rebol 2 (Core/etc) that is closed source.

Rebol 3 is open-sourced along with the GUI (R3-GUI)....

* https://github.com/rebol/rebol

* https://github.com/metaeducation/ren-c (community fork)

* https://github.com/zsx/r3-gui (Atronix fork)

Post reply on HN