I think it is interesting to consider why Python is so popular despite such fiascos. The answers can be very informative but can also be giant red flags.
I think it is interesting to consider why Python is so popular despite such fiascos. The answers can be very informative but can also be giant red flags.
C/C++? Full of footguns. Java/C#? Too complicated for beginners. Pascal? Outdated. Etc.
I personally prefer C to teach first-year CS students but just as the lesser evil. A good first programming language is sorely lacking.
(Note that I'm talking about the imperative programming paradigm. The debate on whether one should start with functional programming is outside the scope of this comment).
C is indeed pretty evil, though slightly less though with modern sanitisers, so you can get a better error message than just a segfault (or silently doing the wrong thing).
Pascal isn't really more outdated than C. Especially if you use Delphi?
Python is actually fine, you can get pretty far with just the standard library, and the libraries that you can install with your Linux distribution's package manager (eg via Pacman). I do agree that package management with Python is pretty bad out-of-the-box.
Java's tooling is nice, but frankly Turbo Pascal (or something at its level) is enough for beginners.
If they can’t manage that they have no business doing data science or something similar to begin with
var start = "commtext c00\">";
var end = "</div>";
using var http = new HttpClient();
var page = await http.GetStringAsync("https://news.ycombinator.com/item?id=41425416");
var commStart = page.IndexOf(start) + start.Length;
var commEnd = page.IndexOf(end, commStart);
Console.WriteLine(page[commStart..commEnd]);
or var host = WebApplication
.CreateBuilder()
.Build();
host.MapGet("/", () => "Hello World");
host.Run("http://+:8080");I can teach them a console app with top level statements and have it running before they have installed a Python virtual environment.
The answer is really quite simple: F#
I like the recent addition of (proper) pattern matching to Python.