Earlier quoted context omitted.
I don't understand. Are you saying that map, filter, reduce and al. on lazy sequences in functional languages are inferior to loops, or that Python list comprehensions and generators are inferior to loops? That's basically LINQ to objects. Maybe you're refering to LINQ-to-whatever (LINQ to SQL, etc.), a LINQ generalization where you can quote your expressions, rewrite the AST and emit something else (a very constrain…
In the vast majority of cases it is nothing more than syntactical sugar around loops. And no, I'm not saying that loops are superior, but rather I'm saying that loops are usually a terrible solution, but LINQ has a way of essentially hiding those egregious violators. Take a block of code with LINQ in it and rewrite it minus LINQ but logically performing the same operations that the sugar is resolving to. To most deve…
Why C# is the best language for mobile development
71–80 of 125 posts
Re: Why C# is the best language for mobile development
#72Earlier quoted context omitted.
"var" is not dynamic typing. It's just a way to enable type inference - it's still as static as can be. It also has a very limited useful scope in C#, as type inference isn't supported in most areas.
There is only one place where the type inferencing is not supported, field declarations. Not sure how that became "most areas".
Places lacking type inference:
- Parameter definitions
- Method return types
- Generic type parameters (sometimes)
- Lambda expressions (due lack of syntax to indicate quoted code)
- Field declarations
The only place type inference works for declarations is in local variable declarations and lambda parameter types if the delegate type is known.Perhaps the definition of "most" is arguable, but C# has many places that need you to unnecessarily specify types, and there's no good theoretical reasons for any of it, right? (Except the whole syntax sharing for expression trees versus anonymous functions, which is debatable.)
Re: Why C# is the best language for mobile development
#73Earlier quoted context omitted.
And if you've worked on a large project with a lot of cats to herd for both platforms, you will appreciate java very quickly.
I work on a pretty huge C# code base. Use of LINQ is the least of it's problems. If anything I'd say one problem is people not knowing about things like lambda expressions, linq, generics or whatever. It can really make code harder to parse when it's written in ways that don't take advantage of the full power of the platform.
List, string>>>
Re: Why C# is the best language for mobile development
#74Calling it "cutting-edge" is an exaggeration, too.
Re: Why C# is the best language for mobile development
#75Earlier quoted context omitted.
Well, off the top of my head C# doesn't support mixins or multiple inheritance. You can get around the lack of mixins with extension methods and tight scoping but it's messy.
That is a false statement. dynamic C# 4.0 can do mixins: http://amirrajan.net/Blog/dynamic-c-sharp
this is another example of adding mixins to .net code via 3rd party library: http://remix.codeplex.com/
Re: Why C# is the best language for mobile development
#76As languages go, C# may be the ultimate "middle ground" because it really excels and providing a middling implementation of [your-favorite-language-feature]. That is, if you're a functional programming enthusiast, you can do a lot of functional programming in C#. Sure, it's often more painful than haskell or lisp or F#, but it's workable. If you're a dynamic programming enthusiast, C# has a perfectly workable (but ul…
Sorry, but you're really attacking a straw man here. Neither C# itself nor the OP's article sell C# as being a prime language for functional, dynamic, or systems programming. Rather, it has inherited some convenient little bits of each paradigm to make the language that much nicer to write. For example, don't want to redeclare that "List >" you're copying over because it has a scope of 2 lines? Just dynamically type…
Re: Why C# is the best language for mobile development
#77Earlier quoted context omitted.
I work on a pretty huge C# code base. Use of LINQ is the least of it's problems. If anything I'd say one problem is people not knowing about things like lambda expressions, linq, generics or whatever. It can really make code harder to parse when it's written in ways that don't take advantage of the full power of the platform.
Yes until we get to: List , string>>>
Re: Why C# is the best language for mobile development
#78Earlier quoted context omitted.
This is a fundamental place where the worlds of C# and Java differ. Where the Java world would say, "developers might misuse this, better not have it in the language," the C# world says, "developers could really use this, better put it in the language."
And if you've worked on a large project with a lot of cats to herd for both platforms, you will appreciate java very quickly.
Re: Why C# is the best language for mobile development
#79What is he comparing to? Arguments #2-#5 & #7 seem to apply to Java as well, and #6 just quotes an extremely lopsided benchmark exploiting one specific feature of their C# implementation. Most of the arguments would apply to Objective C too, I presume (though I haven't really used that outside of toying around). I'd personally expect we'll see a lot more JS for mobile apps: a terrible language compared to C#, but a v…
Re: Why C# is the best language for mobile development
#80"Async support as a first-class feature" - that's actually a flaw. C#'s async implementation would be better served by having e.g. a generic monad system that allows async to be done in a library. Instead, it's another baked-in compiler feature, like C#'s duck typing and LINQ's query operators. Calling it "cutting-edge" is an exaggeration, too.
What is "cutting-edge" varies from person to person. Some people are easily impressed.