Code faster with Intellij IDEA live templates
maciejwalkowiak.pl
maciejwalkowiak.pl
Same with Java. Functional programming makes for much more expressive iteration than the iterator / for-loop pattern does, and it's much less verbose (think list.map(doSomething)).
The benefits of functional languages tend to not be as great as they could be because the tooling sucks (or kind of sucks). Look at Scala. The IDEs sucked for years. That's changed recently, but it was a big problem for adoption. F# is similar. Although support is baked into Visual Studio these days, the IDE support is spartan to say the least compared to C# with resharper.
There seems to be a class of developers that have a hard time understanding the enormous productivity boosts that good tooling provides.
For example, the visitor pattern is easily eliminated by dispatching on multiple arguments or with a monad.
The template provides that common, low-level, way of communicating to other developers in that the resulting code is consistently formatted and is native java/c/etc.. It's a pain in the ass to deal with constructs such as conventional iterative loops, exception handling boilerplate, braces/whitespace/etc., or massively redundant structures such as XML, as a regular programmer.
My favorite example of a level of 'retardation' in a language is pattern matching.
I can either write a painful if/then/else/else/else/else/else/default/end tree or I can write something like the following.
f(0) → 0. f(1) → 1. f(<binary:01001001010101011101010><x as binary>) → x as number. f(x > 10) → 1.
Of course, this can be expressed in a number of ways. Table? Spreadsheet? Domain mapping with pretty lines?
I think we're losing information on a lot of the footpaths we should be paving by not having feedback into the use of various macros, templates, and patterns in the world.
and the seminal Peter Norvig essay: http://norvig.com/design-patterns/
This is an important point, regardless. Sometimes new projects are started and it's not a matter of switching. Sometimes verbosity, and the things it negatively impacts, are worth switching. That's what.
If your language isn't Lisp and cannot make macros to sub in the variable bits in an otherwise redundant template pattern, you might have some other options, though.
For those of us condemned to industrial, "enterprise" languages, you might try using a DSL or (build-time!) code generator, rather than cluttering up your source code with editor generated crap.
My most commonly used one is "prop" which generates an automatic property in C#: "public string Name { get; set; }". I type "prop", then hit tab, string is selected and I can change it to any type I want, hit tab again, I can now change the name of the property, hit enter and I'm done Takes 1.5 seconds.
What I would love (and if it can do it I've not found it) is to be able to do something like
koo(fooBar)<TAB> and get something like
self.fooBar == ko.observable("");
would be amazing!.Settings -> Editor -> Live Templates -> JavaScript
And add the live template for abbreviation 'koo' and template text like:
self.$VAR$ == ko.observable("")
See http://www.jetbrains.com/idea/webhelp/live-templates.html for more information.
That though inserts the template and lets you tab through it.
What I'm suggesting is to pass fooBar before you expand the template so that you don't need to tab through it (similar to how zen-coding does id's and classes on html)
i.e.
func(returnFoo,$foo,$bar,$fizz,$buzz)<TAB>
becomes without having to tab through.
public function returnFoo($foo, $bar, $fizz, $buzz)
{
}Embarrassingly for someone who has been a Linux user for more than 15 years I'm terrible with Vim (I can just about use it systems administration (though I often just use nano)) and use IDE's for most things.
[1]: http://www.jetbrains.com/idea/webhelp/live-templates.html
Don't know what I'd do without PyCharm.