Th3 121 Share Posted January 23, 2015 A lazier approach to what? Implementing true default values? Nulls can't be used, they're only there to check. You shouldn't have to check; you should just do what you wanna do based on the value inside. It's not lazy; it's the only way to achieve true object oriented programming. Checks are no longer needed, so sit on that, why dontcha. I could give examples, if you'd like, although I would think a Cambridge graduate would know better Many sites use Java (facebook, google, ect..). Research just isn't your thing, is it? Im sorry, but after that, you should probably back down and let dogerina take over Yeah, right now it's just a pattern, because that's all it can be in Java. In other languages, though, it's a standard, and for what I find to be a good reason too. Like I said, I never said null was bad; this was just an article about how languages are removing it as a mandatory specification, how null can be replaced (how this is even possible; some people cant wrap their minds around not using null, since it's so common). Programming is advancing, and it seems as if it's moving towards the removal of null. This was just a topic about that. Nulls will always exist in Java (for backwards compatability), so it'll always be nothing more than a pattern in Java. For other languages, not quite so, and there's reason behind it Ok, so you told us about null patern, u showed us example, we said it can be used but not always and what we are still talking about? What you want to do there convice us all tu use that pattern or what? I dont get you, its very nice of you to show some things but am thoose things arent really discussable on such forums, we can just tell cons and pros of such things you cant tell us "this is good for everything, you must use it." And now, can we stop it ;o? Just stop it right there. This aint going anywhere word has been spoken. From the cutie known as @Polish Civil Link to comment Share on other sites More sharing options...
Dogerina 330 Share Posted January 23, 2015 You are accessing behavior you want to be performed if no specific value is specified. You don't need to perform a check in fear of getting an error. You could instead perform the default behavior (which might be "do nothing") aaaaaaand dogerina is about to come in with a countermeme!!!!!11 ok now lets say Item[] meme = getItems(); sout(meme.length); //omg prints 5k for (Item wow : meme) { wow.click(); //wow is clicking empty item omg watdo?? } imo should just return null or throw exception. Link to comment Share on other sites More sharing options...
Dioxin 29 Author Share Posted January 23, 2015 Ok, so you told us about null patern, u showed us example, we said it can be used but not always and what we are still talking about? What you want to do there convice us all tu use that pattern or what? I dont get you, its very nice of you to show some things but am thoose things arent really discussable on such forums, we can just tell cons and pros of such things you cant tell us "this is good for everything, you must use it." And now, can we stop it ;o? Just stop it right there. This aint going anywhere word has been spoken. From the cutie known as @Polish Civil Dogerina and Swizz still feel it's unreasonable. I'm trying to explain why it's reasonable, and how their thoughts on it being unreasonable is based on (bad) theory, and testing it would erase their fears. Not saying anyone has to use it. I'm just rejecting all the comments on it being unreasonable when looking at it from a resource aspect. That just shows me that no one cares to test things before making assumpsions. I really don't think I'm going to last here long just because of that. I'm not saying I'm far more advanced than anyone, I'm just saying at least I look into what I'm talking about, and I've performed many benchmarks on many different ways of handling your flow of execution and logic. All I ask for is for people to confirm what they say before coming at me with false info /: aaaaaaand dogerina is about to come in with a countermeme!!!!!11 ok now lets say Item[] meme = getItems(); sout(meme.length); //omg prints 5k for (Item wow : meme) { wow.click(); //wow is clicking empty item omg watdo?? } imo should just return null or throw exception. It would print 5k due to Java's lack of support for true default values. Open your mind. And wow isnt "clicking empty item". Wow is an empty value which performs whatever is set as the default behavior. Also, if getItems() returns an array with null values, it'll still print 5k if there are 5k null values in it. You guys are too tied down to how Java handles things. We already covered that Java isn't a good example for languages anymore. But even though Java doesn't support true reference default values, we can create out own to get the same processing effect Link to comment Share on other sites More sharing options...
Dioxin 29 Author Share Posted January 23, 2015 Damn guys, you really make me feel like the guy who told the everyone the world isn't flat. Please open your minds.. null is not some almighty "nothing" value; it was just a quick fix for default reference values. Seeing how new OOP was when Java came around, it's not surprising they didn't know how to efficiently implement a true default value system for types that are to be created (reference types). We've advanced a lot from that, and now Java is trying to add all these features to get rid of nulls (@NotNull) or replace them with default values (Optional) Link to comment Share on other sites More sharing options...
Dogerina 330 Share Posted January 23, 2015 I know it performs the default behaviour, you seem to have misunderstood my point. Let's say that for some reason, 4999 items were null and 1 wasn't. It would be calling a method 4999 times for nothing. NOTHING NOTHING NOTHING NOTHING NOTHING NOTHING and NOTHING like i said i suggest you read up on the basics null is a quick fix for default values? your thing is too except it's bad. you're saying my theory is bad when in reality yours is hop on my big blak dong Link to comment Share on other sites More sharing options...
Dogerina 330 Share Posted January 23, 2015 in your previous 10 or so posts you've managed to explain valid points as to why returning empties would be good but you haven't actually mentioned a _GOOD_ point saying why null is bad. in my previous posts, i've said why returning empties is bad and why null should be used. get rekt shitkid #yoloswagblazeit420getn00btubed Link to comment Share on other sites More sharing options...
Dioxin 29 Author Share Posted January 23, 2015 I know it performs the default behaviour, you seem to have misunderstood my point. Let's say that for some reason, 4999 items were null and 1 wasn't. It would be calling a method 4999 times for nothing. NOTHING NOTHING NOTHING NOTHING NOTHING NOTHING and NOTHING like i said i suggest you read up on the basics null is a quick fix for default values? your thing is too except it's bad. you're saying my theory is bad when in reality yours is hop on my big blak dong It would be optimized out after a few calls, of course. Not to mention, if Java had better support for default values, you could easily have the VM ignore certain calls. This system is not as cheap of a fix as null is. Null really has no intentions of being a value, which is why we get errors for trying to use one and why we do null checks. Without nulls, no null-checks. Null check themselves encourage imperative programming (as I've mentioned PLENTY of times), which the VM doesn't have as much optimization support compared to object oriented designs. If you want a reason of why I dislike null, it can't contain behavior, meaning we must perform a check in order to get past the error we get from using it. It's noise. All we want is to exexute code based on the value. If there is "no value" (using our default value), it would easily do nothing without having to be told to explicitly with a condition. It allows for smoother processing, since you're getting straight to the point (executing behavior based on a value) rather than checking if it contains a value or not. The check is not needed, but using nulls force you to do so I think @Dioxins cock shrunk 5 inches during this conversation No, but I do feel my IQ slowly dropping due to your presence. How about contributing to the debate? Link to comment Share on other sites More sharing options...
Dogerina 330 Share Posted January 23, 2015 do u like playin hard 2 get, ur a stubborn 1 m8, gr8 b8 a lot of your points are 'if java had blablabla' well it doesnt, so no fucks are given >_> Link to comment Share on other sites More sharing options...
Swaq 243 Share Posted January 23, 2015 If I see any more flame, the infractions will start. Keep this kind so everyone can learn or put their opinion/knowledge in. Link to comment Share on other sites More sharing options...
Dioxin 29 Author Share Posted January 23, 2015 in your previous 10 or so posts you've managed to explain valid points as to why returning empties would be good but you haven't actually mentioned a _GOOD_ point saying why null is bad. in my previous posts, i've said why returning empties is bad and why null should be used. get rekt shitkid #yoloswagblazeit420getn00btubed Who said this article was purely Java related? I gave reasons already, you just never cared to hear them out. I could give tou the exact same reply. I guess I shouldn't expect more from someome who works with only a single language. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.