Live data from Hacker News

Poll: What's Your Favorite Programming Language?

news.ycombinator.com

561–570 of 626 posts

Re: Poll: What's Your Favorite Programming Language?

#561
post #475

Earlier quoted context omitted.

> 1. "Strong and intelligent"? "Convenient"? Not a C# user, but few languages of the strength and intelligence of types in ML. Covariant arrays (which C# presumably adopted for the sake of Java programmers) moves an easy, and obvious, compile time type check to runtime. The type inferencing in C# is very weak relative to ML/Haskell. The type syntax is generally more lighweight in ML/Haskell as well. For example a fun…

C# includes the static LINQ method "FirstOrDefault()" for any types implementing IEnumerable, e.g.: var firstNumber = numbers.FirstOrDefault(); (This isn't strictly the same as what you described if "None" is different from "null".) Once such a method exists, does it matter how many lines of code it is written in? I posit that every language feature in a reasonably intelligently designed language serves a valuable pu…

ML's and C# have their strengths and weaknesses, but from a type theory perspective, ML's type system is simply much more powerful when it comes to ensuring correct code than C#'s. Take, for example, your implementation of Head, what if you messed up and wrote:

> return (list.Count == 0) ? null : list[0];

Would the C# compiler catch it or would you not find out until runtime? An ML compiler would tell you that function is wrong.

What about using Head? If you have a list of integers, will the compiler let you do:

> Head(integer_list) + 2

An ML compiler won't, because it's not safe.

> This isn't strictly the same as what you described if "None" is different from "null".

It is, but the important thing to note is I had to specify that the function, 'hd', can return 'null', by wrapping it in the option type. 'null' is only a valid value for option types. If I write:

> val hd : 'a list -> 'a

I could not return 'null'/None, it simply isn't valid. And the compiler wouldn't let me.

> the 'option' function you have in your example

'option' is a type, not a function (I suppose you can make some high level argument that all types are functions over values or something, but not relevant here). And 'option' itself isn't really even a type, it requires a type variable, so "'a option" is a type where "'a" is replaced by a concrete type at some point. It's not doing the work you described above, it's actually defining a contract between me and users of hd and the compiler.

> With your code, it's easy to break the hd function by changing the implementation to return a different type. You might not even notice the bug if the different type's implementation is close enough to the right one.

No, it isn't actually. If I change the return type the compiler will not compile my code.

> I changed a method to use an integer instead of a string

This cannot happen in ML, the compiler won't compile it because an integer isn't a string. What you described is not type inference, it's dynamic typing. The only danger of type inferencing in ML is annoying type errors during compilation. I'm not sure you actually grok what type inferencing is.

> It also makes refactoring a large project much more difficult in my opinion because there is no way to distinguish between specification and implementation. Consequently, changing your implementation runs the risk of breaking your specification without being informed.

Actually, refactoring code in ML tends to be pretty easy. If you change the type of something the compiler won't compile your code, so you know instantly where you messed up and can fix it. You can construct code to make this not work, but in general that isn't the case. See https://ocaml.janestreet.com/?q=node/101

> let the compiler do that I say!

Exactly, and an ML compiler definitely does more of this than the C# compiler. At a cost, of course.

Your post has several statements which suggest you are ignorant of ML and type theory. If you're interested in learning more, check out Benjamin Pierce's book "Types and Programming Languages". Or just spend a weekend with Ocaml or Haskell and prepare for the compiler to frustrate you with it's strictness :)

Re: Poll: What's Your Favorite Programming Language?

#563

Earlier quoted context omitted.

FYI, Python has an automated script for migrating code from Python 2.x to Python 3.x

You should tell Django guys they should be thrilled to hear it.

Here's an interesting blog from the Django developers about their plans for python 3: https://www.djangoproject.com/weblog/2012/mar/13/py3k/ The short of it is that they are planning to move for sure and with each release of Django they drop support for one of the 2.x releases of python. Django 1.5 (the next major version) will experimentally support python 3.

Re: Poll: What's Your Favorite Programming Language?

#564

Earlier quoted context omitted.

I have to agree with this. If only ruby or python had such a powerful development environment (sigh). There's simply nothing in the open source community that rivals the beautiful, simple power of that IDE and language combination. Tools matter when you're trying to ship code.

The beauty of Ruby and Python is that you aren't restricted to an IDE in order to use them; I wouldn't enjoy using them if I was. I like to choose my own tools. This isn't quite so easy when using an all-encompassing (and platform specific) IDE like Visual Studio. I use tmux (with tmuxinator), with windows for my editor, shell, debugger, source control, logs. I'm able to, effortlessly, change any part of it.

I'm not sure what this means. Are you saying it is impossible to write C# code without the IDE? If so, my .vimrc would like to have a few words with you.

Re: Poll: What's Your Favorite Programming Language?

#566

Earlier quoted context omitted.

Which targets are you using? Wouldn't be awkward to use Haxe for a project that employed language specific APIs? It seems like the sweet spot would be using it to write basic libraries that had no external dependencies.

C++, Flash, and Tamarin and Neko experimentally. Platform specific APIs are awkward, which is why it's mainly used for writing games. NekoNME abstracts most of that away. I'm not so sure how easily it does node.js. But the standard runtime for Haxe has been ported to the other languages in a fairly bulletproof way.

So the end result is being able to make games that run in the browser and on the desktop from the same source code?

Any other reason why someone might want to use it?

Re: Poll: What's Your Favorite Programming Language?

#567
post #172

C# really feels like the most mature language that I've ever dealt with. Writing it feels clear, if something is wrong the debugger is very clear. The number of features that are there is incredible (especially post C# 2.0 when they added generics). Properties are delightful. How do you convert to a string? Convert.ToString(). How about an integer? Knowing only that one, it's what you'd expect! I also picked JavaScri…

I've spent most of my time in the open source world, and I would have to agree that C# on .NET feels like the most mature high-level software development tool I've ever used. C#'s biggest strength isn't the language. While the language is nice, there isn't a lot you can do with it in terms of productive development that you can't at least approximate in Java, especially with a good IDE to generate your boiler plate f…

> It also feels so incredibly easy to call native code in C#. There's even a whole web site dedicated to making it easier, pinvoke.net!

I'm with you that C# is really nice to use, but interfacing with native code is a nightmare. The reason why a whole bunch of websites exist on pinvoke is because of its poor documentation and incoherent behavior.

As far as low level goes, I'm happy with C++ (if I were an embedded engineer I would say C but it is very nice to be allowed to use the C++ niceties). I think that everyone needs to have a language that can generate native code. On higher levels, python is fine for me. I simply do not have the use for an intermediate language like C# or Java, however nice they are.

Re: Poll: What's Your Favorite Programming Language?

#568
post #426

Earlier quoted context omitted.

Well, I'm not the gp, but I am a former C# guy who's happy to be out of that world. 1) I dislike C#'s types; they're neither as strong and intelligent as a ML/Haskell language nor as convenient as a Python/Ruby family language. 2) I much prefer the sense of design displayed by Python and Ruby open source projects over C#. (Not that there aren't issues there!) 3) I hate Visual Studio. Nice debugger, crappy interface f…

As someone who's more than happy with C#, I'm wondering if there's a world out there I'm missing but I can't really connect with what you're saying. 1. "Strong and intelligent"? "Convenient"? 2. "Sense of design"? My current side project includes a web scraper which uses the following open source projects: AutoMapper, CsvHelper, HtmlAgilityPack, Twitter Bootstrap, jQuery, Modernizer, Moq, NLog, MongoDB C# driver, Pet…

The only way to know if there is a world out there that you're missing is to go explore it. The biggest problem with the .NET world is that the vast majority of .NET developers have spent the vast majority of their time in it.

Re: Poll: What's Your Favorite Programming Language?

#569

Earlier quoted context omitted.

And no self-respecting developer would ever use Mono on nix anyway because the nix tools run circles around anything .NET/Mono.

I knew this would be downvoted by the predominantly Windows users here but, if they knew anything about *nix, they wouldn't do that.

You were downvoted because you made an argument without supporting it, and you were downvoted again because you complained about being downvoted and still didn't provide support for your argument.

From what I gather, HN isn't so much about being part of an "in-crowd" where you "just know" the way things are. You need to be willing to explain your arguments, otherwise you're just a snob.

Re: Poll: What's Your Favorite Programming Language?

#570
post #316
post #216

Earlier quoted context omitted.

I like Mono, and I respect the work that they've accomplished. It is incredibly difficult to build a runtime like .NET, especially as it was never designed to be cross-platform. That said, the Mono experience on Linux is inferior to that on Windows. MonoDevelop is nowhere near Visual Studio, so that I just develop on Windows and deploy on Linux. Unfortunately, that doesn't help the fact that both the soft and hard de…

I use MonoDevelop every day with Unity. I sometimes hear other devs complaining about it, and saying how Visual Studio is so much better. I think back to the days I used to spend struggling with multi-project solutions in Visual Studio with all its warts and crashes and weird compilation bugs, and thank heavens I'm working with a light-weight IDE. C# is my new favourite language, and MonoDevelop is a pretty decent ID…

In my experience, these are the problems with developing in MonoDevelop for Unity:

- The debugger is flaky. Sometimes it will miss a breakpoint completely. Sometimes trying to inspect local variables will crash MonoDevelop. Sometimes it will refuse to continue no matter how many times you tell it to.

- If your problem starts in Unity's native code, forget about trying to debug it. The messages are cryptic and the debugger is useless. This happens for some things you can diagnose (like running out of memory, either on the machine or the card)--although good luck figuring out what your memory hog was--and for other things that leave you completely stumped (shotgun debugging becomes your only recourse).

- Don't even attempt to use text search over multiple files (other searches, like reference searches, work fine). MonoDevelop will get stuck in an unproductive loop that never displays any results and never completes.

- Forget about profiling. Unity technically has a profiler, but it's per-frame, not cumulative. It also omits a lot of detail, especially about memory usage.

- There are also a number of minor issues, too, but they aren't deal breakers so much as annoyances.

That having been said, our particular project is rather good about pushing Unity to (and beyond) its limits, and you may never encounter any of these limitations. Still, it's worth knowing that they exist.

Footnote: These comments may be limited to the version of MonoDevelop that ships with Unity 3.3 (there are non-technical reasons why it's not worth our time to go through the effort to upgrade).

Post reply on HN