News for hackers. Stuff that matters.
Re:Is .NET just miles ahead or am I delusional? by addicted on Saturday April 13, 2024 @07:07AM (#40022202)
We write JavaScript in a browser because of a historical quirk and literally no other reason. There are 0 ways in which JavaScript is the most suitable choice for the browser other than Netscape wanted their own new scripting language really fast and JS was what Eich could come up with in a couple of weeks.

We write operating systems in C because it’s a thin veneer over assembly and coding in assembly is really hard. We use C++ instead of other languages because of its C interop.

Erlang is a really good fit for concurrency so that’s one of the few languages that’s used where it is for its technical merits.

Python is used for academic work solely because it’s easy to learn and easy to get started with so a lot of colleges used python to teach engineers/scientists programming. Python became the language of academia because that’s what the people in academia knew. If colleges had adopted Ruby or Lia for their Programming for non CS majors 101 classes instead, Lua or Ruby would be the language of academia.

Re:Is .NET just miles ahead or am I delusional? by tomrod on Saturday April 13, 2024 @08:09AM (#40022620)
I'd argue the REPL paradigm and readability are why R and Python are dominant in academics. Compilation and/or object oriented and functional paradigms are hard to teach someone who just learned how a text editor is distinguished from Microsoft Word.
Re:Is .NET just miles ahead or am I delusional? by afiori on Saturday April 13, 2024 @08:18AM (#40022660)
In my opinion more than being easy to read the advantage of python is that it allows for very ergonomic APIs in libraries.
Re:Is .NET just miles ahead or am I delusional? by tomrod on Saturday April 13, 2024 @12:37PM (#40024242)
I think that's is the sticking feature for devs. Having straddled both SWE and Data Science, data scientists and other academically aligned start in the REPL (or notebooks).
Re:Is .NET just miles ahead or am I delusional? by bradleyjg on Saturday April 13, 2024 @07:25AM (#40022340)
it’s easy to learn and easy to get started with

Don’t disagree with a lot of the rest of your post, but this is a real, genuine virtue and ought not to be lightly dismissed.

Re:Is .NET just miles ahead or am I delusional? by epgui on Saturday April 13, 2024 @07:39AM (#40022413)
Python is not fundamentally any easier to use or to learn than something like Haskell or Clojure or Racket or Scheme (I'd argue the contrary) though. It's only true in practice out of sociohistorical accident, because your colleagues can show you how to use it to do things, because their colleagues once showed them.
Re:Is .NET just miles ahead or am I delusional? by lpapez on Saturday April 13, 2024 @07:51AM (#40022494)
This is just an absurd statement, of course Python is easier to learn than either of those languages.

I've taught Haskell at an university and almost none of the students ever found the model of computation natural. I think we humans simply find following a series of steps easier than reasoning in an abstract mathematical sense.

That being said, I absolutely see the value of the latter, and consider it a good thing that functional concepts are gaining popularity in imperative languages.

Re:Is .NET just miles ahead or am I delusional? by tome on Saturday April 13, 2024 @08:23AM (#40022682)
Would it be possible to give a small example of Haskell versus Python that shows why Python's model of computation is different to and easier than Haskell's?
Re:Is .NET just miles ahead or am I delusional? by homborg on Saturday April 13, 2024 @10:01AM (#40023210)
Imagine writing a cooking recipe or any kind of instructions.

They seem naturally sequential and an imperative to me.

I can't imagine how a list of instructions would be clearer in haskell.

Re:Is .NET just miles ahead or am I delusional? by epgui on Saturday April 13, 2024 @12:08PM (#40024055)
That's an argument from incredulity... https://en.wikipedia.org/wiki/Argument_from_incredulity
Re:Is .NET just miles ahead or am I delusional? by tome on Saturday April 13, 2024 @03:02PM (#40025211)
I suppose I was looking for a more typical programming example than a cooking recipe, but even so I don't see why Haskell would have a problem there. I wouldn't claim it would be clearer but I still don't see why it would be worse.

    cook meat sauce = do
       pan <- getPan
       addTo pan meat
       cookFor pan 10
       addTo pan sauce
       cookFor pan 3
       food <- contents pan
       pure food
Re:Is .NET just miles ahead or am I delusional? by epgui on Saturday April 13, 2024 @08:06PM (#40027446)
> I wouldn't claim it would be clearer

Although written in an imperative style and thus superficially similar, the haskell differs in that it is referentially transparent.

I think that makes it objectively clearer, because it implies certain guarantees that nothing will surprise the reader.

Re:Is .NET just miles ahead or am I delusional? by tome on Sunday April 14, 2024 @05:06AM (#40029807)
That's a good point! Python's weird scoping rules can make code very unclear.
Re:Is .NET just miles ahead or am I delusional? by tasuki on Saturday April 13, 2024 @03:23PM (#40025329)
Monads are exactly the mechanism for chaining instructions, how could it get any clearer than that?
Re:Is .NET just miles ahead or am I delusional? by epgui on Saturday April 13, 2024 @12:10PM (#40024070)
> I think we humans simply find following a series of steps easier than reasoning in an abstract mathematical sense.

It is not at all obvious that this is truly the case. If it was the case, why didn't humans intuitively develop mathematics from a computational foundation? It took centuries before we made the leap from mathematical abstractions to Turing machines, and the two are (in some great general sense) isomorphic.

Re:Is .NET just miles ahead or am I delusional? by temporarely on Saturday April 13, 2024 @01:09PM (#40024451)
"I think we humans simply find following a series of steps easier than reasoning in an abstract mathematical sense" + to perform tasks.

So, you are right regarding the mindset of human philosophers, but that is not the sort of problems OP's students were tasked with solving.

Re:Is .NET just miles ahead or am I delusional? by epgui on Saturday April 13, 2024 @02:57PM (#40025187)
I wasn't thinking about philosophers in particular, but rather about mathematicians and scientists.
Re:Is .NET just miles ahead or am I delusional? by FrustratedMonky on Saturday April 13, 2024 @07:57AM (#40022536)
I would disagree.

Javascript is as easy to learn as any language, like understanding the syntax of a loop or an if-statement.

But to do anything practical at all, I'd say you quickly bump into a jungle of libraries you need for everything, and then it is just as complicated as any other language, or more. The javascript ecosystem is a nightmare.

Re:Is .NET just miles ahead or am I delusional? by miki123211 on Saturday April 13, 2024 @11:53AM (#40023938)
Javascript doesn't have a good "starting point". Either you learn it in the browser, and then you need to learn HTML first, or you learn it in node.js, and then it's hard to get Python levels of "fun". In Python, input() is one of the first things you learn, and that actually lets you make somewhat interesting programs. Once you learn loops and conditionals, you know enough to write a "guess the number" game, which is probably the simplest actually useful program you can make. Once you learn to deal with files, you already get superpowers, you don't even need functions, classes and such for simple, text-munging scripts.

Node makes this a lot harder, the simplest way to have interactivity is the readline library, and that requires you to understand functions, closures and the idea of a callback and why one is needed.

Then there's the "R way" of learning Python, in a Jupyter notebook, by stringing functions from Numpy, Pandas, Matplotlib and perhaps some other libraries in your field together, with no understanding of what a loop is, because you don't really need those for basic dataframe and tensor work.

Re:Is .NET just miles ahead or am I delusional? by adrianmsmith on Saturday April 13, 2024 @07:23AM (#40022327)
Plus the world would probably really be a better place of operating systems etc. weren’t written in C.

Think of all the urgent iOS, Windows etc. patches which could be avoided if the software didn’t suffer from a number of classes of avoidable vulnerabilities.

Re:Is .NET just miles ahead or am I delusional? by usr1106 on Saturday April 13, 2024 @08:09AM (#40022618)
Plus the world would probably really a better place if Windows weren't one of the dominating systems, limited to desktop computing, but still...
Re:Is .NET just miles ahead or am I delusional? by imadj on Saturday April 13, 2024 @07:53AM (#40022504)
OP very clearly said:

> There is a reason that we write {...} rather than in C# or F#.

So are you arguing in favor of C#/F# here? you believe it was more suited for all of these cases? I hope not.

But again, if it's neither, then this comment seems like a out-of-context straw man.

Re:Is .NET just miles ahead or am I delusional? by IshKebab on Saturday April 13, 2024 @07:49AM (#40022473)
You're 100% right except maybe about Python. Probably the biggest reason it is used is because it actually has a REPL. You can play around easily and do things like Jupyter notebooks. That's completely unimportant for most programming but it's very useful in scientific research.

Python's REPL isn't even any good, but it does at least exist which is more than you can say for most languages.

(And there's also the fact that it's crazy popular.)

Re:Is .NET just miles ahead or am I delusional? by nopcode on Saturday April 13, 2024 @11:54AM (#40023942)
I can't think of a single language that doesn't have REPL functionality and Jupyter is literally developed by academics.
Re:Is .NET just miles ahead or am I delusional? by IshKebab on Sunday April 14, 2024 @04:02AM (#40029503)
What? Virtually no compiled language does, and even the ones that do usually have it as a massive hack (e.g. Cling).
Re:Is .NET just miles ahead or am I delusional? by miki123211 on Saturday April 13, 2024 @11:56AM (#40023953)
Python's repl is pretty average IMO, iPython is a lot better, Jupyter is best in class.

Perhaps some of the old Lisp or Smalltalk environments could rival that, but no other modern language except Julia and R, which also have Jupyter support, come even close when repl ergonomics is concerned.

Re:Is .NET just miles ahead or am I delusional? by ludston on Saturday April 13, 2024 @07:30PM (#40027164)
Yes. So you can not really argue that C# is better in the browser than javascript because unlike javascript it doesn't have native integration, or the same loads of documentation and libraries and tutorials and frameworks that are part of the JavaScript ecosystem.