It's a cool feature, but is it required for Javasc...
# off-topic
o
It's a cool feature, but is it required for Javascript? I mean, if we add all good features of other languages, like this feature from Elixir (and maybe Rust), Javascript will become a more messy language
j
I've got two questions in response to your question haha 1. "Is it required for Javascript?" What features of a language would you consider to be something that is required for them? For example fat functions weren't always a language feature, and we didn't need them because we had function.prototype.bind() and function.prototype.apply(). 2. "JavaScript will become a more messy language" What makes a language more or less messy to you? Pattern matching from my understanding helps the JIT (Just in time compiler) to make educated guesses about the execution flow of a program. With if statements, I think that while there are some optimizations possible, in most cases if statements are unknowns to the JIT and therefore every time the JIT hits a new value for the entrypoint of a set of conditionals, it has to rebuild it's representation of the function in bytecode. From the developer experience I think this article explains it much better than I could: https://medium.com/digitalfrontiers/a-case-for-pattern-matching-b43a5c9796b8
o
A language becomes messy when there is too much ways to make the same thing. It's what Javascript is and becomes more. A feature is required when there is a lot of people asking for it because of a real need.
j
@Olyno What constitutes a "real need"? I'd say that a JavaScript language feature doesn't reach TC39 Stage 2 approval without a lot of the JS community asking for it
> A language becomes messy when there is too much ways to make the same thing Would you say that JavaScript is already messy then? We have many different ways to loop: .map .forEach for(i=0; i<someArr.length; i++) for(key in object) for(var of iterable) while(somecondition) do...while function f() { f() }
o
Let's take the example of a beginner in Javascript. It's probably the hardest language i know to getting started
j
What makes it hard to get started with? The toolchain or something else?
o
Honestly, i just saw this line, i fell from my chair ahah
The language itself, there is too much things to know
I did a small job during my studies where i did teach Javascript to beginners, and i can assure you it's really hard
You have too much tools, too much possibilities.... which is awesome when you know well js, but is the hell when you're getting started
j
Beginner coders or beginner javascript coders? And what was the purpose of them being taught? To work on existing codebases?
Reason I'm asking these questions is that Python is considered a good first language to learn for new coders, but it's INCREDIBLY complex.
o
python is a good language for new coders
Javascript is not
For me, the real easiest language to start with is Skript. It's a language created from a Minecraft plugin, and it's very intuitive. It allows anyone to learn: - Logic - English Language - Conditions - Types - Functions - Variables And so on. Really underestimated language, but i started with it, and i'm happy now :p
Also, a big pros about the Skript language is you see what you do (in Minecraft). When you write a function to spawn a mob, you see the mob spawning... you don't see what is happening in other languages, you mainly code blindly, and sometimes you're getting weird errors with complex lines that you never heard about
j
I'd argue that you could get the same results from a properly constructed game engine with a js scripting interface.
o
hmm, not really. Did you already try to read an angular error? My eyes are bleeding 😂
I take you the Angular example, but it's the same with a lot of Js tools
j
But that has nothing to do with the language 😂
Have you tried to read a java error? If you found an issue with skript that's what you'd find
I detest java hahaha
I don't think limiting language features for beginner devs is a good move; seeing if they fit in the language's existing paradigm is a good thought though which I'd agree with
o
Honestly, Java errors are much more better than JS errors 😂
Do you want a secret? I'm creating a Kahoot v2 platform 👀 (not yet, but planned)
j
I have no idea what Kahoot is haha
Sorry
Can you interpret this error?
o
Scanner is not imported ahah
Cannot find symbol == Cannot find this thing
j
Yeah but what's a symbol? XD
o
Well, when you know symbol == thing, it is more clear xD
j
For sure
But that's clear as anything in JS is haha
o
xD
i guess the best language to have good errors is probably Elixir. I didn't make any project with this language, but looks so good
j
You'd like Crystal Lang I reckon then
o
Negative, i don't like Crystal
j
😮
o
The reason is simple: there is no native support to Windows 😂
Windows language support is kinda non-issue tho
Cause you can compile with cygwin or wsl2
o
Weeeeeell, i never used wsl 😅
j
Oh! Well you're missing out. It's great!
You have a whole linux life arc waiting to happen XD
o
xD
Probably, i'm waiting for the final version of Window: Linux transition xD
It's just getting started, i'm waiting the end
j
Well all my computers are windows
But I use a linux server hosted in linode
And vscode server to it
o
Ooooh, Vscode server 😮
i have only 1 computer with Window now, because i'm kinda disappointed by Window in a lot of ways (incompatibility with dev tools, blue screens and so on)
I'm using Deepin for my work laptop, and works fine so far. I'm waiting to see Cutefish OS too
j
👍
We need a profiles page somewhere so we can link to each-others twitter and other social media
Could follow a blog if you had one for example
o
All my links are in my Discord profile, and i'm using dev.to as blog platform, too lazy to create my own 😅 (if i understood correctly what you meant )
j
This is all I see?
Maybe I'm missing a part of discord I didn't know existed
o
Here
j
lol ok found it!
The twitter link in your github profile is broken?
o
Is it? 🤔
j
Works from your website tho
o
Oooooh wait, there is a "o" missing at the end of "Olyn" xD
j
Also you link to your personal protected twitter from your profile rather than your work profile haha
o
Waait, this is weird, i just checked and i don't have this issue
You have both 😝
Removed it :p
Oooooooooooh heeeeeere
Fixed Thanks you!
j
No worries!
I'm @jaitaiwan pretty much everywhere on the web
o
Ah got you!
s
I'm getting in here late, but I love Crystal Lang
I too does not use WSL, just plain old Powershell on Windows, but I do have a MacBook Pro too. And yes Crystal Lang not having native windows support is one of the reason I stopped looking into it.
After reading through some of the bun.sh code I think I might take a look into zig language now. The syntax looks close enough to JavaScript.
4 Views