4 ms·
using System; public class Hello { public static void Main() { Console.WriteLine("Hello, World!"); } } vs prin
by 3pt14159 13y ago
using System;
public class Hello
{
public static void Main()
{
Console.WriteLine("Hello, World!");
}
}
vs
print "Hello, World!"
Everything is just simpler in python and ruby.
- Xelom 13y agoIf I open a new console application in Visual Studio. I have all those boilerplate ready for me so I'm also typing: Console.WriteLine("Hello, World!"); That's all. So I'm not even talking about the greatness of the C# IDE.
- adamors 13y ago> If I open a new console application in Visual Studio That's the thing, you need an IDE to be able to skip the boilerplate, whereas both Python and Ruby have a great REPL that is available from virtually every terminal emulator.
- Xelom 13y agoI like my IDE. It makes the development really easy. I have intellisense and fantastic debug features. I install it one time and open it every time like how you open your terminal.
- adamors 13y agoI'm just saying that C# comes with a lot of baggage. You may like that baggage, but most people who chose Python/Ruby instead of C# don't. Personally, I like C# the language. I hate the baggage.
- steveklabnik 13y agoThen you're in Windows.... And Visual Sudio is a best in class IDE, but that still means it's an IDE. (read: there is just a MASSIVE culture gap. It's just as unfathomable to Ruby/Python people why you'd ever use C#.)
- Xelom 13y agoI really don't see any bad point of using and IDE. Or being in Windows... It's making me a lot productive. I don't have to search the docs when I forget a function, it is there with intellisense(and explanation of it). I can debug every piece of my code with the values of my variables. It handles a lot of the boilerplate for me too.
- spoiler 13y agoLike the parent of your comment said: There is nothing bad about it. It's a cultural gap. I would never resort to a language like C#. It doesn't mean I think less of the language. I just prefer Ruby. I like not having to use IDEs. I like my text editors. Discussing languages is like discussion flavours. It's just preference. It's like asking me why I prefer bananas over apples. I just do.
- steveklabnik 13y agoAs I said, it's culture. C# is a pretty decent language, but all of this is so far removed from what I (and others) want that they sound like negatives, not positives. In the exact same way that I might say "I use Arch Linux, and the only GUI program is Firefox. I live my entire life in the terminal, in vim, and I use languages that have no ceremony in the first place and prefer log statements to debuggers." That probably sounds like all downside to you. Use whatever you like. It's not that important.
- RussianCow 13y agoThe difference is that Python and Ruby (and similar languages) don't have this boilerplate to begin with. Someone writing Python for a living doesn't have to use an IDE (most don't), but for a Java dev it's almost a requirement.
- marcosdumay 13y agoYou can either write a program that'll help you create programs in a language it can understand (the IDE way), or you can use a language that's so powerfull that no program can completely understand, and use it to write simpler programs, avoiding the need of automating things (the Lisp way). Anyway, you can not have both, but you can be in between. Python is not at the Lisp extreme, but it's not very far from it.
- quii 13y agoBoilerplate isn't a good thing, even if it's auto generated there is still overhead
- ot 13y agovs H in HQ9+ (http://esolangs.org/wiki/HQ9%2B http://esolangs.org/wiki/HQ9%2B). Everything is just simpler in HQ9+.
- 3pt14159 13y agoHardy har, har, Giuseppe. Simpler and easier to read.
- Too 13y agoAssuming size of a pretty normal simple program is 10k LOC. Lines required to get an entry point of program, Python: 1 (0,01% of such program), C#: 7 (0,07% of such program). Worry about the things that matter, the number of lines required to get to an entry point is not one of them. Neither is printing to the console. And to be fair, if you are doing python seriously you would probably also have an ´if __name__ == "__main__":´ line, and a ´main()´ function called immediately from there to avoid shadowing of module variables. Assuming also you want to use the command line arguments you will have to ´import sys´ and suddenly the lines required are almost exactly equivalent short of the braces in C#. Don't get me wrong, i absolutely love the conciseness of python but i frequently see this silly example being used which in the big picture doesn't mean anything. List comprehensions on the other hand is an excellent example of where the conciseness really shines. Really, you can do things in 1 line that in other languages takes 30. Although C# also has similar feature through LINQ so that's not a killer feature to convert someone from C# to python in particular.
- steveklabnik 13y ago> Assuming size of a pretty normal simple program is 10k LOC. This is a pretty big assumption, no pun intended.
- Too 13y agoYou can remove or add one digit if you want, the example is equally silly :)
- clubhi 13y ago"Worry about the things that matter, the number of lines required to get to an entry point is not one of them" Getting started on prototyping ideas is most of my life. I rarely use the code I write.