Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

{code null} thread

Name: Anonymous 2018-05-14 13:11

null -- useful tool or a catastrophe?

Name: Anonymous 2018-05-14 14:01

>>1
Useful tool if the programmer checks for nulls. Alternatives to nulls usually result in programmers selecting arbitrary sentinel values like 9999.
>but why not option types and tagged unions
Most programmers either too brainlet to properly use them or want to save overhead of using these types. Plus the code using nulls often looks shorter/cleaner and easier to read.

Name: Anonymous 2018-05-14 14:03

>>2
how the hell is null-checking cleaner than optionals? here's a hint: optionals can be chained/composed

Name: Anonymous 2018-05-14 14:12

>>2
Useful tool if the programmer checks for nulls
Walking on the freeway is a reasonable way of transport if you keep checking for approaching trucks.

Name: Anonymous 2018-05-14 14:18

data Maybe a = Just a | Nothing

Name: Anonymous 2018-05-14 14:31

>>5
that's just another way of writing the same nullable unsafe shit

Name: Anonymous 2018-05-14 14:59

>>3
I said it looks cleaner/simpler to read: its kinds more "obvious" and in your face.

Name: Anonymous 2018-05-14 15:02

/prog/ Challenge 420
Invent an alternative to sentinel values such as NULL, which doesn't add overhead.

Name: Anonymous 2018-05-14 15:28

Undefined
Undef or NIL/NULL

Defined
Might be empty
Might have a value


defined($var) == !isnull($var) # Always true
!defined($var) && empty($var) # Always false
!defined($var) && isnull($var) # Always true
empty($var) && isnull($var) # Always false

Name: Anonymous 2018-05-14 18:36

Btw, sepples has optionals. Enjoy:
http://en.cppreference.com/w/cpp/utility/optional

Name: Anonymous 2018-05-14 19:30

0 - useful tool or a cat ass trophe?

Name: Anonymous 2018-05-15 18:01

>>8
Passing a length value is free on architectures that have enough registers and out-of-order execution. It also allows for length-dependent iteration rather than data-dependent, which makes for faster loops. On your mum's 486 though, not so much.

Don't change these.
Name: Email:
Entire Thread Thread List