8 ms·
Python is the new Basic
- ddxxdd 2y ago>"Today, there's a different language with ugly historical baggage that enjoys a strong following, *notably amongst people that don't identify as programmers*. *That language is Python*." >"Python is the new BASIC because *Python is the language that non-programmers always seem to use*" >"If even a *Python-hater like me* defaults to using Python, then I think it's pretty clear that Python has taken over the world, just as BASIC once did." 1) As a Python fan, I consider this hate speech. 2) I have yet to encounter a software development kit like Visual Basic that makes it easy to write executable files with a GUI.
- AlexeyBrin 2y ago> 2) I have yet to encounter a software development kit like Visual Basic that makes it easy to write executable files with a GUI. Lazarus with FreePascal is pretty close with its drag and drop way of creating GUIs and it generates executables.
- sombragris 2y agoalso Gambas3 (https://gambas.sourceforge.net https://gambas.sourceforge.net), among others.
- aptenoforst 2y agodoes not support the OS with the most users.
- graemep 2y agoits a lot harder to learn. I just commented on another discussion agreeing with someone who made the same point. If you already know Pascal its probably great, but if you do not its going to take a lot longer to to learn to use it.
- acomjean 2y ago“Hate speech” is usually reserved for speech involving people… can’t tell if it’s sarcasm. I use python, I don’t love it. Don’t really hate it either. You use it because it solves a problem or has a library that makes solving problems easy. It’s ok for people to have different opinions about what languages they like. There is a video where someone asked for people to submit python scripts to control his Christmas lights. It was fun but slightly annoying because over half the programs wouldn’t run ( missing libraries/ tab space indenting mis match). He said we would but he tried to install one of the packages on the fly. It installed, he got the same missing package error on rerun. Sort of matched my experience using python trying to get others peoples code to run.
- hulitu 2y ago> over half the programs wouldn’t run ( missing libraries/ tab space indenting mis match). That is the main problem with python. Basic didn't have "indenting issues"
- pwdisswordfishz 2y ago> As a Python fan, I consider this hate speech. You know, I am not actually much of free speech absolutist, but this is the kind of statement that makes me more sympathetic to them. When they sometimes express the worry that the category of "hate speech" is going to be stretched to cover any sort of dislike or disagreement, I think this is the kind of thing they have in mind.
- VagabundoP 2y agoI'm pretty sure there was a /s missing.
- polotics 2y agoI agree, this is a trash post full of hot stinky air : - name-calling without any actual examples - no actual comparison with Basic, the extremely simplistic "popular" sticker covers massive differences in use, users, functional coverage of libraries, and so on - non-programmers that program use python? this is leveraging python's value as a teaching language in the most derogatory way possible - "ugly historical baggage" ? sure, show me a better designed language, show me the baggage
- muddi900 2y agoYou might be describing Javascript. Which is far more ubiquitous thna python, and a 100 times the design issue.
- beardyw 2y agoIn the last week I have been working with python, JavaScript and C++. Not sure any of them would win a beauty contest.
- arend321 2y agoI guess it depends on the field you're working in. When manipulating strings, await db calls, sort arrays, JavaScript (TypeScript actually) feels very intuitive and concise. But going more low level I can see it breaking apart.
- nmstoker 2y agoAgreed. Whilst we should aspire to language beauty, it's usually trumped by practicality. Python is massively practical: - the easy on-ramp (often reads like English, indentation is something beginners can innately pick up) - batteries included: with the rise in the internet+ the shift to packages, it's really about having enough places you can find workable solutions, and Python's dominance helps here - integration with other languages has been a key part of Python since the beginning, so you are rarely held back
- pwdisswordfishz 2y agoJavaScript is a better Python than Python. But then, Lua is a better JavaScript than JavaScript.
- deleted 2y ago[deleted]
- glimshe 2y agoBASIC experience: 1) Turn computer on 2) Wait 2 seconds 3) Start programming Python is not BASIC.
- TrackerFF 2y ago1) Turn on computer 2) open your preferred CLI/shell, type "python" 3) start programming
- baobun 2y agoStep 2 unnecessary. https://xon.sh/ https://xon.sh/
- flembat 2y agoWrite your python, run script, find missing import. Install missing import, find that you actually need a different version of python as the import does not understand the latest version yet. Find that the import depends on various other imports, which python and the package manager, does not tell you it needs. Downgrade your local python. (and lets not discuss managing multiple versions.) Import library again and find you need to install a C compiler. Install a c compiler. Later find that the library is not compatible with your systems version of openssl. And it turns out you now need a version of python that has some extra static code linked into it, because you need to display a simple GUI. But you still need the GUI library as well.
- glimshe 2y agoI don't like to respond to people who directly reply to my comments to avoid flame wars. But, about your comment: THIS. Python can be convenient, but often isn't. Just setting the path on my last install was annoying because Python got automatically installed by windows in a hard-to-find folder. BASIC "just worked".
- phlakaton 2y agoYeah, but did BASIC have an SSL library? The bar for "basic" programming these days is much higher in many cases.
- Nihilartikel 2y agoOne thing I was waiting for the article to mention is that basic has a REPL. I started on Atari basic in the 80s and having a REPL, even though I didn't know to call it that, was revelatory. Writing a line of code or a little for loop and drawing lines on the screen was a very tight learning experience. Python approaches that with its REPL and notebooks but doesn't quite match the pedagogical ergonomics I enjoyed 35 years ago with that basic cartridge. For beginners, python also has some confusing foot guns too, like understanding which objects pass by value and which by reference. It's all part of learning, but when a beginner is still trying to get a handle on variables and functions, it can confound the fundamentals.
- pjmlp 2y agoEverything is by value. Passing by reference means this is possible: def change_param(ab): ab = 768 x = 12 print(x) change_param(x) print(x) Expected output in reference parameters, 12 followed by 768. Otherwise it is always a value, even if the value happens to be a reference to an heap allocated object. Python has no mechanism to change the contents of the x variable used as parameter on call site.
- graemep 2y agoYou can do that if the parameter is a list: def change(l): l[1] = 'x' >>> foo = [1,2,3] >>> foo [1, 2, 3] >>> changel(foo) >>> foo [1, 'x', 3]
- pansa2 2y agoYou can't change which list `foo` refers to, though. Only the contents of that list. `foo` is a reference to a list, and that reference is passed by value.
- pjmlp 2y agoNow make foo point to another list, not change contents of the list foo points to. Passing by reference requires changing the variable itself, used on the call site.
- pansa2 2y ago> It's simple (or, at least, you can pretend it is, for casual use) I'm glad that caveat is there, because "Python is simple" is one of the biggest misconceptions about the language. It's actually a very complex language hiding behind pleasant syntax. It's heavily used by non-programmers not because it's simple but because it's easy, which isn't the same thing [0]. More specifically, Python makes easy things very easy, at the expense of making difficult things even more difficult. [0] https://www.youtube.com/watch?v=SxdOUGdseq4 https://www.youtube.com/watch?v=SxdOUGdseq4
- poincaredisk 2y ago>It's actually a very complex language hiding behind pleasant syntax. I'm not sure emphasis on very is justified. C++ is a very complex language. Python is just... complex, like every real world language is.
- pansa2 2y agoThis sort of thing makes me think Python is very complex: What `instance.foobar` actually does: https://blog.ionelmc.ro/2015/02/09/understanding-python-metaclasses/#object-attribute-lookup https://blog.ionelmc.ro/2015/02/09/understanding-python-meta... Unless `instance` is actually a class, in which case it does: https://blog.ionelmc.ro/2015/02/09/understanding-python-metaclasses/#class-attribute-lookup https://blog.ionelmc.ro/2015/02/09/understanding-python-meta... Unless it's looking up a special method (`__add__` etc), in which case it does something different again. This is much more complex than say, Ruby, which does the same thing in all three cases.
- epgui 2y ago> Python is just... complex, like every real world language is. No, there are many examples of extremely simple languages. A modern lisp like Clojure would be near the top of my list. Even Haskell, with all of its warts, is much simpler than python.
- hollerith 2y agoScheme is famous for being "simple" where "simple" means that it takes a programmer only a few hours to learn it well enough that he can tell what a code snippet will do without running it.
- jszymborski 2y agoI'm on a quest to find a statically typed Python with pattern matching, overloading, and friends BUT will allow me to use either PyTorch or Tensorflow (or JAX). I think Nim is close, but every attempt to wrap PyTorch dies a miserable death somewhere along the line.
- pansa2 2y agoSounds like you're looking for... Python? It has tools for checking static types (and the language community strongly encourages their use). Pattern matching was added in version 3.10.
- electron826 2y agoHave a look at Swift, it's practically that. There even used to be official TensorFlow bindings (they wanted to make it their default language) although that got cancelled.
- melodyogonna 2y agoSounds like Mojo
- maremmano 2y agoIs the brick more important than the building? each level of abstraction has its use case and its advantages (and disadvantages). Better not to criticize the level of abstraction but to try to improve it. Even from the bottom with better bricks if possible.
- pansa2 2y ago> One parting thought: how long will Python's reign last? Python doesn't really target non-programmers (IIRC the Steering Council is composed entirely of professional developers, who steer the language towards fulfilling their own needs). Therefore I expect Python's reign as a language for non-programmers will be ended by a language that targets that audience specifically. But what might such a language look like? For example, I imagine it will unashamedly dynamically-typed, or maybe have a simple (Go-like?) static type system - rather than the complexity of Python's Mypy/Pytype/Pyright/Pyre.
- poincaredisk 2y agoCounterpoint: Python is tempting to non-programmers, because it is heavily used in industry and there are libraries for everything. A language designed for non-programmers won't have thousands of useful libraries and blog posts about every topic possible. Maybe the "non-programmer friendly" language could add some kind of FFI to use libraries from another language, but then someone who wants to use it needs to understand caveats of two languages, not just one. And mypy/pyright etc is not that bad imo - Python is fully dynamically typed, mypy just tries to help when it "knows" something is wrong, but user may ignore it. But I don't know, I've used python for so long that I may be blind to it's caveats.
- MonkeyClub 2y agoA non-programmer programming language would be one that helps solve particular needs. I have an inkling that this is VBA...
- graemep 2y ago> But what might such a language look like? For example, I imagine it will unashamedly dynamically-typed, or maybe have a simple (Go-like?) static type system - rather than the complexity of Python's Mypy/Pytype/Pyright/Pyre. non-programmers using the language will almost certainly not use type hints. I suspect most Python code out there does not.
- ryandvm 2y agoI don't recall BASIC having a dozen different package management ecosystems...
- graemep 2y agoI don't recall Basic having any package management at all.
- 9rx 2y agoThe many magazines that regularly published BASIC programs could be considered package managers, of sorts.
- zahlman 2y agoPython has two public ecosystems that count: PyPI and conda-forge (for those using Conda). There are several package managers available, because people have wildly varying views of what "package management" includes for Python development, and wildly varying needs for those tools. But all of these involve managing the same set of packages, which overwhelmingly are available on PyPI. It's also perfectly possible to participate in the ecosystem without anything that could reasonably be called a package manager.
- joeyagreco 2y ago> I don't actually like Python. [...] I find the syntax ugly (format strings Format strings being the first supporting reason for not liking a language is so funny to me.
- pwdisswordfishz 2y agoAgreed that this is one of the worse reasons to dislike it. Format strings are pretty decent, especially for casual printf debugging, even if they are crippled compared to what could have been (PEP 501) and is hardly ideal for generating arbitrary-grammar languages.
- baobun 2y agoAnother way in which Python is the new BASIC is that it's preinstalled on the vast majority of Linux systems that have a terminal. Once it passed that threshold its popularity for utilities and scripts is a self-fulfilling prophecy. It's common that I'd prefer Ruby but pick Python because it can be expected to run out of the box pretty much anywhere as long as you're conservative with syntax and dependencies (and have automated compat tests). Its only real interpreted competitors there are Bash, POSIX shell, and Perl, I think.
- hulitu 2y ago> Another way in which Python is the new BASIC is that it's preinstalled on the vast majority of Linux systems that have a terminal Pyrhon 2 or Python 3 ? /s
- zahlman 2y agoUnfortunately, while this is a fine way to start experimenting with Python, the Linux system installation of Python is really not suitable for development in general, aside from developing software meant for your local use as part of the system. In particular, if you're based on Debian, the system Python likely lacks several pieces by default that the Python team considers standard: `venv` (https://software.codidact.com/posts/291789 https://software.codidact.com/posts/291789) and `tkinter` (https://software.codidact.com/posts/291791 https://software.codidact.com/posts/291791) standard libraries, and Pip (not part of the standard library, but has privileged status - https://software.codidact.com/posts/291787 https://software.codidact.com/posts/291787). You'll also run into problems (especially with Python 3.11 onward - https://software.codidact.com/posts/291839 https://software.codidact.com/posts/291839) trying to install third-party libraries without making a separate environment first (which you should do anyway).
- baobun 2y agoThe point is to be conservative enough that you stick to packages in distro repos, so that you don't need to pull in externally managed code. But if you insist or the use-case demands, at least python3-venv is an apt/yum/apk/pacman away so you shouldnt need to --break-system-packages or manually install in any case?
- svilen_dobrev 2y agoi beg to differ. IMO Python is slowly becoming - or already became - the new Java - and is being used as such. i am programming with it for 25y, and it still allows things to be as simple as they were long time ago (attribute access is single well-defined thing, which means: simple), but overall mass use is not simple anymore..
- pwdisswordfishz 2y agoActually, Go is the new Java: - garbage-collected - opinionated design meant for easy adoption by inexperienced coders - static type system that is primitive to the point of being stifling - dearth of abstract, generic language constructs - lots of boilerplate, especially around error handling - heavy reliance on code generation
- 1vuio0pswjnm7 2y agohttps://log.schemescape.com/posts/programming-languages/python.html https://log.schemescape.com/posts/programming-languages/pyth...
- tim333 2y ago>BASIC was designed to be usable by anyone--not just experienced programmers. Python is the new BASIC It does largely fulfill that but there's more! Python is used for a lot of serious stuff in a way that BASIC never really was. ChatGPT is written in Python, the most popular language used by scientists is Python, the CERN accelerator is controlled by Python and so on. It often seems to function as a bit of a user interface to control more serious code written in C, C++, CUDA or whatever.
- daft_pink 2y agoI think it’s parallel's to basic is that it’s not commonly used for a gui interface the way basic always never made that jump in a universal way unless you bought the Microsoft product. But to be fair basically everything can be installed easily and is everywhere these days. Python isn’t everywhere and has to be installed on a Mac or a pc and doesn’t come with it. You could say the same of node or go or anything else that can be installed with a few clicks.
- marttt 2y agoQBasic is actually still a great first language for children, particularly non-native English speakers. In this case, the syntax is really easy to grasp, simple UPPERCASE commands with lowercase arguments. No need to wrestle with getting closures right, etc. I had quite a bit of success digging QBasic with our son (10yo back then), using this great tutorial which I translated to our language: http://tedfelix.com/qbasic/ http://tedfelix.com/qbasic/ Eventually, though, the son dropped his QBasic explorations (I consider it "my fault", since I got burdened with other stuff and couldn't help him as much as I wanted to). And - he dropped it in order to first take up Scratch and then dig straight into - duh! - Python. There ya go. I do think he will need some time to get closures etc intuitively right; in this regard, QBasic was, IMO, indeed, easier to grasp. I was happy to find a great children-friendly IDE for Python, though - Mu: https://codewith.mu/ https://codewith.mu/ Not as "immersive" as the excellent (!) QBasic IDE and its blue screen, but still great. No bloat. F5 for launching the program, etc - and our son started to notice and carefully analyze the interpreter's error messages from first try all by himself. So, all in all, really happy with Mu.
- 1vuio0pswjnm7 2y agohttps://log.schemescape.com/posts/programming-languages/future-proof-languages-3.html https://log.schemescape.com/posts/programming-languages/futu... "Future-proof programming languages, part 3 March 3, 2023 SDK size (measured on x86_64 Alpine Linux), as a proxy for simplicity Just looking at SDK size, Rust is an outlier. Even compared to a similarly complex language like C++, the Rust SDK is absolutely huge. Even after allowing for a build tool, custom linker, and standard library, the Rust SDK is disappointingly heavy. The other languages show some interesting results: JavaScript and C# appear to be the most bloated, closely followed by SBCL (a Common Lisp implementation). If I'm just looking for a simple and fast language, that would leave C, Go, and Zig. C is almost certainly future-proof for another decade or two and the SDK is reasonably sized. I don't like Python."
- neonsunset 2y agoWould have been great if the author reached out to community about .NET first instead of posting content that they did. Anyway # JIT-based build dotnet publish -o {folder} -r linux-musl-arm64 -p:PublishSingleFile=true -p:PublishTrimmed=true # Native binary build dotnet publish -o {folder} -r linux-musl-arm64 -p:PublishAot=true Can build on the RPI too: https://learn.microsoft.com/en-us/dotnet/core/install/linux-alpine?tabs=dotnet9 https://learn.microsoft.com/en-us/dotnet/core/install/linux-... I guess it's too challenging to browse the docs...
- 1vuio0pswjnm7 2y agohttps://log.schemescape.com/posts/programming-languages/compiling-cpp-for-windows-using-zig.html https://log.schemescape.com/posts/programming-languages/comp... "A good way to discourage me from testing out your software is to require a gigabyte (or more) download (and no, providing an installer that obscures the massive download is not a solution). The chief offender of inexplicably enormous downloads is, unfortunately, anything related to compiling software for Windows. Want to use the free edition of Microsoft Visual C? That will be at least 3 GB. How about a more modern language like C#? That's 5 GB. Even non-Visual Studio C/C++ compilers tend to be hundreds of megabytes." The Microsoft practice of burying relatively small executables and libraries inside mega- and now giga- sized downloads dates back to at least the early 90s.
- neonsunset 2y ago.NET SDK: 235 MB for Windows x64 + whatever space VS Code and base C# or F# (Ionide) extensions take. Visual Studio is optional.