Brandon Rhodes
rhodesmill.org · Personal blog · on HN since 2009
Brandon Rhodes is a Python developer and speaker who writes about code structure and astronomy, and created the PyEphem and Skyfield libraries.
What HN saysHN commenters praise the Skyfield library for its pleasant API and recommend him as an excellent speaker on structuring Python code.
62HN people shared it
29linked it in comments
41stories submitted
1.6Kstory points
9 months agolast shared
2009people per year2026
Most-shared posts
- 1One sentence per line, please17 people · 150 points · first shared 2012 · 34 comments on HN
- 2Start all of your commands with a comma (2009)6 people · 1.3K points · first shared 2019 · 165 comments on HN
- 3PyEphem: Basic Astronomical Computations for Python5 people · 4 points · first shared 2011 · discussion on HN
- 4The Clean Architecture in Python (2014)4 people · 6 points · first shared 2016 · 1 comments on HN
- 5Talks by Brandon Rhodes4 people · 3 points · first shared 2013 · discussion on HN
- 6Skyfield: Elegant Astronomy for Python3 people · 1 points · first shared 2021 · discussion on HN
- 7Brandon3 people · first shared 2017
- 8PyEphem - Scientific-grade astronomical computations in Python2 people · 3 points · first shared 2011 · discussion on HN
- 9Introspect Python logging with logging_tree2 people · 3 points · first shared 2012 · discussion on HN
- 10Animating Ptolemy's Equant with Python, SVG, and CSS1 people · 68 points · first shared 2024 · 5 comments on HN
- 11Ubuntu Python: raise an exception, import 190 modules1 people · 62 points · first shared 2010 · 9 comments on HN
- 12Python multiprocessing is different under Linux and Windows1 people · 36 points · first shared 2010 · 26 comments on HN
- 13How to teach to code (a different approach)1 people · 9 points · first shared 2009 · 2 comments on HN
- 14WSGI and Truncated Chunked Response Bodies1 people · 5 points · first shared 2013 · discussion on HN
- 15When Python Practices Go Wrong1 people · 3 points · first shared 2020 · discussion on HN
What HN people wrote when they linked it
krisoft · 2025-01-03
I would recommend the Skyfield library: https://rhodesmill.org/skyfield/
It does the same thing, uses the spk files to compute planetary positions, but it does so with a beautifull API which is a pleasure to use.
danuker · 2022-05-17
For what it's worth, my take on it is that you should extract whatever bits of pure functions you can find in the 1000-line ones.
This would help testing and understanding. You can test and understand the parts independently, and only have to test the huge function in order to check that the parts are attached correctly.
https://rhodesmill.org/brandon/talks/#hoist
https://danuker.go.ro/the-grand-unified-theory-of-software-architectur…
jcims · 2021-03-02
Just want to give props to the skyfield python library. I have no idea what any of the numbers in the TLE mean but just by following some examples have been able to plot the location of Starlink satellites vs time very easily.
https://rhodesmill.org/skyfield/
I’m feeding it into Graphana to help visualize how satellite coverage impacts the signal strength and network performance of my dish. It’s pretty fun.
Nicksil · 2018-11-14
This is by Brandon Rhodes: A fantastic orator; one of the best, in my opinion.
Highly recommended for all, but especially for those working with Python.
Main Website: https://rhodesmill.org/brandon/
Articles: https://rhodesmill.org/brandon/all/
Talks: https://rhodesmill.org/brandon/talks/
btashton · 2017-01-30
Brandon Rhodes -- http://rhodesmill.org/brandon/
Excellent speaker and has recorded some great talks on structuring your code.
patrickdavey · 2015-04-22
Probably, the issue is that there's reflection of the double_ish_but_not_really_this_is_new_zealand glazed glass. Also, I take a ruthless approach to "fun" on small side projects and rather it works than is perfect. I did try putting a box around it but it wasn't really that workable as it sits in the corner of the lounge and I don't want it to be too bulky.
What sort of colour settings would you tweak?
p.s. if any other pi-timelapse people are out there, I would be quite keen at some point to open up the API so that you can post links to your videos too.. then we can have a google map to all the timelapses and it'd be just great! :D
p.p.s. did have fun using the python http://rhodesmill.org/pyephem/ to calculate the "Nautical Sunset - who knew?" so that it will properly adjust rather than the crude approach of a cron-job with a large enough bracket!
Love side projects :)
pronoiac · 2024-12-17
Oh wow! I've worked on turning PAIP (Paradigms of Artificial Intelligence Programming) from a book into a bunch of Markdown files, but that's "only" about a thousand pages long, compared to the roughly 27000 pages long of all those volumes. I have advice, possibly helpful, possibly not.
Getting higher quality scans could save you some headaches. Check the Internet Archive. Or, get library copies, and the right camera setup.
Scantailor might help; it lets you semi-automate a chunk of things, with interactive adjustments. I don't know how its deskewing would compare to ImageMagick. The signature marks might be filtered out here.
I wrote out some of my process for handling scans here - https://github.com/norvig/paip-lisp/releases/tag/v1.2 . I maybe should blog about it.
If you get to the point of collaborative proofreading, I highly recommend Semantic Linefeeds - each sentence gets its own line. https://rhodesmill.org/brandon/2012/one-sentence-per-line/ I got there by:
* giving each paragraph its own line
* then, linefeed at punctuation, maybe with quotation marks and parentheses? It's been a while
btrettel · 2022-06-10
Regarding writing "one-sentence-per-line", I've noticed that style before in LaTeX. While I don't use that style, one advantage that I like is the ability to include comments on the sentence level in LaTeX.
So instead of this:
First sentence. Second sentence. % Comment on first sentence.
I can write:
First sentence. % Comment on first sentence.
Second sentence.
(Of course, one could define a new TeX macro that doesn't display anything to add comments anywhere in-line. That's not as readable, though.)
I've also read that one-sentence-per-line works better with diff programs, but I haven't had any problems with the program meld, so this isn't convincing to me. The advantage the linked article mentions in terms of rearranging sentences also is worth considering, though I haven't found the normal way to be that bad so I'm not convinced by that either.
Some other links on this coding/writing style:
https://rhodesmill.org/brandon/2012/one-sentence-per-line/
https://news.ycombinator.com/item?id=4642395
http://www.uvm.edu/pdodds/writings/2015-05-13better-writing-editing-th…
gorgoiler · 2025-09-10
Prior art on writing line oriented prose comes from one B. Kernighan, no less! Via this blog post:
https://rhodesmill.org/brandon/2012/one-sentence-per-line/
> Start each sentence on a new line. Make lines short, and break lines at natural places, such as after commas and semicolons, rather than randomly. Since most people change documents by rewriting phrases and adding, deleting and rearranging sentences, these precautions simplify any editing you have to do later.
— Brian Kernighan, 1974
rednafi · 2025-01-06
Here are my favorites:
- Jacob Kaplan-Moss (https://jacobian.org/) [Engineering leadership, OSS]
- Anton Zhiyanov (https://antonz.org/) [SQL, Go, Python]
- Julia Evans (https://jvns.ca/) [SQL, Linux, Python, Go, Web]
- Brandur Leach (https://brandur.org/) [Postgres, Go, Ruby, Web]
- Brandon Rhodes (https://rhodesmill.org/brandon/) [Python, Astronomy, Linux]
- Nathanial J Smith (https://vorpus.org/blog/) [Python, Async, Linguistics]
I also write occasionally at https://rednafi.com.
fiddlerwoaroof · 2024-05-26
The models themselves are extremely fascinating: https://rhodesmill.org/ptolemy/inner-planets.html
When I was working through Ptolemy, I did some of this in Blender to visualize things like the phases of the moon as predicted by these models.
bpeebles · 2024-03-22
https://rhodesmill.org/brandon/2012/one-sentence-per-line/ is one possibility. And discusses a Kernighan Unix memo from 1974 advocating for the practice. "UNIX for Beginners" https://web.archive.org/web/20130108163017if_/http://miffy.tom-yam.or.… (PDF)
sam_bristow · 2024-02-02
My personal sweet-spot for writing technical documents these days is Asciidoctor with semantic line breaks [1]. There are some warts in the asciidoc syntax but it covers a lot more of the features I need for the types of documents I'm writing compared to Markdown.
[1] https://rhodesmill.org/brandon/2012/one-sentence-per-line/
JNRowe · 2023-12-01
It is from the same author. He semi-retired pyephem with the release of this project¹: "The Skyfield astronomy library should be preferred over PyEphem for new projects. Its modern design encourages better Python code, and uses NumPy to accelerate its calculations."
I switched a few toys I'd written from pyephem to skyfield, and it felt like a large improvement. (Must note that they really were toys though, so the amount of work wasn't huge in my case).
¹ https://rhodesmill.org/pyephem/
bayindirh · 2023-09-26
If you're not a sysadmin or debugging your netork, no. However if you're using it for any reason, you lose a command. This is why I start my local commands with a comma (,) [0].
[0]: https://rhodesmill.org/brandon/2009/commands-with-comma/
cratermoon · 2023-08-01
The part of about line-based diff tools caught my attention at first, too.
In the section "Hints for Preparing Documents" in Unix for Beginners[1], Brian W. Kernighan writes, "Make lines short,
and break lines at natural places, such as after commas
and semicolons, rather than randomly." At the time he was writing that, around 1978, the unix editor was ed, a line-based editor.
As Derek Sivers notes in his post,
there are many other reasons for semantic linefeeds[2],
and over time I've found those reasons more important.
1 https://web.archive.org/web/20130108163017if_/http://miffy.tom-yam.or.…
2 https://rhodesmill.org/brandon/2012/one-sentence-per-line/
behnamoh · 2022-06-24
Related to GP, here's an interesting article: https://rhodesmill.org/brandon/2009/commands-with-comma/
smoe · 2021-04-07
I have seen various conventions over the years on how to order css properties that could be used for ordering tailwind style classes. E.g https://rhodesmill.org/brandon/2011/concentric-css/
The problem is more, that to my knowledge, none of them got wide adaption. You could at adapt them on at least a company/team wide level, but don’t know what tooling there is to make it easily configurable.
spc476 · 2015-04-18
Once I read "Semantic Linefeeds" (http://rhodesmill.org/brandon/2012/one-sentence-per-line/) I've been experimenting with breaking on punctuation. Yes, it makes the raw text looks a bit odd (check the source on http://boston.conman.org/2015/04/16.1) but I've found it much easier to edit (especially when my girlfriend emails me corrections like spelling errors, typos, incorrect grammar, etc).
ryan-c · 2015-01-13
The default layout for the twiddler is pretty awful. If anyone wants to try one of these, check out the TabSpace layout.
https://github.com/cswetenham/tabspace2.1
http://rhodesmill.org/brandon/projects/tabspace-guide.pdf
It's much better.
If anyone's interested, there's a typing tutor for it and I have files to modify it for use with TabSpace (I'd have to find them though)
http://wearables.cc.gatech.edu/projects/twidor/download.html
siddboots · 2013-06-29
Somewhat related, I just discovered PyEphem, and have been using it to pin down a time and location from the stars that appear in XKCD #1190
http://forums.xkcd.com/viewtopic.php?f=7&t=101043&p=3395021#p3…
http://rhodesmill.org/pyephem/
lloeki · 2012-10-12
> To recap, the arguments for single-spacing are: 1. Two-spacing is ugly in proportional fonts. [..] Number 3 is false, because two-spacing gives you two advantages over one-spacing: It looks better in your editor.
I beg to differ. I find that two-spacing feels wrong even in monospace. And even code is not write-only, so it's a stab in my eye every time I 'develop'.
Also, since both HTML and markdown use single-newline chars as word - not paragraph - delimiters, the semantic argument doesn't hold because I'll counter it with [0].
[0] http://rhodesmill.org/brandon/2012/one-sentence-per-line/
euroclydon · 2011-02-10
I recently spent three hours trying to track down an algorithm to convert celestial (or equatorial) coordinates to ecliptic. I found several Matlab scripts that purported to work and I tried them in Octave. They never gave answers even close to the NASA Calc [1], so then I searched for something in Python and found pyehpem [2], pulled it down with easy_install, and had the correct answer in two lines of code.
[1] http://lambda.gsfc.nasa.gov/toolbox/tb_coordconv.cfm
[2] http://rhodesmill.org/pyephem/index.html
garret · 2009-05-26
Here's another one.
http://rhodesmill.org/brandon/2009/graphicsmagick-saved-the-day/
sovietswag · 2024-03-22
It turns out that there is a lot of discourse out there about "semantic newlines", under a few different names. So far the names I've seen are:
- One Sentence Per Line (OSPL) - Semantic Line Breaks (SemBr) - Semantic Linefeeds - Ventilated Prose - Semantic newlines
Reading through the pages below was helpful in getting a better idea of what language people use to discuss this. They're mostly historical retrospectives or arguments for the merit of semantic newlines.
https://rhodesmill.org/brandon/2012/one-sentence-per-line https://ramshankar.org/blog/posts/2019/semantic-line-breaks https://vanemden.wordpress.com/2009/01/01/ventilated-prose https://discuss.python.org/t/semantic-line-breaks/13874 https://discuss.python.org/t/one-sentence-per-line-for-peps-and-more/1… https://sembr.org https://asciidoctor.org/docs/asciidoc-recommended-practices/#one-sente…
(Actually I think one-sentence-per-line denotes something slightly different from semantic-line-breaks, not that I know what that difference is).
chubot · 2017-06-10
I was going to write that I don't have a good pointer, but actually I think the idea is basically the "onion architecture" or "clean architecture". I don't recall if I watched all of this talk, but in general I like Brandon Rhodes' PyCon talks :
https://www.youtube.com/watch?v=DJtef410XaM
http://rhodesmill.org/brandon/slides/2014-07-pyohio/clean-architecture…
I don't come from a Java background, but I think that many of these ideas originated in the Java community. They came to Python later (if at all), and it's a little funny to see Go struggling with the same thing.
I think I came at it from more of a functional programming perspective, and the style gradually converged with what people were thinking about OOP. I'm not actually of all the details about "clean architecture" and "onion architecture", but they are definitely related to dependency injection.
Basically all your effects and state can be instantiated on the "outside" in main() and passed INWARD. But I don't believe it necessarily has to be pure. I encapsulate all my state, but I don't encapsulate all my side effects, like printing to the screen.
Some people appeared to like this comment, which is somewhat related:
https://news.ycombinator.com/item?id=11841893
I'm not sure how much this will help, but here is 12K+ lines of code I wrote with zero globals:
https://github.com/oilshell/oil
The main directories to look at are core/ and osh/. The main program imports a lot of stuff and wires it…
abc_lisper · 2016-09-12
Ahem. Let me be the first to say, YUCK!!!
I don't understand why people like this language. I am sure it has it's uses etc., but come on, if you want to build a reliable, easy-to-reason program, using JS is just running up a escalator that is going down.
https://abdulapopoola.com/2015/09/30/why-javascript-seems-to-get-addit…
http://rhodesmill.org/brandon/2012/js/
http://dorey.github.io/JavaScript-Equality-Table/
https://www.destroyallsoftware.com/talks/wat
http://blog.chewxy.com/2014/01/27/javascript-wat-again/
I can see using js as a target language with a 'transpiler', but JS is just a shitty language to write code.