7 ms·
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 on
by tbrock 11y ago
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 powerful, when you read the source you can't help but wonder where the rest of the code is.
Python: anything written by Kenneth Reitz (Requests, legit, records...) This guy can lay down some serious Python and gets things done. He writes the batteries that python should have had included.
- Biganon 11y agoIsn't Flask made by Armin Ronacher?
- tbrock 11y agoOh right, whatever Kenneth Reitz did then
- Hovertruck 11y agoNotably the "requests" library
- abustamam 11y agoToo bad TJ stopped writing JS and started writing Go.
- tbrock 11y agoYeah, too bad. Apex, his first go thing, is pretty great though.
- max_ 11y agoTJ tends to jump mon on from one language to another.. first Ruby(when Ruby was the thing), then JS(when NodeJS became popular) and now Golang(the current "thing")
- lucidquiet 11y ago'jump' -- I doubt it was hasty. Languages have issues, why stick with one when there are plenty to choose from. Of course, I like Golang, so somewhat biased -- it just appeals to my sensibilities, perhaps it does for TJ as well.
- timqian 11y agoAnd now he is writing a language https://github.com/tj/luna https://github.com/tj/luna
- Matthias247 11y agoLook at the changelog. He seems to have stopped this.
- oluckyman 11y ago"The code twists and contorts ruby in unimaginable ways." Doesn't sound like my idea of beautiful software.
- skewart 11y agoI completely agree. It sounds like the opposite of beautiful software if you ask me. Maybe it's interesting, thought-provoking, or amusing code, but not beautiful.
- tbrock 11y agoI found it beautiful because I had never thought to use the language in that way before I had seen him do it. It wasn't hard to understand once you understood. :-)
- ikurei 11y agoBeauty comes in very different forms. Not all beautiful paintings are pleasing and peaceful fields for flowers; IMHO, something can be dark, strange, even scary, and still beautiful. E.g.: The Garden of Earthly Delights[1], or It Follows[2]. [1] https://en.wikipedia.org/wiki/The_Garden_of_Earthly_Delights https://en.wikipedia.org/wiki/The_Garden_of_Earthly_Delights [2] http://www.imdb.com/title/tt3235888/ http://www.imdb.com/title/tt3235888/
- agumonkey 11y agoIt's more enlightenment / thinking out of the box / less is more beauty.
- Obi_Juan_Kenobi 11y agoI think it's perhaps not inappropriate for Ruby; it has a community that's all about 'magic' and even 'tricky' beauty. I certainly agree there are problems with this, but I also see how this is appealing in certain contexts.
- azaras 11y agoThis is awful code for Python but beautiful for Ruby. Python is "simplicity" and Ruby is "clever".
- skewart 11y agoI think that list is more of an answer to the question "What are some examples of widely-used FOSS projects created by famous programmers" than it is an answer to OP's question about beautiful software.
- codezero 11y agoI'd love to see your recommendations. Personally I find the redis source code to be extremely readable and well organized. Also these people didn't become "famous" for their Instagram selfies.
- blablabla123 11y ago>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
- lorenzhs 11y agogotos 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.
- lokeshk 11y agoSorry 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.
- Someone 11y agohttp://www.open-std.org/JTC1/SC22/wg14/www/docs/n1124.pdf 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."
- PeCaN 11y agoDereferencing a null pointer is undefined behavior. free() on NULL is defined to be a no-op.
- iurisilvio 11y agoPython: anything written by Kenneth Reitz or Armin Ronacher. You probably already used something from them. Beautiful APIs and clean code. It is easy to contribute to their projects.
- kakwa_ 11y agoI've not used it in recent years, but PolarSSL (now mbed TLS) was quite nice for a crypto library. It's a light, simple and clear C library. Not directly code, but the "Beyond pep 8" talk at PyCon 2015 by Raymond Hettinger is quite nice (https://www.youtube.com/watch?v=wf-BqAjZb8M https://www.youtube.com/watch?v=wf-BqAjZb8M). It gives interesting tips on how to separate "business logic" (the high level problem you try to solve) from the "purely technical stuff".