As I write more and more code, the more I want simplicity and ease of understanding over typing a few less characters or having more elegant code.
As I write more and more code, the more I want simplicity and ease of understanding over typing a few less characters or having more elegant code.
I had a 24 year old developer report to me that apparently thought his bonuses were tied to how many operations he did on a single line of code.
He consistently wrote unbelievably complex lambda expressions with multiple conditional operators that would make a single line take up at least 1.5 screenfulls in Visual Studio on a 1920x1080 resolution monitor. These lines were impossible to debug and had to be inevitably broken up.
For a while I thought he was following the conventions laid forth in:
https://www.thc.org/root/phun/unmaintain.html
...but he really seemed to be genuinely thinking he was accomplishing something good by doing this.
I'm with you though. I'll take simplicity.
http://blogs.msdn.com/b/lukeh/archive/2007/10/01/taking-linq...
I worked for many years on a FoxPro application with a 10-character limit. The first version of the program was written under a two character limit. This never bothered my boss, who was a terrible typist and always used short names anyway. But I at some point took up the practice of descriptive names, on top of the Hungarian notation we'd adopted for sanity. So I was exceeding the limit all over the place.
Ten years later, guess who had to convert the program to VFP, which has no variable name limit. And no compile-time checks on variables, even when they are declared. Glad that year's over.
There's some of this in all languages, of course, but "this bit of sugar will make the code cleaner and easier to read" assumes that everyone will adopt a new set of idioms wholesale (which they usually don't).
Scheme, via SICP, is much easier to get started with, and one can learn the basics with that quickly (including getting much more comfortable with the sequence abstractions -called LINQ in .NET- than even the average .NET developer).
All these reasons are also why I greatly prefer F#. If you stay away from much of the OO system, F# is much simpler to teach in my experience. At my company right now another team is putting together an F# training program intended to teach our QA automation.
Comparatively the string trick, read-only properties and lambda syntax for simple methods seem very easy to digest.
True, coming from Java where you have to type a lot to get a simple thing done I seem to be gravitating towards languages which have clean, simple syntax that allows you to actually think about the problem. I've been playing with python and scheme, I'll have a go with C# soon, now its been open-sourced.
Syntactic sugar can be that, but not THIS syntactic sugar they propose here.
Here it makes the code easier to read and the intent more clear.
Reading code should be like reading a nice book.
macromaniac: "Patience, I'm still working on salad..."