| ▲ | amelius an hour ago | |||||||
Javascript is actually a great language. Its garbage-collected closures made it easy to do GUI programming. The C/C++ world where browsers came from didn't have this (closures). So it is actually a miracle we got a language as (relatively) great as Javascript. | ||||||||
| ▲ | torginus 40 minutes ago | parent | next [-] | |||||||
Each to their own I guess, by personally I really don't like closures (at least ones that as per their namesake, close over objects with nontrivial lifetimes). I think it was the right call by the C++ people to explicitly list what objects are captured and how, even if the syntax's not the best. RAII is a fact of life unfortunately, not just in C++ or Rust, but if you talk over some high level protocol over the internet you go TCP socket->HTTP connection->your stream protocol; and have to do the exact reverse. Closures break RAII hard. Incidentally, you don't even need closures for nice looking UI code. Immediate mode GUIs like Dear Imgui or Clay allow for super-simple looking code in basic C | ||||||||
| ▲ | baq an hour ago | parent | prev | next [-] | |||||||
It was a missed opportunity for a mature language like Scheme which had at the time all the good parts, none of the bad parts and the only issue was slightly unfamiliar syntax. | ||||||||
| ||||||||
| ▲ | raincole an hour ago | parent | prev [-] | |||||||
> garbage-collected closures A feature existed since 1960s... | ||||||||