News for hackers. Stuff that matters.
Re:Writing Software to Last 50 Years by LeoPanthera on Tuesday January 14, 2020 @03:56PM (#22049162)
HN on most days seems to really hate the concept of shell scripts but I have a lot more confidence that a bash script will still work in 50 years than a Python program will.
Re:Writing Software to Last 50 Years by flukus on Tuesday January 14, 2020 @10:11PM (#22051472)
Not to mention the dependencies. Most of the "dependencies" of bash scripts are widely used unix tools or other scripts which are generally fairly stable. The python I've been exposed to (I don't know how typical this is) uses random pip modules that are already deprecated and will never be upgraded to python 3, if pip itself even exists and is compatible with packages made today.

To know if something will work in 50 years you have to look at the weakest links and that's not necessarily the language.

Re:Writing Software to Last 50 Years by carlmr on Tuesday January 14, 2020 @05:30PM (#22049903)
In 50 years anybody that speaks English will still be able to understand the python script though. Bash? Not so sure if it went out of style.
Re:Writing Software to Last 50 Years by CJefferson on Tuesday January 14, 2020 @05:36PM (#22049952)
If you wrote a python script a few years ago in Python 2 it isn't supported today, never mind in 50 years. When Python 4 rolls around some time in the next 20 years, all your Python 3 code will break.
Re:Writing Software to Last 50 Years by carlmr on Thursday January 16, 2020 @04:47AM (#22063028)
That's missing the point. No matter if it's Python 2, 3, 4 or 5. It's so easy to read Python, that you will understand the script without effort. And even if there's no interpreter around you can just port it in a few minutes to whatever language you're using now.

If in the meantime Bash has fallen out of favor, have fun identifying what all these cryptic commands do, without having an interpreter available to check your assumption of what it's doing.

Yes, granted, Bash is more likely to stay, since it has stayed for a long time now. But given a future where there's neither Bash nor Python anymore, I'd prefer porting the Python script.

Re:Writing Software to Last 50 Years by lmm on Wednesday January 15, 2020 @02:39AM (#22052384)
> If you wrote a python script a few years ago in Python 2 it isn't supported today, never mind in 50 years.

But I'd sooner port a Python 2 script from a few years ago to Python 3 than try to understand a Bash script from a few years ago.

Re:Writing Software to Last 50 Years by einpoklum on Wednesday January 15, 2020 @04:38AM (#22052914)
1. But you won't need to port the bash script, it'll likely just work.

2. Bash is not that complex of a language; it mostly just has somewhat arcane shorthands, like `$@` and `-n` and such. So, yes, you need the manual, but it's not a lot of mental effort.

Re:Writing Software to Last 50 Years by lmm on Wednesday January 15, 2020 @07:14PM (#22060361)
> 1. But you won't need to port the bash script, it'll likely just work.

Well, Python 2 code will likely just work too.

> 2. Bash is not that complex of a language; it mostly just has somewhat arcane shorthands, like `$@` and `-n` and such. So, yes, you need the manual, but it's not a lot of mental effort.

If you're only counting bash qua bash then yes, but in practice most of the logic of a "bash script" will be in (non-standardised) commands that are invoked from it rather than the script itself.

Re:Writing Software to Last 50 Years by lexpar on Tuesday January 14, 2020 @06:38PM (#22050369)
Pretty sure the Python developers have stated no more backwards compatibility breaking changes...

Certainly with Python being one of the top languages in the wold today, the pressure to support backwards compatibility is much higher than it was back in 2007.

Re:Writing Software to Last 50 Years by CJefferson on Wednesday January 15, 2020 @12:40AM (#22052005)
Honestly, I really hope so, but the break has been so painful my attitude is I can't risk a second break and such treating users in a (to my experience) unprecedentedly bad way.
Re:Writing Software to Last 50 Years by shpx on Wednesday January 15, 2020 @01:28AM (#22052146)
The people that have yet to learn Python outnumber those that have at least 10 to 1, and hopefully even more. Those people should get to learn a more perfect language. They shouldn't need to know any history about its development for things to make sense and be predictable. It's a little selfish to complain just because you aren't the one reaping most of the benefits.

We are in the very infancy of computer programming. Computers will likely be around for centuries, maybe even thousands of years. The best time to remove historical baggage and get everyone to switch was 10 years ago, the second best is now. IPv6 shows that if you "treat users nicely" you might not live to see the results.

And obviously we benefit too because we get to use a better language.

Re:Writing Software to Last 50 Years by CJefferson on Wednesday January 15, 2020 @02:41AM (#22052390)
There are huge number of python programs which will shortly got very difficult to run. Perl still supports v5, in most cases it is easy to run old Java, C, C++ and Haskell code (in my experience). Python is unique is working extremely hard to kill off an older version, going as far as threatening to sue anyone who tries to keep it running.

I don't believe it would take that much work to keep python 2 in maingence mode, and I also think if the PSF asked for a company to officially take over they would easily find one.

Re:Writing Software to Last 50 Years by zzo38computer on Tuesday January 14, 2020 @11:09PM (#22051691)
But the English languages also change over time. (I think Latin is less changing though these days, although they do continue to add new words, I think old words remain the same.)
Re:Writing Software to Last 50 Years by einpoklum on Wednesday January 15, 2020 @04:36AM (#22052904)
In 50 years they might be speaking Chinese though.
Re:Writing Software to Last 50 Years by carlmr on Thursday January 16, 2020 @04:54AM (#22063076)
我想你写的不错,但是我觉得学中文比英语太难。所以将来很少的人学中文。
Re:Writing Software to Last 50 Years by fock on Tuesday January 14, 2020 @04:35PM (#22049476)
currently you can build a recent Python with a pretty old, standard C-environment. You can even build a lot of the "classic" packages upon that. So I guess that will work as well.

Things like pytorch (I only want gcc-7.3.1) and tensorflow (I want JAAAVA) won't be so resilient obviously.