11

Compared to C#, Boo feels a bit more Pythonic but it's also compiled down to .NET MSIL. I liked its syntax, even more than C#'s syntax. But I couldn't find a single book teaching Boo.

And I really don't know, if learning Boo is better than C# or learning C# is better than Boo. I just want to use some Python-like data types. Those are:

  • {key1:value1, key2:value2} → dictionary
  • [Value1,Value2,Value3] → List (can be edited/changed)
  • (Value1,Value2,Value3) → Tuple (can't be edited/changed)

I use dictionaries more than list and tuples. I want to know, which one is better?

PythEch
  • 932
  • 2
  • 9
  • 21

5 Answers5

15

I have found Boo to be very useful in creating simple one-off scripts, while retaining my Pythonic source style. And since it compiles to runnable EXE or DLL, I can package up a single EXE with all the needed DLLs (including Boo.Lang.dll) using ILMerge, and then send that off to a client, usually for some kind of quick troubleshooting or system diagnosis.

I also use Boo to support my C# development. I often fire up a Boo interpreter to try out variations of string or date formatting, then I can replicate the final version almost directly into C#.

But it is darned difficult to find docs for Boo. I had to Google quite a bit to find the syntax for generics, since they are a relatively new addition to Boo, and not yet mentioned in any tutorials, or even reference pages. And googling for "boo" generates quite a few unwanted hits, making the search even more difficult.

So in short, don't make this a choice between Boo and C# - they actually complement each other pretty well.

PaulMcG
  • 62,419
  • 16
  • 94
  • 130
5

My general opinion is that it would be better to go for C# since it is from my point of view, easier to find resources, documentation and tutorials for C#.

Jonas B
  • 2,351
  • 2
  • 18
  • 26
  • 1
    Nothing wrong with VB.NET either. Technically, that is. People who dislike it usually just don't like the smell of it, they don't actually understand VB.NET. The only truthful complaint I've seen against it is that its syntax is rather verbose, but to me that's a strong point. By now, many VB.NET features have been added to C# (and vice versa), the languages differ in little except the surface syntax. – reinierpost Oct 06 '09 at 11:06
3

Knowing C# will be very useful to you if you want a career in .NET development. But learning Boo would allow you to use the Python-like features you are after in a .NET environment. You should probably also look into IronPython, which does have books available (Iron Python in Action)

Mark Heath
  • 48,273
  • 29
  • 137
  • 194
2

You have lists and dictionaries in .Net: System.Collections.Generic.List and System.collections.Generic.Dictionary.

As for the language: Just learn the one that is more fun for you. The choice of language is most often religious. Expecially on the .Net platform, where each language has almost the same capabilities.

Maximilian Mayerl
  • 11,253
  • 2
  • 33
  • 40
  • "where each language has almost the same capabilities" that only applies to C# vs VB – Mauricio Scheffer Oct 06 '09 at 13:29
  • You think so? I don't...I can, for example, do almost everything I can do in C# do in C++/CLI. And I'm sure that I can do almost anything I can do in Boo in C# too somehow. The only different thing would be dynamically typed languages like IronPython, and that will change too in C# 4. – Maximilian Mayerl Oct 06 '09 at 14:01
  • try creating a boo-like DSL in C# (even 4.0) or C++. See http://blogs.codehaus.org/people/bamboo/archives/001588_dslfriendly_syntax.html – Mauricio Scheffer Oct 06 '09 at 17:22
  • try writing an extension for C# (even 4.0) or C++ to add pattern matching *to the language*. see http://blogs.codehaus.org/people/bamboo/archives/001620_a_pattern_matching_facility_for_boo.html – Mauricio Scheffer Oct 06 '09 at 17:24
  • try doing pattern matching in C# (even 4.0) or C++ or IronPython like you can in Boo or F# – Mauricio Scheffer Oct 06 '09 at 17:26
  • Try redefining if in C# or C++ http://ayende.com/Blog/archive/2007/10/04/Redefining-If.aspx – Mauricio Scheffer Oct 06 '09 at 17:29
  • more examples: http://stackoverflow.com/questions/193862/boo-vs-ironpython/448971#448971 – Mauricio Scheffer Oct 06 '09 at 17:31
  • try doing string interpolation in C# or C++, like you can on Boo or Nemerle. – Mauricio Scheffer Oct 06 '09 at 17:34
  • Yes, this are sure nice features (I love Nemerle, btw.), but it's nothing that you ultimately NEED. In the end, you can be productive to the same extent in almost any .NET language. Of course, it depends on what you want to code, but as I said: take the one that's most fun for you. I think the language which is the most fun will be the one which is the most practical for the things I want to code. – Maximilian Mayerl Oct 06 '09 at 18:02
  • I guess we'll have to agree to disagree on this one :-) – Mauricio Scheffer Oct 06 '09 at 19:02
0

I'm not sure what your end goal is, but before you give up on python please do check out the python/Qt combo for building a gui. You can build complex cross-platform guis and it's fairly easy to pick up. Qt, Python Bindings

Will
  • 103
  • 4
  • I already know (and tried) PyQt, wxPython, Boa Constructor, IronPython Studio and others, but tnx for advice (I'm not a Python n00b :S). – PythEch Oct 06 '09 at 13:26