Modern Programming
-
Please. That's C's ternary operator. JS is just a pile of garbage cosplaying as a programming language
Why do you say it's a pile of garbage?
-
The ternary syntax is really my only real gripe with python design -- putting the conditional BETWEEN the true and false values feels so very messy to me.
wrote on last edited by [email protected]Eh, reads pretty naturally to me. That said,
(like I lisp)
-
It's kinda natural to me having used Perl a lot.
wrote on last edited by [email protected]You clearly haven't used Perl a lot. Perl's ternary looks like:
$even = $num % 2 ? "nay" : "yay";
Incidentally, it is also the same as PHP's, but mainly because PHP stole it.
-
Eh, reads pretty naturally to me. That said,
(like I lisp)
Oh, (you) (really) (like) (Lisp)?
(That's) (great!) -
Eh, reads pretty naturally to me. That said,
(like I lisp)
Lisps makes more sense to me though
(if condition a b)
VS
a if condition else b
-
Why do you say it's a pile of garbage?
Because of all the garbage
-
You clearly haven't used Perl a lot. Perl's ternary looks like:
$even = $num % 2 ? "nay" : "yay";
Incidentally, it is also the same as PHP's, but mainly because PHP stole it.
You do get the if in the middle of stuff though in the form print(debug message) if $debug
-
Full circle
Make sure the browser is made using Rust and run on a VM running on Linux, compiled to WASM.
-
This post did not contain any content.
Just send pseudo code to AI and compile straight to binary.
-
You do get the if in the middle of stuff though in the form print(debug message) if $debug
Wait until you learn that postfix conditionals are syntactic sugar and the compiler* turns that line into the equivalent of
$debug and print(debug message)
, putting the conditional in first place, a lot like the ternary operator.* Perl compiles to bytecode before running.
The ternary operator itself isn't implemented in terms of
and
(andor
) but it could be. -
Wait until you learn that postfix conditionals are syntactic sugar and the compiler* turns that line into the equivalent of
$debug and print(debug message)
, putting the conditional in first place, a lot like the ternary operator.* Perl compiles to bytecode before running.
The ternary operator itself isn't implemented in terms of
and
(andor
) but it could be.Luckily I don't need to read or write bytecode and all that matters to me is the syntax
-
Because of all the garbage
Clearly the garbage collector is too effective
-
Lisps makes more sense to me though
(if condition a b)
VS
a if condition else b
I was more talking about
(+ a b)
and such. -
The ternary syntax is really my only real gripe with python design -- putting the conditional BETWEEN the true and false values feels so very messy to me.
At least you guys have ternary syntax cries in kotlin.
-
You clearly haven't used Perl a lot. Perl's ternary looks like:
$even = $num % 2 ? "nay" : "yay";
Incidentally, it is also the same as PHP's, but mainly because PHP stole it.
perl -e 'print "fart\n" if 1;'
-
You know, the stuff in @_
heheh. I wasn't really making an argument though
-
heheh. I wasn't really making an argument though
The joke was that Perl is a clusterfuck
-
The joke was that Perl is a clusterfuck
It certainly has its issues. I find that the things people have trouble with are the things I tend to like about it. Of course, reading it later is a problem sometimes.
Write only language!
I still reach for it sometimes.
-
Clearly the garbage collector is too effective
No they're not supposed to be piling it up
-
It certainly has its issues. I find that the things people have trouble with are the things I tend to like about it. Of course, reading it later is a problem sometimes.
Write only language!
I still reach for it sometimes.
The point of code is to be read by other humans, not just computers.