Programming thread

Anybody else start teaching themselves programming this week?
image.jpg

38F946B0-5703-4C21-9AF2-1DF8AFCFEAFF.jpeg
 
Last edited:
Is it just me, or is JavaScript like the programmers equivalent to a botched tranny surgery. Like I will have to say out of all of the languages I've learned, this has to be one of the worst in the bunch I have encountered. What do you guys think about JS?
 
Is it just me, or is JavaScript like the programmers equivalent to a botched tranny surgery. Like I will have to say out of all of the languages I've learned, this has to be one of the worst in the bunch I have encountered. What do you guys think about JS?
I think JavaScript is quite elegantly designed for what its original intended purpose was: dynamic document manipulation. However it has been turned into an application development language (and even a server-side language) when it was never designed to do this. It suffers from unorganized accretion of poorly designed APIs and the ecosystem around it is still a mess. The DOM API is a monstrosity. npm is a classic example of soydevs ignoring prior art because they thought they could do it better. NodeJS is just shit overall and should be kept far away from production environments. There is still a cowboy coder culture prevalent in JS, performance is often seen as an afterthought, and for the most part there's no longer the excuse of having to support legacy browsers. Even with all this though, I think JS gets unfairly maligned sometimes.
 
Is it just me, or is JavaScript like the programmers equivalent to a botched tranny surgery. Like I will have to say out of all of the languages I've learned, this has to be one of the worst in the bunch I have encountered. What do you guys think about JS?
I used to hate JS until I learned how the prototype-based inheritance works, and then it became more bearable. Also, the standard conformance is pretty good nowadays, compared to what it was back in the times of Netscape, when you had to use jquery for DOM manipulation.
 
sorry if this is very noobish question, but search engines are giving me very strange results on this. Can I write "one time" multiline bash scripts from within the console? Like if I want to write a small script to loop over all the files in a directory and process them with some program, how would I do this without explicitly making a file and giving it execution permissions.

I can write scripts fast, but having to hop to the file system, even if it's within the terminal, slows me down greatly.
echo 'function batchcmd {for i in "$1"; do $2 $i; done;}' > ~/.bashrc

now you can do
$ batchcmd *.rar unrar
 
I think JavaScript is quite elegantly designed for what its original intended purpose was: dynamic document manipulation. However it has been turned into an application development language (and even a server-side language) when it was never designed to do this. It suffers from unorganized accretion of poorly designed APIs and the ecosystem around it is still a mess. The DOM API is a monstrosity. npm is a classic example of soydevs ignoring prior art because they thought they could do it better. NodeJS is just shit overall and should be kept far away from production environments. There is still a cowboy coder culture prevalent in JS, performance is often seen as an afterthought, and for the most part there's no longer the excuse of having to support legacy browsers. Even with all this though, I think JS gets unfairly maligned sometimes.
What language do you think is best for application development language?
 
What language do you think is best for application development language?
The problem with Javascript is the problem with Python is the problem with Lua.

Dynamically typed languages are bad for large programs.

Interpreted scripting languages were always designed with little self contained programs in mind. Not these 100,000 line monstrosities with 30 layers of abstraction stacked on top of eachother. This is why tools exist for translating statically typed languages into Javascript because it makes it actually manageable to write. But a lot of companies and individuals still insist on going at it raw.

This leaves the realm of a subjective or opinion thing. There's entire categories of productivity tools that stop working because computers themselves cannot reasonably analyze what dynamically typed code will do. The smartest people in the world try and fail to write competent refactoring tools for dynamic languages because they're just such a clusterfuck of abusable logic.

There's lots of good languages for application development, and which is the best depends on a lot of specific factors. However, one UNIVERSAL constant remains true that if the program gets big, using a statically typed language is in everyone's best interest.

Thanks for reading my blog post.
 
What language do you think is best for application development language?
For web applications, which is all JS should be used for (I forgot to mention Electron in my last post, don't even get me started on that shit), you don't have a choice but to use something that ultimately transpiles down to JS. I agree with @Rusty Crab in that dynamically typed languages are not suited for serious application development. In that case there are several choices of statically typed transpile-to-JS languages. TypeScript has gained a lot of traction in the industry, and since it's a superset of JS, it is relatively easy to migrate a codebase. Kotlin also transpiles to JS and might be nice if you already have Android devs who write Kotlin, though I have no idea how well it works in practice. There are other choices like PureScript, Reason, Nim, etc. but these are all pretty niche.
 
I used to hate JS until I learned how the prototype-based inheritance works, and then it became more bearable. Also, the standard conformance is pretty good nowadays, compared to what it was back in the times of Netscape, when you had to use jquery for DOM manipulation.
Pretty much this. Learn the ideas behind ducktyping, prototyping and other javascript concepts and you'll really dig it. All those Node.js rave about it for a reason.
Don't fight the language and try to turn it into something it's not.
Additionally, learn some of the javascript quirks like Truthy and Falsy and stuff will start to make sense.
 
The problem with Javascript is the problem with Python is the problem with Lua.

Dynamically typed languages are bad for large programs.

Interpreted scripting languages were always designed with little self contained programs in mind. Not these 100,000 line monstrosities with 30 layers of abstraction stacked on top of eachother. This is why tools exist for translating statically typed languages into Javascript because it makes it actually manageable to write. But a lot of companies and individuals still insist on going at it raw.

This leaves the realm of a subjective or opinion thing. There's entire categories of productivity tools that stop working because computers themselves cannot reasonably analyze what dynamically typed code will do. The smartest people in the world try and fail to write competent refactoring tools for dynamic languages because they're just such a clusterfuck of abusable logic.

There's lots of good languages for application development, and which is the best depends on a lot of specific factors. However, one UNIVERSAL constant remains true that if the program gets big, using a statically typed language is in everyone's best interest.

Thanks for reading my blog post.
Dynamically typed languages give you implicit generics. I've never been a statically typed evangelist. If the compiler or interpreter can figure out the typing, why can't said tools that don't work just use the languages implementation when they need to do type work? I've always guess that the reason large program are written strongly typed is because what libraries are available and compiling and distributing tends to favour already prominent strongly typed languages. For example, why not write a web browser in lisp. You're going to need to call GL at same point to draw to the screen and it's not worth bothering with glue code into something is just going to turn into GL calls that can be done from C and fam with less work to implement usually. Same for a number of other things you would want like GUI libs.
 
  • Like
Reactions: Yotsubaaa
I so wanna write "everything beyond C is bloat" and then just walk away from this thread and then look how the page count goes up while chuckling to myself but it's also kind of a bad thing to do so I don't do it.
Pathetic. 😞

We're sperging about programming languages on a cyberbullying site. Hesitation is gay, as are unironic convictions.

For example, why not write a web browser in lisp.
Everything should be written in Lisp.
 
Back