Unsafe code( pointers ), shows and example of a copy, where a byte* is casted to a int* and then dereferenced. Such operation in c produces undefined behavior( even if byte points to data large enough ). Safe or not, does c# consider such dereference as defined behavior?
There is no concept of "dereferencing" in C# because there are no pointers. Technically it is possible to force the environment to allow you to write unsafe code but I've never seen this in reality and I'm having a hard imagining where it would be useful.
C# Tutorials
41–50 of 66 posts
Re: C# Tutorials
#42Or GACs, or finding the right System.Data.SQLite module for your app - http://system.data.sqlite.org/index.html/doc/trunk/www/downl...
Or figuring out how exactly deployments/setups work - where things get put, etc.
I don't know much about java - but it seems easier there - here is the .jar, simple .zip file, look at the manifest - and you are done.
Re: C# Tutorials
#43Top things I miss in C# - Null coalescing operator - Tuple Construction/Deconstruction - Algebraic data types/Pattern matching - List comprehensions/array slicing - Operators in interfaces After 10 years of C# I really feel that F# is the future.
First sample is C#?
Re: C# Tutorials
#44Earlier quoted context omitted.
C# is years ahead on the language feature side: - lambdas - Expression trees - sensible operator overloading - value type semantics (you can define your own types that behave like primitives) - reified generics instead of type erasure, which means that you can have an table (just two ints instead two pointers to Integer) - "async monad" baked into the syntax On the other hand, Java wins easily on the open source lib…
The way I heard it put some time ago was, Java/JVM couldn't make some important changes because it would break backwards compatibility in an unacceptable way (I'm assuming this means there are mission critical apps written in Java 1 that the whole world depends on), but since C#/.NET were from scratch, they were free from this legacy baggage and could take huge steps forward.
That being said, Java broke other things along the way back then, if I remember correctly, so in hindsight type erasure for fake generics was maybe not the smartest choice.
Re: C# Tutorials
#45Top things I miss in C# - Null coalescing operator - Tuple Construction/Deconstruction - Algebraic data types/Pattern matching - List comprehensions/array slicing - Operators in interfaces After 10 years of C# I really feel that F# is the future.
Re: C# Tutorials
#46I'm still confused by the use of '.' to conflate namespaces & classes, and other things together. A separate character, like ':' or something else would've helped me :) Or GACs, or finding the right System.Data.SQLite module for your app - http://system.data.sqlite.org/index.html/doc/trunk/www/downl... Or figuring out how exactly deployments/setups work - where things get put, etc. I don't know much about java - but…
Install-Package System.Data.SQLite
In your VS package manager console and you are good to go.Deployment/Setup is not really something C# or .NET cares about, there are many different forms of deployment. (IIS, Windows desktop, ClickOnce, Azure) and in each case you can do it in several different ways. I agree it's tricky to know what goes where sometimes, but it's more a problem with those targets than with how you build the application in question.
Re: C# Tutorials
#47Earlier quoted context omitted.
> C# is only really practical for Microsoft's platforms. Not necessarily. If you're doing game development with Unity3D, for example, you're probably going to write much of your game in C#, and it's going to run on Windows, Linux, OS X, Android and iOS.
Wish it was true. It has never been true and it is unlikely to be true in near future. Try some non toy F# on windows and on Mono and you will know. Mono leaks, and if you rely on correct behavior of tail calls, you are in for a lot of grief.
It is true. You appear to be talking about something else.
Re: C# Tutorials
#48Top things I miss in C# - Null coalescing operator - Tuple Construction/Deconstruction - Algebraic data types/Pattern matching - List comprehensions/array slicing - Operators in interfaces After 10 years of C# I really feel that F# is the future.
var t = new Tuple(1, 2);
I apologize if I misunderstood you.Re: C# Tutorials
#49Top things I miss in C# - Null coalescing operator - Tuple Construction/Deconstruction - Algebraic data types/Pattern matching - List comprehensions/array slicing - Operators in interfaces After 10 years of C# I really feel that F# is the future.
Uhm http://en.wikipedia.org/wiki/Null_coalescing_operator First sample is C#?
Today you write something like this
var street = (user != null && user.Address != null) ? user.Address.Street : null;
When you could use something like this var street = user?.Address?.Street;Re: C# Tutorials
#50Top things I miss in C# - Null coalescing operator - Tuple Construction/Deconstruction - Algebraic data types/Pattern matching - List comprehensions/array slicing - Operators in interfaces After 10 years of C# I really feel that F# is the future.
What exactly do you mean by "Tuple Construction/Deconstruction", honest question ? What's the problem with : var t = new Tuple (1, 2); I apologize if I misunderstood you.
var p = SomeFunc();
print("X value is "+p.X);
You would do this (x, y) = SomeFunc();
print("X value is "+x);