Live data from Hacker News

Why C# is the best language for mobile development

blog.xamarin.com

81–90 of 125 posts

Re: Why C# is the best language for mobile development

#81
post #32

Earlier 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.

C#'s (and Java's) lack of multiple inheritance is a virtue, IMO.

I generally agree that use of mixins / multiple inheritance leads to architectural missteps.

Re: Why C# is the best language for mobile development

#82

As 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…

Just an aside: I don't think you can really say "dynamic programming enthusiast" to mean "dynamically-typed language enthusiast", since "dynamic programming" already means something quite different. It threw me a bit, at least.

Re: Why C# is the best language for mobile development

#83
post #45

Earlier quoted context omitted.

LINQ is pretty sick and if obj-c has a similar feature I have never seen it.

Eh, disagree. It's confusing for a number of reasons, firstly because instead of choosing the common functional names -- map, filter, reduce, flatten, etc. they choose to go with SQL-like naming. Just an annoyance. Secondly, Expressions are a clever hack on top of the language, but they are not intuitive for the person using them and requires you to know too much about the particular implementation you are using (for…

Is there any other quotation-based system that _doesn't_ require you to understand the implementation? Or any language/runtime/library? SQL is different from one DB to the next, and a lot of C APIs are not implemented identically on all OSes.

As to the names, I'm not sure it's safe to assume that "Map" would result in better usability than "Select", for MS's target audience.

Re: Why C# is the best language for mobile development

#85
post #75

Earlier quoted context omitted.

That is a false statement. dynamic C# 4.0 can do mixins: http://amirrajan.net/Blog/dynamic-c-sharp

so, yes this leveraging of dynamic metadata provider technically satisfies the requirements for a mixin, but you're still not applying this mixin to a poco, therefore i don't think it's fair to say the language/spec supports it natively. this is another example of adding mixins to .net code via 3rd party library: http://remix.codeplex.com/

"but you're still not applying this mixin to a poco"

Clarify?

Re: Why C# is the best language for mobile development

#87
post #57

As 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…

Whoa, I'm not attacking anything. I like C# a lot, but I think I'm realistic about it -- it's nobody's perfect language, except in the case of "what's a widely-adopted, multi-paradigm language that I can do typical OO stuff in, but also all that cool dynamic and FP stuff they talk about on hackernews all the time? Also, my coworkers need to be able to understand it?" That's why at the end of my reply I say I think it's one of the best "workhorse" languages.

Anyway, I'm sure others will point this out, but var is NOT dynamic typing. It's type inference, which you seem to know, judging by the last sentence in that paragraph. Dynamic typing doesn't just mean that no type is declared -- it means that no type is inferred (by the compiler).

Re: Why C# is the best language for mobile development

#88
post #73

Earlier 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>>>

If you're doing that it's crap code; you should have defined a few named object types. Maybe your "Dictionary" is e.g. actually a "PropertyMap". this is not a problem in the c# language.

See also: "primitive obsession" http://c2.com/cgi/wiki?PrimitiveObsession http://sourcemaking.com/refactoring/primitive-obsession

Re: Why C# is the best language for mobile development

#89

"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.

It's not a flaw. Arguably it's worse than having a generic mechanism, but it's certainly not worse than having to use explicit callbacks, as in essentially all other popular languages (and previous versions of C#).

Re: Why C# is the best language for mobile development

#90

While a bit of an aside, personally I find LINQ to have been a horrendous misstep in the evolution of the language. While the argument that it makes code more concise and easy to maintain holds in the small, once a project grows it becomes a terrible cancer -- everything becomes an amorphous blob of stuff, unintuitive, performance-disaster LINQ filters applied everywhere to bend it into shape.

> I find LINQ to have been a horrendous misstep ... grows it becomes a terrible cancer -- everything becomes an amorphous blob of stuff, unintuitive, performance-disaster LINQ filters

I couldn't agree less. Any language construct can be abused, but LINQ is not particularly susceptible to abuse, unless you try very hard.

Post reply on HN