I learned to code with python, php, and javascript mostly. I could never get into visual studio / .net, it always felt so long winded compared to python.
Understanding .NET 2015
41–50 of 107 posts
Re: Understanding .NET 2015
#42Earlier quoted context omitted.
It's pretty trivial to implement Linq-like functions in JavaScript, or, I think stuff like undersocre has them.
It is and it isn't. LINQ is actually incredibly smart under the hood, so if I ran: myList.Where(x => x.name = 'Person'); .Where(x => x.age > 18); .ToList(); it wouldn't actually run two different array filters - it would combine them. You can imagine the performance gains to be had there.
_(myList)
.filter(x => x.name == 'Person')
.filter(x => x.age > 18)
.value()
Used like this Lodash is lazy, so the first value of myList will run through all the filters before the next item gets processed.Re: Understanding .NET 2015
#43Earlier quoted context omitted.
I spend most of my time in C# and it's always a sad moment when I start typing .Where(x => ...) in another language and realize it doesn't exist.
It's spelled filter http://en.wikipedia.org/wiki/Filter_%28higher-order_function...
Re: Understanding .NET 2015
#44Earlier quoted context omitted.
It's spelled filter http://en.wikipedia.org/wiki/Filter_%28higher-order_function...
I don't mind C# not using that name because .Where doesn't actually filter the object, it returns an IQueryable, which you can chain further statements onto, then filter.
Re: Understanding .NET 2015
#45Earlier quoted context omitted.
> I liked some of the generics handling better, it can be less verbose it seems. It pays off in spades in a lot of situations, but the biggest I've noticed is Android development. Hitting a network from a button press in Xamarin is as simple as: button.OnClick += async { var data = HitTheNetworkForSomeData(); // Note that since this is still async, // you may want to set a global or have a // different approach to ha…
It's a shame Android is still stuck on Java pre-8, as your Java example could be nearly as consise as the c# with Java 8.
Re: Understanding .NET 2015
#46Earlier quoted context omitted.
"we'll start seeing more back-end usage of .NET." Outside of startup world, it is already used everywhere.
Well, I can assure you that Java is used.. more everywhere.
C# - 16748 jobs [1]; Java - 13816 jobs [2]
Re: Understanding .NET 2015
#47Earlier quoted context omitted.
It's pretty trivial to implement Linq-like functions in JavaScript, or, I think stuff like undersocre has them.
It is and it isn't. LINQ is actually incredibly smart under the hood, so if I ran: myList.Where(x => x.name = 'Person'); .Where(x => x.age > 18); .ToList(); it wouldn't actually run two different array filters - it would combine them. You can imagine the performance gains to be had there.
Re: Understanding .NET 2015
#48Earlier quoted context omitted.
It's a shame Android is still stuck on Java pre-8, as your Java example could be nearly as consise as the c# with Java 8.
In this particular case, yes. Another issue that comes up is when you've got fairly type-heavy code. C# having real generics just makes things much simpler than in Java.
Having said that, more is possible with Java than many people realise. You can read statically available generic type params at runtime (field declarations, supertype tokens etc) . There are also workarounds for most of the erasure problems like methods that vary by generic type parameter only.
Java has some nice things itself too. Structural typing of single method interfaces/lambdas makes numerous things much easier. Default methods on interfaces let you do trait-like things nicer than with extension methods. Static imports reduce verbosity. More powerful enums etc.
c# approach to type inference seems to be to infer the left hand side of expressions with "var". Java infers types on the right hand side with the diamond operator, method type parameter inference, lambda to interface type inference. The Java approach makes code using fluent chained invocations less verbose, while the c# approach reduces the verbosity of assigning to lots of intermediate variables.
Re: Understanding .NET 2015
#49Earlier quoted context omitted.
> I liked some of the generics handling better, it can be less verbose it seems. It pays off in spades in a lot of situations, but the biggest I've noticed is Android development. Hitting a network from a button press in Xamarin is as simple as: button.OnClick += async { var data = HitTheNetworkForSomeData(); // Note that since this is still async, // you may want to set a global or have a // different approach to ha…
You don't need to use Java for Android or for the JVM, you can just use Scala. See Scaloid [1] for setting up Scala for Android and Scala Async [2] to get that nice "async" syntax you've mentioned. [1] https://github.com/pocorall/scaloid [2] https://github.com/scala/async
Re: Understanding .NET 2015
#50Earlier quoted context omitted.
Just out of curiosity, what is your go-to language? C# is probably my favorite general purpose language so far, although I really prefer Golang's goroutines/channels over C#'s async model. Curious to hear other perspectives!
Python for smaller self-contained projects and scripting. Erlang/Elixir for larger projects where fault tolerance or concurrency is needed. C/C++ where GC is a no-go (games, low latency, time critical data processing). Next up in the pipeline to learn and use: Rust
Ever played something like e.g. Bastion?
http://en.wikipedia.org/wiki/Bastion_%28video_game%29
I mean if you are developing the new Unreal Engine - sure. But otherwise gaming industry would benefit from more of maintainable code.