gregoryyoung / nothing

Replacement of the System.Void type
The Unlicense
57 stars 11 forks source link

I'm confused, is "Nothing" like "void" or "null" or the empty string or... #4

Open dsyme opened 9 years ago

dsyme commented 9 years ago

I'm new to "Nothing" and I'm trying to get the hang of this framework. I'm used to navigating big frameworks like Entity Framework. But this one is really baffling me.

First, why do we need it? I mean, we already have "void". Isn't "void" good enough? Or is Nothing like "null"? But then I've never understood the difference between the empty string and "null". And why not just use 0 (32-bit or 64-bit?) as void anyway? JavaScript just has none of these problems. And if I have a list of nothing, is that nothing? It's making my head hurt just to think about that.

Secondly, I don't understand the future evolution path. What's the roadmap here? What can we expect in Nothing 2.0? I'll add a separate issue about this.

gregoryyoung commented 9 years ago

@dsyme I can totally understand your confusion on all of the possibilities. In fact there are many deficiencies in languages like these. If you use another language like php or javascript things may be clearer for you.

php var_dump(FALSE == ""); bool(true)

This should help with your empty string issues

For zero:

var_dump(FALSE == 0); bool(true)

In terms of null try:

var_dump(FALSE == NULL); bool(true)

PHP will even help you with string parsing

var_dump(TRUE == "true"); bool(true)

var_dump(FALSE == "false"); bool(false)

Using such an advanced language may help you quite a bit. Just don't worry about things like:

var_dump(TRUE == 13); var_dump(TRUE == "true"); var_dump("true" == 13); bool(true) bool(true) bool(false)

The idea of having equality work with the arguments switched around is completely backwards anyways every statement should be validated on its own merits and not coupled with other statements.

Since you are also quite into frameworks, as a side note I would highly recommend putting http://symfony.com/ on your road map.

FinnNk commented 9 years ago

I think we are looking at a ground-breaking moment, not just in the history computer science but also in the very foundations of logic. Trivial or vacuous truth is well known, but unless I'm mistaken this could be a concrete example of trivial confusion!

gregoryyoung commented 9 years ago

@dsyme I ran into this one this week can we get F# to support this?

var_dump( “123456789012345678901234567890” ==“123456789012345678900000000000” );

yep its false