this post was submitted on 07 Jun 2025
140 points (95.5% liked)

Programming

20721 readers
304 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



founded 2 years ago
MODERATORS
top 20 comments
sorted by: hot top controversial new old
[–] sxan@midwest.social 2 points 3 hours ago

I lived this working for a company that, as part of a suite of services, tracked international business travelers for the companies they worked for. The air travel part was a nightmare.

You know what else was a nightmare? There's an airport in Hong Kong which technically isn't in any country as per most land country boundary maps; it's built it out in the ocean. It occasionally gave us grief when we updated map data because we'd have to go in and manually change the map boundaries so the software would correctly locate travelers at the airport as being in the country.

Which countries are Hong Kong, Macau, Tibet, and Taiwan airports in? Hong Kong has since become un-controversial, but no matter what you choose people get upset about it.

That system was so complex, it was fascinating. The fight data alone is a nightmare, but when you start factoring in itineraries, and the fact that there's no commonly used standard for booking systems and booking agencies have terrible data quality control, our most common issue was data quality; even after 15 years, the we'd still find edge cases in the system where real world varied from theory.

[–] ulterno@programming.dev 6 points 21 hours ago

Each runway is only used by one airport

Nice one.
I remember having to sit in an hour long drive to go from one airport to another, because you are not allowed to use the other airport if you have been checked in to one, when landing.
So you have to leave one from its exit and enter the other through the designated entry, even though the actual point you are going to, is a 2 minute walk.

[–] BrianTheeBiscuiteer@lemmy.world 6 points 22 hours ago (1 children)

More than one definition of altitude sounds the scariest. That's literally the kind of information that keeps planes from crashing into each other.

[–] captain_aggravated@sh.itjust.works 29 points 22 hours ago (2 children)

Flight instructor here: There are several definitions of altitude that pilots are taught about and must consider during a flight. These include:

True altitude: The aircraft's actual height above mean sea level. Nowadays you'd probably get this from a GPS receiver. Most of the time we don't really care about this.

Absolute altitude: The aircraft's instantaneous altitude above the surface directly below it. This might be measured by a radar altimeter if the aircraft is carrying one, or possibly calculated comparing the aircraft's GPS position and a topographical map, a lot of moving map systems can do that these days. Fairly important to keep in mind for avoiding controlled flight into terrain.

Indicated altitude: The reading of a barometric altimeter set to the local barometric pressure. Below 18,000 feet, this is used for vertical separation of aircraft. Air Traffic Control tells you to climb and maintain 8,500, you climb until the altimeter points to that number. This is still above mean sea level so when flying over land your absolute altitude is almost certainly less than your indicated altitude.

Pressure altitude: The reading of a barometric altimeter set to 29.92 inches of mercury. Above 18,000 feet, used for vertical separation of aircraft. 18,000 feet is the floor of Class A airspace: en route IFR-only airspace, it's where airliners cruise. They're not worried about where they are in relation to the surface so much, they're mostly concerned with avoiding other aircraft, and they don't want to have to constantly adjust for local settings, so they sit it to match a standard day. This might mean they're hundreds of feet off from their true altitude, but who cares? This is part of the reason we refer to altitudes up there as "flight levels". 22,000 feet is called Flight Level 220.

Density altitude: This one is going to bend your brain a little. Density altitude is indicated altitude corrected for non-standard temperature. It is used for predicting aircraft performance. Aircraft work by interacting with air molecules. When the air is dense, the engine can generate more power, the propeller can generate more thrust, and the wings can generate more lift. When the air is less dense, you get less thrust and lift. Doesn't matter why the air is less dense; air decreases in density as you climb, and the air becomes less dense as you heat it. It makes sense in a pilot's head to think of this in terms of altitude on a standard day. The most average weather is 15 degrees C and 29.92 in. Hg, so we compare all weather to those conditions and calculate aircraft performance based on those conditions. On a very hot day, we'll do a calculation which tells us what altitude it feels like we're at on a standard day, and that makes intuitive sense to pilots. "Normally this runway is at 1,000 feet, but today it feels like it's at 3,000 feet." Takeoff and landing performance, ability to climb, and true airspeed are calculated from density altitude.

[–] sxan@midwest.social 1 points 3 hours ago

Dude(tte). I don't know if pilots ever giggle about this, but

controlled flight into terrain

I know it's the official, correct term, but still. Every time I see this, it cracks me up. The euphemisms that organizations come up with to either be extremely specific, or avoid using emotionally charged words like "crash" is hilarious.

Excellent, informative post.

[–] AnarchistArtificer@lemmy.world 3 points 15 hours ago (1 children)

Thank you for the learning! Before this thread, I didn't know enough about altitude to care about this question, but now I'm like "neat! Cool learning!".

On a similar vein, there's indicated airspeed, calibrated airspeed, true airspeed, and ground speed. Aviation comes with a hard requirement of 5th grade math.

[–] abacabadabacaba@infosec.pub 32 points 1 day ago (1 children)
[–] guillem@aussie.zone 4 points 1 day ago

I love this, thank you.

First I just want to say, that is a damn beautiful website. No ads, no popups, just pure information.

And second, as a former back end developer who has spent a huge amount of time working on input sanitization and building database schemas, that list gave me mild PTSD for a job I have never even had.

[–] Windex007@lemmy.world 30 points 1 day ago* (last edited 1 day ago) (1 children)

I'm in fintech and honestly I wouldn't have made any of these assumptions... Because I've long ago given up on the idea that any real world system is anything better than loose heuristics.

Like, I could be pleasantly surprised at some point... But honestly even if a PO swore up and down that something was "certain" I probably wouldn't even believe them.

I'm also surprised that they didn't mention that a flight could arrive on a calendar day before it departs.

[–] Maalus@lemmy.world 4 points 22 hours ago

"our customers are so used to this rounding error that fixing it now would lead to more problems than them fixing it every time the situation arises"

Holy crap I thought that financial systems are bulletproof till I actually worked in fintech.

[–] adhocfungus@midwest.social 8 points 1 day ago

Yeah, I gotta admit I definitely assumed most of those things would be true. I knew it could be messy, but I didn't realize it was such a loosely bound garbage heap.

[–] dparticiple@sh.itjust.works 11 points 1 day ago (2 children)

That was fascinating. Ditto the link in the post to the article on names, which they cited as inspiration for writing it: https://www.kalzumeus.com/2010/06/17/falsehoods-programmers-believe-about-names/?ref=flightaware.engineering

[–] guillem@aussie.zone 3 points 1 day ago (1 children)

There are also lists for time and date and for phone numbers. It's an article format that I love because it gives you a lot of insight into a topic even if it's not your field of knowledge.

[–] AnarchistArtificer@lemmy.world 1 points 15 hours ago (1 children)

Although I recall that some of them don't include links to explanations or info about the falsehoods; I like that this aviation one did do that.

[–] guillem@aussie.zone 1 points 15 hours ago

Yes, met too, sometimes I'm not able to work out the counterexample by myself.

[–] Colloidal@programming.dev 1 points 1 day ago

That is a classic, one of which I sadly expedienced personally.

[–] sartalon@lemmy.world 4 points 1 day ago

Fun fact: USN Aircraft Carriers have their own ICAO code.

[–] ulterno@programming.dev 0 points 22 hours ago

At this point, for all durations, use

struct Duration
{
 bool sign;
 uint128_t num;
};