Live data from Hacker News

Ask HN: What are some examples of beautiful software?

news.ycombinator.com

211–220 of 262 posts

Re: Ask HN: What are some examples of beautiful software?

#211
post #101

C: anything by antirez (redis, etc...) Redis is the epitome of well written understandable C. Ruby: anything written by _why (if you can find the source) He once gave a whole presentation on the splat operator and it's bizarre uses that gave me goosebumps. A true artist. The code twists and contorts ruby in unimaginable ways. JS: anything written by TJ hollwaychuck (express, mocha, etc...) Express is so simple but po…

>C: anything by antirez (redis, etc...) Redis is the epitome of well written understandable C. The first file I opened has 3 gotos but maybe it's pure randomness... ;p

gotos are sometimes used in C for error handling (to release resources), it's a simple way to do cleanup:

    void foo() {
        int* foo = malloc(...)
        if (foo == NULL) goto err_foo;
    
        int* bar = malloc(...)
        if (bar == NULL) goto err_bar;
    
        /* code */
    
    err_bar:
        free(bar);
    err_foo:
        free(foo);
    }
That's a use of goto that's often considered non-evil, probably because the alternatives are typically a lot more ugly.

Re: Ask HN: What are some examples of beautiful software?

#212
post #190

I'm seeing a lot of meanings to "beautiful" here, please, let's define what we're talking about. Does "beautiful" means "the code is clean"? If so, the Quake source code is "beautiful", while Duke3D Build engine is "ugly". Does "beaufitul" means "the code is clever"? If so, gcc, ffmpeg and ODE are "beautiful", and Google's Ninja is "tasteless". Does "beautiful" means "the code is modular" (I mean "open-closed" here)?…

> Does "beautiful" means "the software can be twisted in lots of interesting ways"? If so, dynamic language interpreters are "beautiful", while static language compilers are "ugly".

You'd be surprised what people do to static language compilers. C++'s template are turing complete, after all.

Re: Ask HN: What are some examples of beautiful software?

#213

Not specifically "software" but this piece of Haskell code is the most beautiful code I've ever seen: quicksort [] = [] quicksort (x:xs) = quicksort [y|y =x]

Will you still think that when you realize it isn't actually a quicksort?

It's tree sort. It does the same comparisons as quicksort, but organizes its data differently.

It's nifty, but not an especially beautiful use of Haskell.

Okasaki's Red-Black Trees rendered in Haskell are nicer, for example.

Re: Ask HN: What are some examples of beautiful software?

#214
post #97
post #62

Earlier quoted context omitted.

I'm not sure I agree with that. JSON parsing uses panic() and recover() for some logic. And templating is more of a PoC for coroutines in Go than a properly fleshed out library. Not to mention that the AST parsing for Go is horribly designed (though you can do some cool stuff with it).

> And templating is more of a PoC for coroutines in Go than a properly fleshed out library. I worked with Rob on that library and that's really not the case. It was designed from the ground up to replace the existing template library which was bad in several ways. The parser (which is I think what you refer to) is just an implementation detail.

> I worked with Rob on that library and that's really not the case. It was designed from the ground up to replace the existing template library which was bad in several ways. The parser (which is I think what you refer to) is just an implementation detail.

Right, but why can't I call define custom operators? And why is there no bracketing in conditionals? It just feels clunky to me (but maybe I'm too spoiled with Jinja2). I still feel like you could allow execution of functions passed in the data argument (as long as the developer doesn't shoot themselves in the foot, it shouldn't be a security problem).

It's stuff like that which makes me feel like it was a PoC (or at least, not designed to be feature-complete). Still, it works pretty well for plenty of usecases (I use to generate config files every once in a while).

Re: Ask HN: What are some examples of beautiful software?

#216
post #27

Beautiful software =/= beautiful code. Beautiful software: Java Virtual Machine (the code? could be entirely un-beautiful ;)

I'm genuinely puzzled. What can be beautiful anywhere in the JVM?!?

It's enterprise beautiful.

Re: Ask HN: What are some examples of beautiful software?

#217

My vote is for SQLite. It is very well written, incredibly well tested, and one of the simplest and most flexible tools out there. My favorite part is the extensive documentation explaining the architecture decisions they made.

is this more a case of 'well-engineered'? I agree the quality of SQLite is very high, but is it just devotion to details or aesthetic?

I'd argue that good engineering is beautiful also.

Re: Ask HN: What are some examples of beautiful software?

#218

Rust. It's god damn beautiful. It's design is magnificent, so much so that it seems easy to write beautiful rust code myself.

I also think Rust is magnificent, the way they combined manual memory management with the feel of an automatic one, all at compile time, paired with the rest of the type system; functional, compossible and flexible, is exactly the level of practical, useable innovation I would like to see more frequently.

Re: Ask HN: What are some examples of beautiful software?

#219
post #190

I'm seeing a lot of meanings to "beautiful" here, please, let's define what we're talking about. Does "beautiful" means "the code is clean"? If so, the Quake source code is "beautiful", while Duke3D Build engine is "ugly". Does "beaufitul" means "the code is clever"? If so, gcc, ffmpeg and ODE are "beautiful", and Google's Ninja is "tasteless". Does "beautiful" means "the code is modular" (I mean "open-closed" here)?…

This is a superb comment that illustrates how for a given purpose different quality factors are important. Can anyone recommend resources that try to systemise why these choices are made?

Edit: Grammar.

Re: Ask HN: What are some examples of beautiful software?

#220
post #212
post #190

I'm seeing a lot of meanings to "beautiful" here, please, let's define what we're talking about. Does "beautiful" means "the code is clean"? If so, the Quake source code is "beautiful", while Duke3D Build engine is "ugly". Does "beaufitul" means "the code is clever"? If so, gcc, ffmpeg and ODE are "beautiful", and Google's Ninja is "tasteless". Does "beautiful" means "the code is modular" (I mean "open-closed" here)?…

> Does "beautiful" means "the software can be twisted in lots of interesting ways"? If so, dynamic language interpreters are "beautiful", while static language compilers are "ugly". You'd be surprised what people do to static language compilers. C++'s template are turing complete, after all.

Templates can achieve "towering soviet concrete brutalist monument to ugliness" levels of ugly.
Post reply on HN