6 ms·
I'm confused about the compatibility X for Python. A few years ago, sure, but for an article published a month from now? You write python3 and it's installed ev
by jefftk 4y ago
I'm confused about the compatibility X for Python. A few years ago, sure, but for an article published a month from now? You write python3 and it's installed everywhere.
- culopatin 4y agoIs it available in windows by default?
- recycledman 4y agoI'm sorry but my windows doesn't have Perl by default either perhaps I misunderstood your comment :)
- gkbrk 4y agoYou probably have it if you have Git Bash installed. Perl is a dependency of Git IIRC.
- recycledman 4y agoThen it's not by default right? I must have git installed !
- tankenmate 4y agoThe first versions of git were written in Perl (with some small speed sensitive parts written in C).
- culopatin 4y agoIt was a simple question. Author claimed it’s found everywhere, but if it’s not installed by default im not going to find it in enterprise environments
- deleted 4y ago[deleted]
- roblabla 4y agoNo, but then neither is perl. On windows you've got powershell, batch, VBScript and JScript pre-installed.
- midasuni 4y agoIs Perl?
- koito17 4y agoNo, but Perl at the very least is available on the latest versions of Mac OS. Python is not. So as far as "being bundled with the latest OSes" goes, Perl beats Python. NOTE: I am (probably mistakenly) assuming that Perl is still bundled in most Linux distros by default.
- OJFord 4y agoPython is available by default in macOS. Not latest version python, but available. (Both 2 & 3 I think, or maybe they've dropped 2 now.)
- koito17 4y agoA minor update of macOS Monterey[1] removed /usr/bin/python, but /usr/bin/perl still exists. Xcode's Command Line Tools will install Python 3, but I do not count as being bundled by default with macOS. Unfortunately, I can't find any Apple documentation to prove this. You'll just have to check with a fresh install of macOS Ventura yourself (or, at your own risk, uninstall Xcode and/or the Command Line Tools) [1] https://developer.apple.com/documentation/macos-release-notes/macos-12_3-release-notes#Python https://developer.apple.com/documentation/macos-release-note...
- OJFord 4y ago(Ouch, a minor update!) Oh ok, I stand corrected. I don't currently have any macOS machines.
- OJFord 4y agoIs perl? That's an honest question/honestly surprises me. But honestly installing anything like that (without WSL probably - haven't used it recently) on Windows is painful, it's not python's fault, it's just a different paradigm. Run with a different environment variable for example.
- worik 4y agoLast install of Windows 11 I did (triggering) Perl was installed by default
- xupybd 4y agoIt is not installed by default on any of the systems I work with. We have around 10 office staff that all use windows, and 2 windows servers. No Perl by default on any of them. To the best of my knowledge you must install one of two main distributions of Perl for Windows. https://www.perl.com/article/downloading-and-installing-perl-in-2021/ https://www.perl.com/article/downloading-and-installing-perl... You can also use WSL. Edit: It sounds like, from other comments, that Perl comes with Git Bash as well.
- ElectricalUnion 4y agoAre you sure it is "installed by default" or it happens to be inside WSL? Because WSL is not the default.
- prosaic-hacker 4y agoI believe not now but Perl 5.004 was installed on Window NT (3.5 or 4) by default. That made the case for its use on project that could not afford the IBM AIX or Silicon Graphics systems we were using at the time. We used Netscape Fasttrack as the server.
- actionfromafar 4y agoWait what no?! NT4 was released in 1996. And Microsoft touching Open Source without ten foot poles back then also feels wrong.
- HeckFeck 4y agoPerl was used as part of the Windows XP build process, if you know where to look. It might have been used in NT4 as well.
- gattilorenz 4y agoSure, but it's not "installed by default" in either of them.
- HeckFeck 4y agoI wonder if that was ever considered as a possibility at Microsoft. They had proven the camel was capable with Win32 stuff in their build process. Maybe it was considered technically by some of the programmers, but swiftly quieted by PMs.
- burnished 4y agoEugh, no, they've just got a little thing so you'll go to the microsoft store to download python when you search for it from the start menu, seem to recall it giving me some cryptic hell with making pip difficult to find. Bastards.
- pavon 4y agoPerl is mostly forwards and backwards compatible (or less generously it has frozen). Python is backwards compatible, but continues to add new features, and some packages are rather enthusiastic about adopting these features quickly, and ending support for older versions of Python. It isn't as bad as other language communities (I'm looking at you Rust), and I would have at least given it an asterisk, but it certainly isn't as stable as Perl.
- gpvos 4y agoPerl does add new features, but if your program has use v5.30; at the top, and a library has use v5.22;, or the other way round, it will work.
- t-3 4y agoPython isn't actually everywhere by default, but neither is perl (but perl at least is usually named perl, while python may commonly be python or python3). Neither is consistently in the same location and shebang issues are pretty common. If script portability is actually a concern, /bin/sh is still the best way to go.
- tankenmate 4y ago#!/usr/bin/env perl is the usual way to fix this. Far more common is running into UTF-8 problems, but using the usual -CSDL and the UTF-8 open default handles the issues.
- superkuh 4y agoPython's dependency hell due to changes between versions in both modules and core is so bad there's even a python dependency manager hell of chosing which env wrapper or containerization you're going to use because the system python sure as hell won't work. And if you do have the gall to update a system python package system stuff will break. Whereas with perl the system libraries will work, no need for containers. Python's popularity hurts it for use when you want compatibility. Containerizations can only mitigate this so much.
- jefftk 4y agoIf you write to the (very extensive) standard library, though, none of this is an issue.
- DonHopkins 4y agoJust forget all about all that virtual environment crap, globally install a modern version of Python in a Docker container, and take full advantage of its latest features. I couldn't remember the title of this memorable talk, but ChatGPT could: Q: In which talk by David Beazley does he recommend writing new Python code that takes full advantage of the language's new feature, without worrying about making it backwards compatible? A: David Beazley is a well-known Python expert who has given several talks on various aspects of the language. However, one of his talks that emphasizes the importance of taking advantage of new features in Python, without worrying about backwards compatibility, is "Python 3 Metaprogramming". In this talk, which was delivered at PyCon 2016, Beazley highlights the benefits of using Python 3's new metaprogramming features, such as type annotations, function annotations, and asynchronous programming. He argues that these features can make code more concise, readable, and maintainable, and that developers should not be afraid to use them, even if it means breaking backwards compatibility with older versions of Python. Beazley's message is clear: by taking advantage of new language features, developers can write more efficient, expressive, and scalable code, without worrying about the limitations of older versions of Python. Q: Give me a link to that video. A: Sure! Here's the link to David Beazley's talk "Python 3 Metaprogramming" at PyCon 2016: https://www.youtube.com/watch?v=sPiWg5jSoZI https://www.youtube.com/watch?v=sPiWg5jSoZI I hope you find it informative and helpful! Q: What are his arguments for not worrying about backwards compatibility? A: David Beazley's main arguments for not worrying about backwards compatibility in his talk "Python 3 Metaprogramming" are: 1. New language features can make code more expressive and efficient: Python 3 introduced several new language features, such as function annotations, type annotations, and asyncio, that can make code more concise, expressive, and efficient. By using these features, developers can write cleaner, more readable code that is easier to maintain and debug. 2. Older versions of Python can be managed through virtual environments and package managers: Developers can use tools such as virtual environments and package managers to manage different versions of Python and dependencies. By isolating different versions of Python and packages, developers can ensure that their code works correctly on different platforms and environments. 3. The community will eventually move to newer versions of Python: As more developers adopt newer versions of Python and start using the latest language features, the community will gradually move away from older versions of Python. This means that eventually, the majority of users will be using newer versions of Python, making backwards compatibility less of an issue. 4. Code refactoring tools can help with compatibility issues: There are several tools available that can help with code refactoring and modernization, such as 2to3, which can automatically convert code from Python 2 to Python 3. By using these tools, developers can make their code compatible with multiple versions of Python without having to sacrifice the benefits of newer language features. Overall, Beazley's argument is that developers should not be afraid to use the latest language features in Python 3, even if it means sacrificing backwards compatibility with older versions of Python. By doing so, developers can write cleaner, more efficient code that is better suited to modern software development practices.