Get["/"] = _ => "Hello World!";
Or even the class declaration: public class SampleModule : Nancy.NancyModule
My RSI is starting to flare again... Get["/"] = _ => "Hello World!";
Or even the class declaration: public class SampleModule : Nancy.NancyModule
My RSI is starting to flare again...The first example in Python would be some variant of
@get('/')
def whatever():
return "Hello World!"
Or in Ruby: get "/" do
"Hello World!"
end
Or in Go: http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
fmt.Fprint(w, "Hello World!")
})
These other languages, all popular on HN, are nearly identical to the C#, or even longer in a couple of cases. You'd have to go with a project-specific macro package on a Lisp to get much terser.The second C# is also quite terse, IMHO. What would you have preferred? The equivalent Python would be something like
__all__ = ['SampleModule']
class SampleModule(nancy.NancyModule):
pass
which, even if you want to say well, no one in real life uses __all__ (which isn't correct) is still nearly the same length. I don't quite remember the Ruby off the top of my head, but it, too, is similar, as would be Perl.Older C# versions could be verbose, but this seems quite terse to me.
I imagine there's some sort of causal relationship between ultra-powerful IDEs and languages that are verbose. The question is: are the IDEs powerful because the languages require them to be OR did the language evolve to become more verbose due to the IDE eliminating most of the pain associated with verbosity? Both? Neither?
I type even less on RubyMine. Try it out, it's free for the first 30 days and then it is fairly priced.
I call BS. The same things are just as lengthy in most languages you'd use.
And there's nothing there that does not need to be. You still get the "class" signifier in Python or Ruby, and even more BS on Javascript (the huge word: "prototype").
The only thing that COULD be missing is the "public" modifier, if things were public by default.