Live data from Hacker News

Why are there both TMP and TEMP environment variables? (2015)

devblogs.microsoft.com

71–80 of 102 posts

Re: Why are there both TMP and TEMP environment variables? (2015)

#71
post #64

Earlier quoted context omitted.

If people just followed the XDG Base Directory Specification, config file littering would be a non-issue. More and more projects adopt it, even holdouts like Firefox.

I don't see much difference between a program littering in ~/.app versus littering in ~/.config/app, ~/.local/share/app , ~/.local/state/app and ~/.cache/app

The difference is big. I want my home directory to be clean, whereas .config is meant to be littered.

Re: Why are there both TMP and TEMP environment variables? (2015)

#72

Earlier quoted context omitted.

I don’t mind ~/.* for config, especially when the config is just one or two files. What I don’t like is programs like go and cargo treating my $HOME as a dumping ground for every file they want to download and/or cache.

In general, I find it unacceptable for programs to use (anywhere in) my file system, besides /tmp, as a dumping ground for their caches and downloads, without cleaning it up.

> In general, I find it unacceptable for programs to use (anywhere in) my file system, besides /tmp, as a dumping ground for their caches and downloads, without cleaning it up.

/tmp must be world-writable and for multi-user or multi-tenant systems it becomes a security hole. Storing temporary files in the current user's home directory (or a subdirectory thereof) makes sense.

What doesn't make sense is this blog post about TMP and TEMP, and ending with "I don't know why" (in different words).

The reason is simple: different programmers thought the other name was bad. They were under no obligation to come to a consensus.

Don't forget about TEMPDIR and TMPDIR! Also Windows has its own environment variables for this. But generally, Linux software ported to Windows still use TMP or TEMP.

Re: Why are there both TMP and TEMP environment variables? (2015)

#73

Earlier quoted context omitted.

Multics had envars in the 1960s and Unix in the 1970s, why were they ‘added’ to DOS when it was so close to an older OS, why didn’t it inherit them from CP/M? Did it get TMP from CP/M and introduce TEMP because computers were bigger but then?

Those questions appear awfully overfit to the current blog post.

That comment feels awfully cherry-picked to the perfect untestable rebuttal based on what you want to be true.

How did you measure the fitness and decide it was 'over'?

Re: Why are there both TMP and TEMP environment variables? (2015)

#74

Earlier quoted context omitted.

I don’t mind ~/.* for config, especially when the config is just one or two files. What I don’t like is programs like go and cargo treating my $HOME as a dumping ground for every file they want to download and/or cache.

In general, I find it unacceptable for programs to use (anywhere in) my file system, besides /tmp, as a dumping ground for their caches and downloads, without cleaning it up.

[deleted]

Re: Why are there both TMP and TEMP environment variables? (2015)

#75

Environment variables on *nix are ... strange. I noticed this first when I assigned TZ to .tar.xz (or .tar.gz) as I was lazy. Then things suddenly no longer worked. Turns out TZ is ... timezone. So you should not define all variables, right? Well ... how to know that? People can perhaps read tons of documentation, but I want to ... minimize time investment here. So I learn mostly by learn-and-doing. And as far as I k…

I use lowercase for my personal environment variables. It works well since most programs only depend on variables in all caps. Hadn't thought of using MY_

Case-sensitivity reduces portability. "Different strokes", I guess. (literally and figuratively!)

Re: Why are there both TMP and TEMP environment variables? (2015)

#76
post #71
post #64

Earlier quoted context omitted.

I don't see much difference between a program littering in ~/.app versus littering in ~/.config/app, ~/.local/share/app , ~/.local/state/app and ~/.cache/app

The difference is big. I want my home directory to be clean, whereas .config is meant to be littered.

I don't have strong feelings one way or the other, the files are hidden so out of sight out of mind for me.

I don't disagree that it would be cleaner if things were more organized, but I definitely prefer something more like that the person you replied to said, ie "~/.xdg/foo/{config,share,state,cache}"

The only XDG folders that seem reasonable to me are .local/share/fonts and .local/share/applications, and I think both of those are still just conventions, not actually described in any spec.

Re: Why are there both TMP and TEMP environment variables? (2015)

#78
I have been pointing out these annoying things for decades with Microsoft. It’s funny because the “senior dev” know it all there person always used to have an answer. “Heh you see temp stands for temporary. Tmp stands for troubleshoot my pc. For debug logs. That’s why I’m a senior and you’re not.”

As I’ve gotten more senior turns out I was right to question it and we can actually talk to the original Microsoft devs now and they explain the whoopsie and how they had to keep it for backwards compatibility.

So then I ask why that excuse is valid, backwards compatibility, when many changes are frequently breaking core compatibility and active business flow (like New Outlook) and they go full hands off. Whoah I’m not the bad dev you’ll have to ask the new guys.

You can’t ask the new guys. And they’re hiding behind leetcode screens. It’s no wonder why these real problems don’t get fixed and we have new outlook. It’s the senior dev from earlier who now works there. All the real devs are retired.

Even when I do get a real answer from Microsoft on annoying things like the user home documents folder being used inappropriately by random programs or straight up forcefully deleted by onedrive in an oopsie, their answer they senior dev invented to give me or go on length about in a technical document or angry interview online is invalidated within 6 months when Microsoft just vibe pushes a random change that randomly alters how these things work in both not a good way and it invalidates their entire core argument.

Just like notepad updates as another example off the top of my head. There are dev interviews talking about how this is a very simple program because it needs to be 0 risk. Then it gets a Microsoft auth login with copilot.

The whole leetcode dev attitude and Microsoft culture really ruins the entire industry. We can’t have civil discussions. Everything turns into Nuh uh your argument is invalid because you don’t work at Microsoft.

Google Chrome famously having chrome install into appdata to exploit and bypass admin rights is a core memory. That’s clearly not the actual intention of that feature for 3rd parties to use in order to bypass having administrator authority. But now this is retconned by the devs as an intended feature because chrome ended up being good at the time at having to sort out the mess of deploying a 3rd party exception program on millions of locked down business computers would’ve been a nightmare.

Re: Why are there both TMP and TEMP environment variables? (2015)

#79
post #78

I have been pointing out these annoying things for decades with Microsoft. It’s funny because the “senior dev” know it all there person always used to have an answer. “Heh you see temp stands for temporary. Tmp stands for troubleshoot my pc. For debug logs. That’s why I’m a senior and you’re not.” As I’ve gotten more senior turns out I was right to question it and we can actually talk to the original Microsoft devs n…

[dead]

Re: Why are there both TMP and TEMP environment variables? (2015)

#80
post #27

Earlier quoted context omitted.

The line between "configuration" and "modding" is pretty thin. One could say that the difference is whether the developers intended the changes you're making to be possible or not, but what about programs with dedicated modding APIs?

At the time (early to mid 1980s) I think we would say "patching". The Wordstar devs certainly did mean you to do this - the memory locations available were fully documented, and I seem to remember they supplied a small patch utility to incorporate your code into the Wordstar executable.

I remember the words "peeking" and "poking", but this may have been specific to basic.
Post reply on HN