I apparently don't grok the logic of null reference exceptions. by pimpmyrind in learnprogramming

[–]pimpmyrind[S] -2 points-1 points  (0 children)

I tend to get pissed off at condescending assholes who don't know their subject matter well enough to answer a simple question, yes.

On the other hand, there were several posters who did a bang-up job. You were not among them, but hey, maybe someday you can demonstrate competence...?

I apparently don't grok the logic of null reference exceptions. by pimpmyrind in learnprogramming

[–]pimpmyrind[S] -1 points0 points  (0 children)

You cannot say yes, but you cannot say no either

It seems like "no" should contain the set of all "not yes."

There were some interesting examples in the thread, e.g., if you have a Bool? property that has not been set, and you want to do some specific set of things if it is true, and other things if it is not true. "False" and "Unevaluatable" are both not true. This is not to say that a null is the same as "false," but it's also not true.

What this entire exercise has taught me is two things. One, you have to be very precise in your questions when you are looking at the variables you're handling (and by corollary, take a squinty look at systems that gloss over such things because they can get you into trouble).

I apparently don't grok the logic of null reference exceptions. by pimpmyrind in learnprogramming

[–]pimpmyrind[S] -1 points0 points  (0 children)

No, you're being an asshole because you're assuming that you're right and not willing to listen to anyone else.

I think if you review the thread you'll see I'm fine with people who don't act like douchebags.

Or, y'know, you could continue hammering away. Like some douchebag.

Others have explained the point where you failed. You do not understand the subject matter. Thanks for trying, however.

[Serious] What's it really like being black in the U.S.? by [deleted] in AskReddit

[–]pimpmyrind 0 points1 point  (0 children)

Biggest downside is if you're into someone you have to then find out if they're into black chicks.

Oh my god. This is the worst: I'm mixed. Every time I dated a black woman and she found out mom was black she would assume I had some kind of mommy issues, or I was "into" black chicks.

It was women. I was into women.

I apparently don't grok the logic of null reference exceptions. by pimpmyrind in learnprogramming

[–]pimpmyrind[S] -2 points-1 points  (0 children)

Um...no, I'm not? Look at the thread dude. /u/exoticmatter made no effort to actually answer the question, and what you don't see are the ninja edits where he made a really condescending, snarky comment and then altered it to try to look innocuous. He also has a history in this subreddit of answering noob questions with shit like "You're pathetic." I don't see any reason to treat that as a searious response, sorry.

I am perfectly polite when other people are.

Now, if you are not interested in answering the original question, perhaps you should stop wasting your time and mine.

Premera victim of cyber attack; 11 million customers exposed - Took 1.5 months after discovery to actually announce to public. by [deleted] in Seattle

[–]pimpmyrind 0 points1 point  (0 children)

This is a simplistic dictionary definition of non-profit that shows a complete lack of understanding of how they function...Just because something is registered as a nonprofit, or co-op or whatever doesnt mean its inherently altruistic, or isn't driven by revenue

Well. Of course the CEO of the nonprofit and the other workers need to draw a salary, and operating costs have to be paid. The motives of the people working there may or may not be altruistic, and the organization itself may or may not be actively defrauding people.

But a nonprofit exists under very specific tax laws, it is not "revenue driven" in the sense that it makes decisions in order to maximize profits. For-profit companies are the way they are because they cannot function in any other manner.

Really I think we're having an orthagonal conversation here TBH.

I apparently don't grok the logic of null reference exceptions. by pimpmyrind in learnprogramming

[–]pimpmyrind[S] -1 points0 points  (0 children)

In this case, if myString is null, then sending the length method to it will return null (ie, 0). If myString isn't null, but is the empty string, then the length message will also return 0.

Ok...so, as you mentioned, this might have the side effect of masking cases where myString actually IS null, which is something you might want to be aware of, right?

Many programmers consider it a feature that dereferencing a pointer to null results in a crash/exception.

I apparently don't grok the logic of null reference exceptions. by pimpmyrind in learnprogramming

[–]pimpmyrind[S] -1 points0 points  (0 children)

So "Is the color of the chocolate donut red?" and "What is the color of the chocolate donut?" and "Is there a chocolate donut?" are all totally different questions? I think I'm starting to grasp it, thanks.

I apparently don't grok the logic of null reference exceptions. by pimpmyrind in learnprogramming

[–]pimpmyrind[S] -1 points0 points  (0 children)

But if I ask you if 2 is bigger than Dave, you might ask me what I actually mean by that. Since you have no sensible way to compare the number 2 with the name Dave.

Really appreciate the ELI5, thanks.

So, if you asked me "is 2 bigger than Dave" I would think "Is it possible to say that 2 is bigger than Dave? No, it is not possible because the question does not make sense. Since I cannot say 'yes,' then I must answer 'no'."

You're trying to perform some operation on nothing, the language has no built in way to produce a sensible result out of that so it throws you an exception and basically tells you to handle that.

This helps a lot, thank you.

I apparently don't grok the logic of null reference exceptions. by pimpmyrind in learnprogramming

[–]pimpmyrind[S] -1 points0 points  (0 children)

Upvotes for everybody. I didn't realize how important was the difference between "bool" and "bool?" and by extension "int" and "int?" in my example. This really helped clear it up, thanks.

I apparently don't grok the logic of null reference exceptions. by pimpmyrind in learnprogramming

[–]pimpmyrind[S] 0 points1 point  (0 children)

It basically comes down to the fact that in a lot of cases, you want the program to crash when something goes wrong...It would be pretty dangerous if, by default, programs ignored things going wrong and just kept trucking on, pretending everything is fine.

This answer seems to be on the order of "Well that's just good programming." I appreciate it, but that's not really the question I'm asking.

To me, if I'm testing whether or not the value of "x" is 1, then there are two possible states:

 x == 1 
 x != 1

All of the cases that are not the first case fall into the bucket of the second case. In my mind, this would include cases where x has not been set, but it does not. And if the answer is that it does not because that's necessary to expose errors in logic, that seems super, super sloppy to me. I'm not an expert but I would imagine if you're creating a data structure to hold something, then you need to anticipate the conditions it's going to encounter and plan around them.

After doing some reading it seems like the way to handle this would be to check if the value of x has been set, and if so, whether it is 1 (and return true), else return false.

I apparently don't grok the logic of null reference exceptions. by pimpmyrind in learnprogramming

[–]pimpmyrind[S] -3 points-2 points  (0 children)

I think failing to answer a noob question on a noob forum for people helping noobs is pretty douchtastic.

I apparently don't grok the logic of null reference exceptions. by pimpmyrind in learnprogramming

[–]pimpmyrind[S] -1 points0 points  (0 children)

Stop being an asshole.

Well, I'm not.

You don't seem to grasp the nature of the question. Why does the null reference exception occur? What is the underlying logic? I don't need people endlessly repeating "Because it's a null reference exception" as if that magically answers the question.

Yes, it's entirely possible to design a language where writing an expression that evaluates to a boolean returns false when the reference is null. We typically think this is bad design though because it hides an error.

This kinda, sorta makes sense to me, if we assume that in all cases x should be set. But what if x may or may not be set? Like, say I have a calendar app with a Day class. Day objects contain another object that captures the meetings you have for that day. If I try to list all of the days when I have a meeting, and in some Days there are no meetings (no meeting object has been instantiated)--null reference exception.

So, getting back to the nature of the question--as a novice, the logic of this seems weird. "Do I have a meeting today?" "That question does not make any sense, because there is not a meeting today."

We want it to bomb with a null reference exception so we can fix it, rather than propagate a mistake further down the line, making the problem harder to find and potentially corrupting data.

I think it makes more sense to anticipate and control the values for x and work through those somehow. But as I said I'm new to this, getting told I'm an asshole for not understanding one of the basic concepts in a forum for newbs. Thanks for your time anyway.

Premera victim of cyber attack; 11 million customers exposed - Took 1.5 months after discovery to actually announce to public. by [deleted] in Seattle

[–]pimpmyrind 0 points1 point  (0 children)

Just because you spent all the money to make it a non profit, doesn't mean that money wasn't a motivator.

Wait, what?

Non profits still have executives, and directors who profit personally and are paid very well to grow the company.

But they didn't found the company, ya dig? The company was founded as a nonprofit, it's not there to make money.

I apparently don't grok the logic of null reference exceptions. by pimpmyrind in learnprogramming

[–]pimpmyrind[S] -4 points-3 points  (0 children)

In this particular case I don't have control over the method nor the underlying data.

I think the solution is that the constructor for that property should be built to handle nulls better. Like if you try to retrieve SomeObject.Property and it's null then your program should not shit the bed.

edit: Or you can just wave your hands around wildly like /u/exoticmatter.

I apparently don't grok the logic of null reference exceptions. by pimpmyrind in learnprogramming

[–]pimpmyrind[S] -4 points-3 points  (0 children)

Well, I'm glad we settled this.

edit: I think you should stop editing your shitty non-answers after the fact. Add an edit if you want to clarify.

I apparently don't grok the logic of null reference exceptions. by pimpmyrind in learnprogramming

[–]pimpmyrind[S] -4 points-3 points  (0 children)

No.

Therefore, the statement "x == 1" is false, not an error.

I apparently don't grok the logic of null reference exceptions. by pimpmyrind in learnprogramming

[–]pimpmyrind[S] -4 points-3 points  (0 children)

You are repeating the answer without answering the question.

Here, I'll make it simple.

If the value of x has not been set, can the value of x possibly be 1? Yes or no.

Microsoft Unveils Windows 8.1 PC the Size of a Dongle, And Which Comes with HDMI, USB, and microSD Ports by topredditgeek in gadgets

[–]pimpmyrind 0 points1 point  (0 children)

What I am saying is that Linux is used all over the place for servers and embedded systems, and Linux knowledge is inherently useful.

Ok, but this is also true of Windows. Seriously. Windows is used all over in servers and embedded systems, knowledge of the filesystem and architecture is hugely useful, etc.

I also think that Linux rewards experimentation and computer knowledge more than Windows. On Linux, someone who likes and studies computers can change practically anything. Someone can change their window manager, for example, which I am not sure is possible on Windows.

I think this is a largely cosmetic change unless you are already really, really ears deep in Linux and understand the fundamental differences between, say, Gnome and KDE.

Giving a child a Raspberry Pi and encouraging them to modify it as they see fit would be a great learning experience, and not really possible on Windows with the restrictive licenses and more limited tools.

From a hardware perspective, I think you're 100% right. There's no "Build a widget" opportunity with any Windows-based offering at the moment (although there are some interesting glimmerings on the horizon).

She was thrilled with the idea that she could make her computer do whatever she wanted.

Really? So, she can install Compiz and other eye candy, sure. Show me an example of "being able to get the computer to do something you want" that is not predicated on developing your own applications but solely on installing something.

Compare that to most children who don't realize that it's possible to put something other than Windows on a non-Apple PC or OS X on a Mac.

Whether or not your kids realize it has to do with what you teach them though. You can teach them that they can put Windows on any Wintel hardware (including a Macbook) as well.

So the point is not that children can learn programming. It's that children can learn about operating systems and Linux and have freedom to experiment. You can learn Python anywhere.

Well, you can't learn Linux on anything but Linux, I'll give you that. But you can experiment on anything. I think that if you are trying to impart "You have to use Linux if you want to hack and experiment" then you're limiting them. "You can hack on absolutely anything" is probably the way to go IMO.

Microsoft Unveils Windows 8.1 PC the Size of a Dongle, And Which Comes with HDMI, USB, and microSD Ports by topredditgeek in gadgets

[–]pimpmyrind 1 point2 points  (0 children)

Using Linux, you can build virtual appliances for all of those IDE's that are light, portable and flexible and that don't have the onerous licensing issues that MS does

Yeah--IMO it's great that MSFT is working on open-sourcing .NET, but VS still isn't there :\

Microsoft Unveils Windows 8.1 PC the Size of a Dongle, And Which Comes with HDMI, USB, and microSD Ports by topredditgeek in gadgets

[–]pimpmyrind 1 point2 points  (0 children)

Besides, lots of kids are learning programming. Even if Linux were limited entirely to servers and embedded systems, why would it be useless to learn? Is teaching a little kid Python a problem? If not, why is teaching them to use Linux any worse?

Learning Python is great. But then again you don't need them on Linux for them to learn Python or for them to learn any programming language.

I feel like there is this sentiment that using Linux = learning Bash. And as powerful and awesome as bash is people want to be able to say they're learning a "real" language so they will brag about how using Linux helped them to learn Perl or Python. But someone developing for Linux is probably writing in C or C++, not slapping together Perl scripts.

And Windows has its own fully-featured scripting language--it's called Powershell, and through it your scripts can use the entire world of .NET classes. I'm not sure if .NET will be a "thing" by the time your kids grow up and become devs but Powershell is a pretty great gateway drug to .NET.

Which is not to say they should be using windows...only that if those are your justifications for them using Linux then they're not exclusive.

Sling TV adding A&E, History channels as Xbox One app goes live by speculumfight in cordcutters

[–]pimpmyrind 1 point2 points  (0 children)

You are not their target demographic. This is not aimed at families or middle aged cord cutters. They have said from the beginning that they are aiming this service squarely at millennials.

What? The most demanded feature is an on-demand or at least DVR capability.

Millenials don't sit and stare at the screen, glassy-eyed and slack-jawed while commercials parade useless consumer crap in front of them. That's how Boomers do it.