Live data from Hacker News

What's New in C# 6.0 [video]

channel9.msdn.com

101–110 of 145 posts

Re: What's New in C# 6.0 [video]

#101

Still hoping they add the !(non-nullable) operator. I know its hard http://blog.coverity.com/2013/11/20/c-non-nullable-reference... But dang I would appreciate it. So much code is cluttered with null checks that increases the robustness of the code at the cost of correctness, readability, and poorly defined behavior.

In my limited C# experience I found `int?` to be really nice, and an operator to non-null it sounds even nicer. I wonder if there is any chance of Rust getting an abbreviation like `?` so you can write `int?` instead of `Option `. I'm just starting to explore the language, but it seems like a lovely addition.

Rust's syntax has actually been getting more wordy and less variable-y. At least, that's what happened when the changed around Box and some other syntax-sugar'd variables.

I wouldn't expect Rust to go back to shorthand after leaving it.

Re: What's New in C# 6.0 [video]

#102
post #18

While all of the changes look nice in terms of writing less code, they are the kind of syntactic sugar I learned to hate in CoffeeScript. Mostly because the code was so much denser and harder to read. Especially when reading other people's code. As I write more and more code, the more I want simplicity and ease of understanding over typing a few less characters or having more elegant code.

That's fascinating, because Steve Yegge suggests that density tolerance is a factor of skill. http://steve-yegge.blogspot.com/2008/02/portrait-of-n00b.htm...

Re: What's New in C# 6.0 [video]

#104
post #18

While all of the changes look nice in terms of writing less code, they are the kind of syntactic sugar I learned to hate in CoffeeScript. Mostly because the code was so much denser and harder to read. Especially when reading other people's code. As I write more and more code, the more I want simplicity and ease of understanding over typing a few less characters or having more elegant code.

That's fascinating, because Steve Yegge suggests that density tolerance is a factor of skill. http://steve-yegge.blogspot.com/2008/02/portrait-of-n00b.htm...

[deleted]

Re: What's New in C# 6.0 [video]

#105

Earlier quoted context omitted.

IsNullOrWhiteSpace() was added in dot net 4: http://msdn.microsoft.com/en-us/library/system.string.isnull... I agree that Truncate would be a nice one to include in the core.

> IsNullOrWhiteSpace() was added in dot net 4: Look at what the helper actually does. I already addressed this in my comment. string hello = magic(); if(hello.IsNullOrWhiteSpace()) { ... } Is significantly more intuitive than: string hello = magic(); if(string.IsNullOrWhiteSpace(hello)) { ... } Plus it is consistent with things like Contains("XYZ") (e.g. hello.Contains("something")). Truncate is useful just because S…

[deleted]

Re: What's New in C# 6.0 [video]

#106
post #76

Earlier quoted context omitted.

>>> the more I want simplicity and ease of understanding over typing a few less characters True, coming from Java where you have to type a lot to get a simple thing done I seem to be gravitating towards languages which have clean, simple syntax that allows you to actually think about the problem. I've been playing with python and scheme, I'll have a go with C# soon, now its been open-sourced.

Go would fit that definition quite nicely as well. It may be worth adding to your list of things to check out.

Better do it before checking out C#....

Re: What's New in C# 6.0 [video]

#107
post #18

While all of the changes look nice in terms of writing less code, they are the kind of syntactic sugar I learned to hate in CoffeeScript. Mostly because the code was so much denser and harder to read. Especially when reading other people's code. As I write more and more code, the more I want simplicity and ease of understanding over typing a few less characters or having more elegant code.

That's fascinating, because Steve Yegge suggests that density tolerance is a factor of skill. http://steve-yegge.blogspot.com/2008/02/portrait-of-n00b.htm...

Isn't that what the APL/J/K people keeps saying? I guess sometimes it makes sense to optimize for hunting deer rather than optimizing for special forces ops (Even if spec. ops. probably are fierce deer hunters...).

Re: What's New in C# 6.0 [video]

#108

Earlier quoted context omitted.

> New feature: Go To Definition Oh those poor, poor souls who have had to work in C#'s shadow.

Not knowing anything about VB these days, this video almost looks like satire :P

I'm sorry for my coworkers and whoever else around me - I will now shout "NEW FEATURE" constantly.

Re: What's New in C# 6.0 [video]

#109

Still hoping they add the !(non-nullable) operator. I know its hard http://blog.coverity.com/2013/11/20/c-non-nullable-reference... But dang I would appreciate it. So much code is cluttered with null checks that increases the robustness of the code at the cost of correctness, readability, and poorly defined behavior.

In my limited C# experience I found `int?` to be really nice, and an operator to non-null it sounds even nicer. I wonder if there is any chance of Rust getting an abbreviation like `?` so you can write `int?` instead of `Option `. I'm just starting to explore the language, but it seems like a lovely addition.

Rust is trying to reduce the amount of magic in the libraries as much as possible. This means that whatever the language/standard library authors have available to them, third party library authors should also have access to. `T?` would probably run against that, given the previous removal of `@T`, `~T`, `~T`, and `~str` in favor of `Gc`, `Box`, `Vec`, and `String`.

Re: What's New in C# 6.0 [video]

#110

Still hoping they add the !(non-nullable) operator. I know its hard http://blog.coverity.com/2013/11/20/c-non-nullable-reference... But dang I would appreciate it. So much code is cluttered with null checks that increases the robustness of the code at the cost of correctness, readability, and poorly defined behavior.

Aren't you just shifting the problem rather than solving it? For example, let's say I am calling a function which returns an object: var myStuff = new GiveMeStuff().GenerateStuff(1337); The return of this value can be valid "stuff," an exception, or null. If we remove null as an option, what happens when internally an exception is thrown within GenerateStuff()? Does it re-throw that exception? Or do we now need a pro…

Languages like Haskell, Swift, and Rust use an optional type[0] for nullable things. Most things don't need to be nullable, and by being explicit about it in your type you convey your intent - ie. 'this thing might fail, and you must handle it if it does'.

- [0]: http://en.wikipedia.org/wiki/Option_type

Post reply on HN