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

Pages: 1-

Null thread

Name: Anonymous 2019-01-08 15:02

Null is a mistake only if you're severely retarded

Name: Anonymous 2019-01-08 20:25

consider(this->thread, "harmful");

Name: Anonymous 2019-01-08 23:06

Consider these binary dubs checked.

Name: Anonymous 2019-01-09 7:22

null is ok as long as checking for it is effortless and the fact that something might return null is either clearly documented or checked at compile-time (preferably both). if those conditions are not met, avoiding nulls wherever possible is a sane choice. with current popularity of fluent APIs (understandable: they make pipeline-like operations less painful), there's nothing worse than having to convert code like this:
hax()
.my()
.anus()


to this:
x = hax()
if x:
shit = x.my()
if shit:
FUCK = shit.anus()

Name: Anonymous 2019-01-09 13:42

compile-time null checking is 100% cancerous and just bloats the code with obvious null checks that are created by a snippet and never thought about

Name: Anonymous 2019-01-09 14:26

>>5
if something cannot return null, it should be possible to prove it to the compiler so that it won't force you to add obvious checks. either that or a concise null-checking syntax like the null-conditional operator .? in C#

Name: Anonymous 2019-01-09 15:20

>>4

Terrible! It is time to propose the addition of
conditional-member-access-operators
to sepples.

Name: Anonymous 2019-01-09 19:33

>>4
Monads win again!
hax >>= my >>= anus
or
do a <- hax
b <- my a
anus b

Name: Anonymous 2019-01-10 7:27

>>8
monads are a nice syntax for doing that, but I'd say having nulls be their own type as opposed to a pointer to address 0, and nullable functions either having multiple returns or returning a union of actual return and null, would be enough for compiler-enforced null checking. monadic error handling makes it less boilerplatey, which is a big plus.

Name: Anonymous 2019-01-11 10:08

>>9
but I'd say having nulls be their own type as opposed to a pointer to address 0
What do you mean by that? A null type? Something like bottom or unit?

and nullable functions either having multiple returns
Functions that return pairs? How would that help?

returning a union of actual return and null
So, like Maybe in haskell?

Name: Anonymous 2019-01-11 10:16

‍‍‍

Name: Anonymous 2019-01-11 10:17

It's pronounced ``zwidge'' according to EmojiPedia. Thanks!

Name: Anonymous 2019-01-11 10:20

>>10
first of all, check'em.

What do you mean by that? A null type? Something like bottom or unit?
null is already a bottom type. the point is for it not to be one - so that the compiler will complain if you try to use it as a value
Functions that return pairs? How would that help?
it's not the best approach because it ends up being verbose, but think of it like go-style error handling applied to nulls: if a function doesn't return what it usually returns, it returns an error value indicating that the normal return didn't happen.
So, like Maybe in haskell?
yes. Maybe in haskal, std::optional<> in sepples, Optional<> in Java etc.

Name: Anonymous 2019-01-11 10:20

>>13
disregard checking, I failed at dubs

Name: Anonymous 2019-01-11 11:41

>>13
null is already a bottom type
Null is not a type.

Name: Anonymous 2019-01-11 12:48

>>15
type my anus

Name: Anonymous 2019-01-11 14:22

>>15
There is a special null type, the type of the expression null, which has no name. Because the null type has no name, it is impossible to declare a variable of the null type or to cast to the null type. The null reference is the only possible value of an expression of null type. The null reference can always be cast to any reference type. In practice, the programmer can ignore the null type and just pretend that null is merely a special literal that can be of any reference type.

Name: Anonymous 2019-01-11 17:16

>>17
What the hell are you smoking?

Name: Anonymous 2019-01-12 0:32

>>17
makes you think......

Name: Anonymous 2019-01-13 8:36

>>18
Java

Name: Anonymous 2019-01-13 9:09

>>20
Pretty sure that null is a value of type Object in java.

Name: Anonymous 2019-01-13 9:40

>>21
Incorrect.

Name: Anonymous 2019-01-13 9:51

>>22
Howso?

Name: Anonymous 2019-01-14 7:30

>>23
class Anus {
public static void main (String[] args){
System.out.println(null instanceof Object);
}
}

output:
false

Name: Anonymous 2019-01-14 8:43

>>23
also: Object type defines several general-purpose methods like clone(), notify(), equals(), hashCode() etc. that are then inherited by all the Java's classes (as they all inherit from Object). null implements no such method:

Object anus = null;
anus.equals(null);

this code would work if null was an actual Object but it will crash instead.

Name: Anonymous 2019-01-14 8:59

What about:

class Anus {
public static void main (String[] args){
System.out.println((Object)null instanceof Object);
}
}

?

Name: Anonymous 2019-01-14 10:09

>>26
also false. same goes for assigning null to a variable of type Object.

Name: Anonymous 2019-01-14 12:52

What about (objectp nil)?

Name: Anonymous 2019-01-14 13:19

>>28
if you follow the chain of quotes, you'll see that were're are talking about Java

Name: Anonymous 2019-01-14 14:17

What programming language is this?

Name: Anonymous 2019-01-14 14:23

>>29
ah ok sorry, i saw public static void main and i was sure it was about lisp!

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