• 0 Posts
  • 4 Comments
Joined 1Y ago
cake
Cake day: Jun 12, 2023

help-circle
rss

Oh that makes sense. I didn’t consider it might be treated as a char


"1" + 2 === "12" is not unique to JS (sans the requirement for the third equals sign), it’s a common feature of multiple strongly typed languages. imho it’s fine.

EDIT: I did some testing:

What it works in:

  • JS
  • TS
  • Java
  • C#
  • C++
  • Kotlin
  • Groovy
  • Scala
  • PowerShell

What produces a number, instead of a string:

  • PHP
  • SQL
  • Perl
  • VB
  • Lua

What it doesn’t work in:

  • R
  • C
  • Go
  • Swift
  • Rust
  • Python
  • Pascal
  • Ruby
  • Objective C
  • Julia
  • Fortran
  • Ada
  • Dart
  • D
  • Elixir

And MATLAB appears to produce 51, wtf idk


People equate maths to programming, but I think if it more as a creative, problem solving field. Most real world coding problems don’t have a precise single correct way to solve them; it’s more like architecting a building: you have multiple goals and a lot of freedom in how you achieve them and to what degree


I have to write powershell scripts and bash scripts at work. I hear people saying bash is great, powershell is bad, all the time in public, but honestly I feel like these people have barely actually written powershell. It’s a bit wordy, but it feels much more intuitive to me, much more akin to regular programming languages.