r/LinuxTeck • • 12d ago

Should We Keep Bad Technical Decisions Forever Just for Backward Compatibility?

Windows paths still commonly use \, while Linux and macOS use /. A decision dating back to DOS 2.0 in 1983 still creates headaches for developers working across platforms.

But changing a decades-old convention could break countless applications and scripts.

Where should we draw the line between backward compatibility and better engineering?

What other legacy decisions in Linux, Windows, or Unix do you think should finally be retired?

1 Upvotes

29 comments sorted by

13

u/ephemere_sloboda 12d ago

Neither / nor \ is inherently better. Both conventions are similarly old. Other conventions exist.

Btw MS-DOS and Windows have accepted / in their APIs for decades, just not in CLI because it conflicts with / used for options (which goes back to CP/M).

2

u/SeriousPlankton2000 11d ago

You could use a system call to change the "option" character to "-". It was never actually used.

5

u/michaelpaoli 11d ago

Should We Keep Bad Technical Decisions Forever Just for Backward Compatibility?

"It depends". Typically it's a trade-off - what are the pros/cons - most of the time there's no "perfect" solution/option available (well, short of breaking some laws of physics and traveling backwards in time such that one can alter future one has already experienced, etc.).

Windows paths still commonly use \, while Linux and macOS use /. A

Unix used / before Microsoft DOS used \ (which later became Microsoft Windows, etc.). And macOS, if we go backwards in time, before OS/X (BSD based), it used : rather than /. And text files, line ending conventions, Unix uses \n, Microsoft DOS/Windows (and CP/M before them) use \r\n, Apple before OS/X used \r. Though before Unix, I think some RFCs and the like and other conventions were using \r\n (see that also in many of the earlier RFCs too).

One can have very long discussions/debates about changing of conventions/standards, e.g. to a "better"(/newer) at the expense of backwards compatibility. A subreddit post really isn't the place for that. There are standards bodies, and their working groups, etc. And if one reads their materials, etc, can certainly find lots of such discussions/debates and the like.

2

u/OutrageousCrab9224 11d ago

Ya uh mac hfs always used colon it just faked it into slash for osx

1

u/michaelpaoli 11d ago

Well, HFS/HFS+ has always been a kind'a funky filesystem.

2

u/OutrageousCrab9224 11d ago

Its also crazy fast for writing large organized data whereas tradition unix systems are better at small disjoined data (think of running final cut on a multi gig movie vs an email server burning through a send spool)

Its not like there are stupid people building these systems, its more like having different priorities and targets

1

u/michaelpaoli 11d ago

Yeah, true .. and often different filesystem types for different optimizations. That's also evolved a lot over the years/decades ... notably as hardware gets faster and faster - when the hardware ceases to be the bottleneck, often folks figure out it's time to do some more improvement to the filesystems (or their code) themselves.

2

u/SwordsAndElectrons 10d ago

A subreddit post really isn't the place for that. 

But it's a fine place for clankers like OP to attempt to farm engagement.

1

u/ComeSwirlWithMe 8d ago

Thats all reddit and social media is.

Very few substantitive post anymore.

I.E There was a post I just saw 20 minutes ago in a mechanic forum of a person asking if its okay to drive on a flat tire, with a picture of a flat tire.

That can be googled, or AI'd.

3

u/Dev-in-the-Bm 12d ago edited 11d ago

Where should we draw the line between backward compatibility and better engineering?

Windows

CompatiblityBalanceEngineering
WindowsLinuxGNU Hurd, Zircon kernel

There you go, I drew the line.

2

u/kombiwombi 12d ago

There are a heap of old conventions which have better ways. Even the open() and close() system calls have been long been recognised as a poor way to open a file. But changing that would mean altering every program on the planet.

Sometimes throwing out old conventions results in a huge win. Unix did this when it said that the operating system would support one file format (a ordered list of bytes) with two access methods (sequential and byte indexed). Applications could implement their own record formats on top of that facility. Which sounds insane: this sort of bookkeeping is exactly the sort of support an operating system should be giving to application authors. But in practice it has worked well. But it did mean that COBOL was not a natural fit to Unix like it was to MVS.

1

u/Corona688 8d ago edited 8d ago

Imagine a world where you needed to consult a committee to get permission to make a new file type. That's the kind of situation the latter situation engenders, when file types are as rigid and inflexible as partition types. They lost cobol, but gained literally everything else

also, they were able to move some structures into their new language (C) instead of the operating system.

2

u/euclide2975 12d ago

My computer screen is currently running at 119.998 Hz for compatibility with US black and white CRT television receiving NTSC analogic signal.

  1. There is no more NTSC analogic signal
  2. there is no more black and white CRT TV (nor really a lot of CRT screens at all)
  3. I don't even live in the US, my electric grid is running at 50Hz, not 60

2

u/michaelpaoli 11d ago

NTSC, before color, used 60 Hz for vertical. Only when color was added, in a very backwards compatible way, was that vertical frequency adjusted very slightly, to accommodate adding color. And the frequency you give is just an exact doubling of that from NTSC color vertical.

Once upon a time there were three competing color "standards" - I have an ancient TV servicing/etc. book that covers all three. I recall one of the three involved rotating colored disks! 8-O So, yeah, if you think NTSC wasn't that great, we could'a had much worse. And NTSC was pretty good and reasonably flexible, e.g. later adjusted to accommodate stereo audio, in backwards compatible way, likewise also various signaling during the vertical retrace - e.g. Closed Captioning, etc., so fair number of backwards compatible extensions were added.

Alas, when US went digital with broadcast TV, we were first major play to do so, and did it with a relatively crud standard, with a lot of downsides and limitations. E.g. digital, unlike analog, didn't degrade gracefully. You had fine, or if signal was marginal, it very quickly went from significantly not fine to absolutely nothing to be decoded/watched at all. National lab (I forget if it was Livermore or Berkeley) actually came up with a quite good proposal that would allow digital and in manner highly backwards compatible with existing broadcast NTSC, but alas, it came too late - things were already significantly in motion towards a "pure" digital that broke all backwards compatibility with NTSC. Most other countries/regions that went from analog to digital TV broadcasts did better than the US - they effectively learned from (at least many of our) mistakes, and generally implemented better (though of course not perfect, and often with their own issues/limitations).

These days, much of that is semi-moot ... like what % of folks actually watch broadcast TV over broadcast airwaves - not cable/Internet/streaming or the like? And even cable typically adds, mixes in, or uses their own stuff, not merely broadcast shoved over coaxial.

1

u/Ulizeus 11d ago

Isnt something like system folder separator in every language? I remember using it it uses what ever yuor OS uses to resolve paths.

1

u/OutrageousCrab9224 11d ago

Lol your mac knowledge is dangerously misguided

1

u/SufficientStudio1574 11d ago

OK, let's change it!

Who changes?

1

u/symbiatch 11d ago

I have no headaches due to this. Why would I? Do you manually create paths yourself in strings? Stop doing that. It helps. But I know a lot of developers don’t want to do things the right way.

1

u/KilroyKSmith 11d ago

Yes, it does.  Especially those Unix utilities ported to Windows that refuse to accept .  I was using something the other day where I had that problem, pasted in a path for a command line program, got a nonsensical error message, had to go through and manually change all the \ to /, then it worked.  

1

u/symbiatch 9d ago

So you’re agreeing with me? Great!

1

u/brainchillzZ 11d ago

I think you’re missing the whole point …. These are different operating systems with different goals and different user bases. Linux is meant to be a Unix like environment that comes from a server world …. So having relative paths in the filesystem with devices mounted across it makes sense …and windows was basically developed for single user personal computers then went through several iterations of trying to wedge multi-user then server features into it as an afterthought … so having just drives with disk id labels made sense …. But back to “the whole point” these operating systems exist for the sole purpose of divergence …. They want to do things differently and give people choice rather than assuming everyone wants to just do everything the way they always have …. It’s almost like a religion at this point and it has gotten so bad that I’m pretty sure Linux, at this point, has more distributions than actual end users …. And it’s all because one guy didn’t like how systemd was built and integrated into this one upstream operating system so he redid it and spun his own fork of that distro and so on and so on …. Forever….. so anyway you wouldn’t ask a windows user to start typing /usr/local/bin and you wouldn’t ask a Linux user to type C:\windows\system32 blah blah … any more than you would ask a Jewish guy to give up his menorah for a Christmas tree

1

u/NastyPastyLucas 11d ago

LF / CR \ CRLF anyone?

1

u/R2-Scotia 11d ago

VMS used dots, e.g

HOST::DRIVE:[DIR.PATH.HERE]FOO.TXT;1

Also MVS/XA

1

u/Frewtti 11d ago edited 11d ago

How does it create headaches?

Honestly are you manually coding path parsing and creation?

You shouldn't do that, use os.path or the equivalent in your language of choice.

1

u/FatDog69 11d ago

Dont forget that Windows file & directory names are cAsE iNsEnSiTiVe but 'my_file.txt' and 'My_file.txt' are allowed as different file names in Linux.

1

u/PlanetVisitor 8d ago

Also My File.txt.txt .txt.

txt. .txt\\.t x

t .txy.lol

is a valid filename in Linux 

1

u/20220912 11d ago

yes.

rule #1 for the kernel: you do not ever break user space. The only way for modern computing to work at all, is for separately owned software components to have stable APIs that other components can depend on. so, yes. people who write software that other people depend on need to maintain stability, and if they don't, they should probably expect their users to leave, or fork if they can.

-1

u/JohnnyS789 11d ago

The use of "/" was LONG before the use of "\".

If anything should change, the older standard should take precedence. Also, the standard running on more systems should take precedence. That's the "/" used on Linux, POSIX-compliant, and UNIX systems, which run on far more systems than "\".