Live data from Hacker News

Ask HN: What are some examples of beautiful software?

news.ycombinator.com

231–240 of 262 posts

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

#231

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.

And according to them, valgrind (and linux) can be qualified as beautiful piece of code[1]:

"Valgrind is perhaps the most amazing and useful developer tool in the world. Valgrind is a simulator - it simulates an x86 running a Linux binary. (Ports of Valgrind for platforms other than Linux are in development, but as of this writing, Valgrind only works reliably on Linux, which in the opinion of the SQLite developers means that Linux should be the preferred platform for all software development.) As Valgrind runs a Linux binary, it looks for all kinds of interesting errors such as array overruns, reading from uninitialized memory, stack overflows, memory leaks, and so forth. Valgrind finds problems that can easily slip through all of the other tests run against SQLite. And, when Valgrind does find an error, it can dump the developer directly into a symbolic debugger at the exact point where the error occur, to facilitate a quick fix." [1] https://www.sqlite.org/testing.html

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

#232
post #227
post #27

Earlier quoted context omitted.

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

It's a really clean abstraction of a computing environment, which is as well defined and predicatable that is possible. I tend to prefer that to performance cludges, arcane architectural hand waving, and undefined behaviour. Some people thinks it's useless, since they do no see the benefits, as there are costs. (There are some obvious UX-flaws, especially on the desktop, where it takes a bit to start up, and clearly…

> It's a really clean abstraction of a computing environment

No, it's a clumsy and leaky abstraction which was not well thought out. P-codes are a nice abstraction. AS/400 is a nice abstrction. Dozens of other, better VMs are a nice abstraction. But not a JVM, which is broken by design.

I'd never chose it as an underlying VM for anything important.

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

#233

Earlier quoted context omitted.

I completely agree with wingerlang here, and I think the fact that the OP ends with > ... and what makes it beautiful. makes this clear. It's a subjective question deliberately looking to elicit subjective answers, with the point of interest being the individual justifications behind those answers. However, despite my disagreement with your sentiment (calling for a more objective question), you did actually answer th…

Hi, that is exactly what I meant. The reasoning behind it is just as important as what it is your example. Paul Graham says in Hacker's and Painters that “... If there is such a thing as beauty, we need to be able to recognize it. We need good taste to make good things. Instead of treating beauty as an airy abstraction, to be either blathered about or avoided depending on how one feels about airy abstractions, let's…

Adding to this, I think one should not assume beautiful software and beautiful code to be the same thing. Just like the many dimensions of beautiful, there are many dimensions of "software", only one of which is code.

Beautiful software should solve a problem. It should fit in like a cog to empower humans to do lot more things or do things which were harder to do before.

Beautiful software includes a lot more things than just code or how code is written.

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

#234
post #179

Werkzeug's Jinja2 templating engine written in Python. I happened to dig into its source code for something and eventually found myself amazed at how the entire base is beautifully laid out. It's no nowhere near being naive. It's almost a simple programming language implemented in python. A compiler of sorts with its own abstract syntax tree and stuff. Yet the code is very readable, straight forward and just taught m…

You mean Jinja2? Also, Jinja2 and Werkzeug aren't coupled - you can use practically any Python templating lib with it as Werkzeug is just a WSGI library (+ and of course something else..). And they happen to share the author.

Yeah, my bad. Updated the details. Thanks. 'Mitsuhiko' is a hard name to remember.

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

#235

Earlier quoted context omitted.

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.

Sorry to be a stickler, but the error handling in your method "frees" a resource even when nothing was allocated to it. Freeing a null pointer is as such an undefined behavior.

http://www.open-std.org/JTC1/SC22/wg14/www/docs/n1124.pdf, section 7.20.3.2 "The free function":

"The free function causes the space pointed to by ptr to be deallocated, that is, made available for further allocation. If ptr is a null pointer, no action occurs."

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

#236
post #220
post #212

Earlier quoted context omitted.

> 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.

That's when you make a nice set of M4 macros that generate C preprocessor macros that expand to templates.

To be honest the time I did that it actually helped, which I guess goes to show how elegant C++ templates aren't....

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

#238

Earlier quoted context omitted.

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.

Sorry to be a stickler, but the error handling in your method "frees" a resource even when nothing was allocated to it. Freeing a null pointer is as such an undefined behavior.

Dereferencing a null pointer is undefined behavior. free() on NULL is defined to be a no-op.

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

#239
post #106

JSON. The way it displays and organizes complex data, better than other standards like CSV or XML. Or the things that use tables. When I first started programming, I had two favorite ways of storing data - INI and arrays. INI for its elegant key/value style. Arrays were just natural because of the way computers think. I spent months trying to mold these two things together; how would you actually store key-value thin…

JSON is not all its cracked up to be. It is useful, but I find its getting treated as some sort of magical solution to everything in the way that XML was 15 years ago.

I have had to configure various pieces of software in JSON and its a PITA (compared to doing the same sort of thing in Python, or most configuration files actually). Its picky about what quotes you use. Its picky about leaving trailing commas in arrays. Its not particularly readable (compared to YAML or XML). It only has one numerical type.

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

#240
post #41

Nobody mentioned git?

I'd be a bit surprised if anyone did. Git is powerful and flexible, but it is also complicated and difficult to use for people who aren't experts. Beautiful software should make simple things simple, and hard things possible. Git leans strongly toward the latter, to the detriment of the former. I need version control software that's mostly like a shovel and maybe sometimes like a backhoe. Git is like one of these: ht…

I am of the same opinion as you. I have started using git flow recently and it keeps me from shooting myself in the foot as often.

So far this is as much documentation I have needed. http://danielkummer.github.io/git-flow-cheatsheet/

Post reply on HN