Post AcsnM7UVHpeRHLcwt6 by steriana@mstdn.social
 (DIR) More posts by steriana@mstdn.social
 (DIR) Post #AcsnM2x2AKVBCNwAAC by ramin_hal9001@emacs.ch
       2023-12-07T00:27:42Z
       
       0 likes, 0 repeats
       
       Yet another rant about Python and JavaScript:I hate it when someone tells me, "well Python and JavaScript can be programmed in functional programming style, so they are just as good as any other functional programming language," and "something something objects are the same thing as closures."Then my program crashes and I spend 20 minutes debugging only to find that for the 100th time I wrote a method like this:def getThing(self):    self.thinginstead of like this:def getThing(self):    return self.thing...where basically the problem is most of my program is written in functional programming style, except you STILL have to write the fucking "return" statement as the last line of the function.If your language has "return" as a built-in control flow, it is hopelessly imperative not functional, and there is not a single monad framework or higher-order-function library anywhere that will make your language functional.Stop telling me imperative languages like Python and JavaScript are just as good as functional languages, they are objectively worse than functional languages.#python #JavaScript #FunctionalProgramming #fp 
       
 (DIR) Post #AcsnM3rOmlaY1CJB1E by Pitosalas@ruby.social
       2023-12-07T00:39:00Z
       
       0 likes, 0 repeats
       
       @ramin_hal9001 Does that make ruby (more) functional?
       
 (DIR) Post #AcsnM4xShi25QI9X6m by ramin_hal9001@emacs.ch
       2023-12-07T00:46:21Z
       
       0 likes, 0 repeats
       
       > "Does that make ruby (more) functional?"@Pitosalas  I suppose so, Ruby was apparently inspired by Common Lisp. Although I still don't really like Ruby all that much for various other reasons, e.g. how it chooses to coerce values in what I would call "counterintuitive" ways. I will admit, I have not used Ruby very much at all beyond just learning how to solve practice programming problems.
       
 (DIR) Post #AcsnM5nvYe0430hQsy by Pitosalas@ruby.social
       2023-12-07T22:41:43Z
       
       0 likes, 0 repeats
       
       @ramin_hal9001 I love ruby, but lately I’m much more of a python person. #ruby is the superior language imho (and I can list reasons). #python in many ways is very similar. In the end though we adopt a language and its ecosystem. I teach and in #academia python is far better known and popular.
       
 (DIR) Post #AcsnM6U71nkC9qR7dg by ramin_hal9001@emacs.ch
       2023-12-08T00:29:23Z
       
       0 likes, 0 repeats
       
       > "I teach and in #academia python is far better known and popular."@Pitosalas  yes, it is a pitty that #Python won the popularity contest.It started out as a great language for teaching coding. Academics all thought, "well, lets start them out with an easy language, once they learn one language, they can learn other languages more easily. They will learn the correct language for whatever job they might need to do once they get a real job."But as it turns out, people want to only use the first programming language they ever learn for everything. So then they do use their favorite (first) programming language for everything, even for tasks that the language is not well suited.So now we have an industry-wide situation where instead of people learning the correct programming language for each task, they just try to hack and kludge Python until they can use it to solve any possible #programming problem. Now Python is used in many thousands of code bases where it is quite probably the worst choice of programming language for the task that code is trying to solve. This is especially true of machine learning and AI.
       
 (DIR) Post #AcsnM7UVHpeRHLcwt6 by steriana@mstdn.social
       2023-12-08T01:30:13Z
       
       0 likes, 0 repeats
       
       @ramin_hal9001 @Pitosalas Learning the "correct" programming language for separate tasks is *exhausting*.One of the reasons I like Python is that it can be used for so many *different* tasks, and *without* having to learn a new language.Yes, I suppose if I have a regex-heavy task I should be using Perl....but Python is good enough. And I can be a master of Python instead of splitting my time/energy/expertise between Python and Perl.
       
 (DIR) Post #AcsnM98bAFJkNzOU1Q by ramin_hal9001@emacs.ch
       2023-12-08T02:26:04Z
       
       0 likes, 1 repeats
       
       > "One of the reasons I like Python is that it can be used for so many *different* tasks, and *without* having to learn a new language.@steriana @Pitosalas  here is the thing though, Python is one of the worst languages for trying to adapt it to many different tasks.If you want a truly general purpose high-level language that can be adapted to many different tasks, Common Lisp or Scheme is considerably better. The interpreters and compilers for these languages actually provide carefully designed mechanisms, like macro expansion and pattern matching, specifically for adapting the language to different tasks. This is possible because the syntax of the language is so simple and minimal that it is very easy to devise embedded domain specific languages (EDSLs) with very little effort, and without requiring people to expend the effort of learning whole new languages.Python's syntax is relatively complex compared to Lisp, and its APIs for modifying the compiler and interpreter are not at all well-designed for adapting the language to various tasks compared to those of Common Lisp or Scheme. Creating EDSLs is for Python is not idiomatic coding style and discouraged, but people try to adapt it to every possible task anyways, and it becomes a horrible mess.So you or anyone else, adressing the software industry as a  whole, wanted to learn just one high-level language to solve every problem for you, it ought to have been #Scheme or #CommonLisp. Relatively speaking, #Python is so incredibly limited in what it can do compared to those languages, Python was objectively the wrong choice for this "lets adapt it to all purposes" way of thinking. The software industry is truly in a horrible mess as a result.By the way, languages like Racket and Gerbil which are both built on top of Scheme are very easy to learn for beginners.
       
 (DIR) Post #Acsp5VYGmAjMt4ay7U by monkey1@fosstodon.org
       2023-12-08T16:06:27Z
       
       0 likes, 0 repeats
       
       @ramin_hal9001 @steriana @Pitosalas Ramin,You are not wrong in your argument about the deficiencies of Python.But that doesn't mean that a better language is the way to go. Richard Gabriel tackled an issue very similar to this one:https://www.dreamsongs.com/RiseOfWorseIsBetter.html
       
 (DIR) Post #Acsp5WegfnSUJGbblI by steriana@mstdn.social
       2023-12-09T00:16:20Z
       
       0 likes, 0 repeats
       
       @monkey1 @ramin_hal9001 @Pitosalas Yes, Richard Gabriel nails it.While the "MIT group" (the language has to be "right") is still arguing about what is pristine, perfect, etc., the "New Jersey group" (get it as good as possible then ship!) has already shipped product.Shipping product always wins.
       
 (DIR) Post #Acsp5XRxiasEm5exZA by ramin_hal9001@emacs.ch
       2023-12-09T08:51:24Z
       
       1 likes, 0 repeats
       
       > "But that doesn't mean that a better language is the way to go. Richard Gabriel tackled an issue very similar to this one:"> "Shipping product always wins."@steriana @monkey1 @Pitosalas  yes, the old "move fast and break things" mentality... which is analogous to "earning profit in the short term always wins, regardless of whether we destroy the environment in the long term."I have read those essays by Richard Gabriel before. Interestingly, he was kind of playing devils-advocate when he said that, he still believes Lisp is the correct choice by the end of that series of essays. The full volume of essays are titled, "Lisp: Good News, Bad News, How to Win Big."If you want to get to market quickly, someone can and will always argue that the language that is most popular is the correct choice regardless of whether or not it actually is the correct choice from an engineering perspective. "It will be cheaper and easier to hire people to maintain it. There are more libraries and tooling available for that language. All Turing complete languages are basically the same anyway, we can always hack something together to solve whatever deficiency it has."And there are so many languages out there that are better than C, Java, JavaScript, and Python, but no matter how much better those other languages are with regard to correctness and language features, they will never win the popularity contests. So we are stuck with this "oil burning" software, the "renewable energy" software will never be able to compete with it.No. Contrary to how the business world works, the correct language to solve an engineering problem is the language with the correct features to solve the problem, not the language that is the most popular. We need to collectively move away from this stupid profit-at-all-costs driven way of thinking, and start building better systems that are good and sustainable, not systems that are just good enough.