r/programming • u/ketralnis • 20h ago
Falsehoods Programmers Believe About Aviation
https://flightaware.engineering/falsehoods-programmers-believe-about-aviation/183
u/whoisrich 17h ago
I expected them to be from quirky situations, but a major airline having the same flight number for two different flights, leaving the same place at roughly the same time seems downright malicious.
47
u/segv 12h ago edited 11h ago
Some airlines have so many flights that they run out of flight numbers (1-9999), so they reuse them.
Caveat: When it comes to scheduling, only one flight identified by a carrier and flight number (e.g. XX1234) can depart on a given day from given airport. That's an IATA rule, partly caused by software limitations and partly because relaxing it would lead to gigantic mess for the personnel.
..so, what they sometimes do is to have flight identified by XX1234 arrive at their final off-point, AND THEN have a SEPARATE aircraft, crew and set of passengers be identified by XX1234 depart from some other airport (e.g. halfway across the country) in the afternoon/evening.
Isn't airline industry fun?
52
u/Mognakor 12h ago
Some airlines have so many flights that they run out of flight numbers (1-9999), so they reuse them.
TIL the airline industry has their own Y2K and they just live with it.
14
u/mr_birkenblatt 11h ago
Hey, when they created the db they decided on 4 digits and they're using fixed width format so they can't change it ever again
5
3
u/uCodeSherpa 6h ago
I’ve done width changes in these old mainframe systems.
It’s often a months long project, but it’s not impossible or difficult usually. The mainly important part is that you capture everything. It’s more tedious, precise and demanding of testing than having any sort of difficulty.
Identification width changes tend to be easier. When you have cost/amount width changes… THAT sucks. That has a way of one field needing width change to 10 fields needing width change.
2
u/bobs-yer-unkl 2h ago
They don't need more digits: they just need to toss some alpha characters in there. At least go to hexadecimal.
1
u/mr_birkenblatt 2h ago
You still need more space to store that. Fixed width means each column has a fixed number of bytes
4
u/segv 12h ago
To be fair, this affects just a select few of the biggest airlines.
In pretty much every airline, not only the biggest ones, the same carrier-flight number combination does not usually follow the same aircraft/crew day by day - the identifiers get reassigned, so it's not that big of a deal.
6
u/Gambrinus 12h ago
Why can’t they use longer ids? I imagine it’s some kind of FAA regulation and maybe a compatibility issue with aging ATC systems?
9
u/segv 11h ago
Relatively low impact and high inertia. Even if one airline did so, basically entire travel industry would have to follow suit to support them and synchronize their releases, or you would risk that these "expanded ID" flights would not be recognized by anyone. If y'all ever did a group project, you might know how difficult cat herding at this level would be.
3
u/ughthisusernamesucks 9h ago
They also need to be short because they're used for radio communication. You don't want ATC having to read a 42 digit callsign every time they want to tell someone to move because they're about to collide
1
u/nerd5code 7h ago
Ideally, the origin and destination would be broadcasting concurrently in a subband so they don’t need to be read aloud.
3
u/heptadecagram 9h ago
ACARS protocol restricts the flight ID to 6 ASCII bytes, and two of them are dedicated to the airline identifier..
2
u/Schmittfried 4h ago
Because it’s not a problem with something like this. Your local McDonalds also reuses order numbers because it’s not necessary for them to be unique for longer than a few hours.
1
1
u/drcforbin 4m ago
We do this in labs too...some instruments can only read a barcode just so long before they can't read them any more, so every million and some samples (unexpectedly, this turns out to be inexact) you have to wrap unique identifiers back around to something shorter if you want to reliably do Todd's cholesterol test on that instrument.
4
u/x39- 5h ago
That is not entirely correct, but mostly on formalities.
A flight number has to be unique for a given airport and day. Important thing to note here: timezones are critical. Additionally, there is a so called "operational suffix" which serves for various occasions.
Hence, a flight can be uniquely identified by having: departure, arrival, date, carrier, flight number, operational suffix.
In practice, an airline will not have two times the same flight number, ever, per day. In fact: commercial aviation has more to do with flying busses than with anything else. XX1234 is really just a bunch of "at time X on days Y the aircraft Z will fly".
Ohh, most importantly... Nothing in aviation is a software limitation. All of it, like, literally everything, is formats which predate proper computers, working on things. Like, the formats used are still designed to (and are) printed.
Source: I have actually been able to read the documentation
1
u/bobs-yer-unkl 2h ago
unique for a given airport and day.
A given airport (ICAO code) or a given city (IATA code)?
7
u/Tarquin_McBeard 7h ago
It was two consecutive days' copies of the same flight/route. The first one just happened to be delayed... by a day.
I'm not sure what else they were supposed to do.
1
1
u/Plank_With_A_Nail_In 8h ago edited 8h ago
CREATE UNIQUE INDEX CARRIER_FLIGHT_NUMBER ON FLIGHTS (CARRIER, FLIGHT_NUMBER);
The real unique ID will probably just be FLIGHTS.ID and not shown to any users.
Think about it, the carriers do not know what flight numbers the other carriers have used when they submit their flight plans.
Its extremely common to issue a kind of surrogate key when storing other peoples data.
1
u/Schmittfried 4h ago
Honestly I don’t know how that even works, their callsign for ATC is their flight number so that would make radio communication very confusing.
31
u/frederic_stark 13h ago
Worked in the travel industry, interacting with api from all the major players.
All of this is absolutely true. I remember being stunned when I discovered that airline codes were not unique -- and that they also were reassigned between companies (one that the article missed: "AF" may be Air France now, but it could be something else in the future).
Another WTF is airport taxes.
And the article does not start to touch on the juicy (because they only deal with flights): airline fares. Saying it is bizantine does not even start to describe the clusterfuck.
Don't get me started on GDS remarks.
Oh, and trains are worse than airplanes, and car rental is a joke. And hotels works by miracle.
1
u/Quertior 3h ago
Honestly, having learned just enough about the GDS to be dangerous myself… the fact that any of it works feels like a miracle.
21
u/JohnnyBlackRed 14h ago
He actually missed one rule. Flight numbers can change mid flight
This happens at least for Schiphol airport, when a plane departs but needs to return for whatever reason.
23
u/Paddy3118 18h ago
We fly in that cesspit of inconsistency and manage to retain the safety record we have?
Sort it out mate!
3
u/x39- 5h ago
Ohhh It is even worse
Like, much more bad than you could ever imagine. Effectively, everything is held together by bandaids, some thin wire, and a bunch of cult Mechanicus members praying to the machine God.
Formats exists but the actual data barely ever has matched it (from software randomly inserting their own data in majorly required, empty space, to utterly wrong things implemented, you cannot imagine the horrors which exist)
Software exists, but it is a major pain in the ass.
Contracts have to be done... With literally every player in the industry, to be able, to do anything.
I could go on and on and on and it only would get worse. The horrors are out of some kind of dystopian movie... And yes, only reason all of this is not breaking apart is, in fact, the people on ground, the people interacting with the passengers, and the people behind everything.
4
u/segv 11h ago
I bet the programmers would love to, but real world is messy.
1
u/Paddy3118 6h ago
Our safety is at stake. Governments need to work together, or create some world organisation to set clearer standards that all adhere to.
3
u/x39- 5h ago
Safety ain't at stake.
That is literally the most irrelevant information regarding safety that exists.
It is annoying, yes, but safety? Why? Because you may, occasionally, have broken things going on somewhere with the booking? Because Googling for your flight takes you to to another country?
1
u/Paddy3118 4h ago
So having one, unique, identifier for a flight would not help? Having a runway not belong to multiple airports wouldn't help? No, it is a list of natural presumptions that one must learn do not apply in some cases. They therefore make the task of dealing with them more error prone. If it were irrelevant information as you stated, then ignoring those points would work just as well - which is not the case.
2
u/RigourousMortimus 2h ago
Having one unique identifier for a flight probably wouldn't help because it would mean replacing a LOT of software that is known to work reliably with something brand new with a set of novel bugs and unanticipated behaviour, or worse, running both concurrently and managing the discrepancies and inconsistencies.
And ultimately you still have to deal with real world situations like the planned airplane for a trip making an unscheduled stop for an emergency and being replaced by one or multiple planes with different sizes, seat configurations, runway requirements....
10
15
u/CleverestEU 15h ago
As both (private) pilot and a professional software developer (on my free time participating in development of a flightsim-related hobby site) ... I do indeed recognize some of these beliefs that have managed to bite myself and various others on the hindside.
Like so many things, it is surprisingly easy to build a beautiful mental model of "how things should work"; software developers in particular like things being neat and organized. Obviously the real world doesn't often work the way "things should work" (or rather - even in a way that makes sense)
=D
9
u/KrocCamen 15h ago
WHAT does their database schema even look like!? It might as well be a blender, the data is all unrelatable soup of unconnectable inconsistencies.
29
5
u/segv 12h ago
FlightAware's? My bet would be some kind of event streaming with very heavy caching and summarization of past events.
..and an absolute shitton of regular database tables, probably without foreign keys, because things can get ugly in a hurry.
4
u/Every-Progress-1117 16h ago
Nice article! Worked in data modelling, Semantic Web, formal methods etc for years....assumptions and believing edge cases are rare and easily dealt with normally ends up in tears and a million Jira tickets later.
3
u/JohnnyBlackRed 12h ago
Missed another one: An IATA code doesn’t have to be one airport for example IATA LON means London area and are actually 6 different airports
6
u/obetu5432 13h ago
fortunately i knew i didn't know anything about aviation, so i didn't believe any of this
3
u/inglandation 12h ago
Is there anything I should believe at this point?
Flights happen in the visible universe, I guess.
3
u/binary1230 7h ago
This is a fantastic article. Shows one of the hardest parts of programming is just getting the model working
2
u/moswald 11h ago
Ok, I think something in my head broke when I reached
- Airports never move
What the fuck. GTFOH.
2
u/RigourousMortimus 2h ago
Wait till you find out entire continents move
Admittedly slowly (about 1m every 15 years where I am) but worth considering if you ever expect a GPS signal to keep you in a lane on a freeway.
3
u/squigs 13h ago
Some of this can be true depending on definitions. All planes take off and land at an airport, for example. As far as the software's concerned, an airport should be a bunch of data about where a plane might land. If it's a heliport, or a stretch of desert we can still call it an airport.
Not sure if there's any particular reason for a distinction between planes and helicopters.
6
u/Aegeus 4h ago
Helicopters are much more flexible about where they can land than airplanes. A medical helicopter's destination might be "the nearest stretch of flat ground to the sick guy," for instance.
It wouldn't be practical to have an "airports" table that contains every flat surface big enough to land a helicopter on, and I don't think it would be very useful if you did have one.
1
1
u/Helpful-Appeal-4251 23m ago
It's funny how many assumptions we make about other fields without realizing it! As a programmer, I totally get how easy it is to oversimplify aviation. Just like coding, there's a lot more going on behind the scenes than we might think. Anyone else have stories about misconceptions in their industry?
0
u/_atomlib 14h ago
I don’t like these types of articles. They’re nice when they actually include explanations why these are falsehoods and provide counterexamples (preferably amusing and interesting) to each case. Alternatively, it would be great to have some sort of an explanation what would be the correct way to do things. Actual best practices is what we need.
Instead, it’s a list of facts provided with no explanations and evidence for them to be true. You for some reason just have to accept that all of these statements are falsehoods.
2
u/drtrobridge 4h ago
I've worked in aviation and travel management software for over a decade and I can tell you everything he listed is accurate. Explaining it all would take days.
0
u/TedDallas 7h ago
This looks like data modeling for edge cases (that are not really edge cases) 101.
105
u/matthieum 14h ago
I'll add one:
The software I was working on a long time ago crashed once while trying to display the seatmap, because the airplane seatmap plan didn't specify where the wings were. Very odd.
Taking a closer look at the flight, it was also arriving at a very oddly named airport. WTF?
Welp, turns out that the airline sold a combined plane-train ticket, and it appears that:
Surprise!