Bruce Tate on Twitter: “What’s the most unique feature of your favorite programming language?”
Posted by jpluimers on 2023/08/24
For my link archive: [Wayback/Archive] Bruce Tate on Twitter: “What’s the most unique feature of your favorite programming language?” / Twitter
From the languages that I have been using most:
- [Wayback/Archive] Jeroen Wiert Pluimers on Twitter: “@redrapids Delphi having had virtual constructors since version 1. Wrote a blog post only years after it was introduced as too few developers (still!) realise the power of it: …” / Twitter
- [Wayback/Archive] Marco Wobben on Twitter: “@redrapids @jpluimers Perhaps not terribly unique, but definitely my favorite: Strong typing in Delphi/Pascal.” / Twitter
- [Archive] Jeroen Wiert Pluimers on Twitter: “@redrapids C#: extension methods on interfaces. Without this, things like LINQ would have been impossible. ” / Twitter
- [Wayback/Archive] c# – Can extension methods be applied to interfaces? – Stack Overflow (thanks [Wayback/Archive] Greg and [Wayback/Archive] Aaronaught):
Of course they can; most of Linq is built around interface extension methods.Interfaces were actually one of the driving forces for the development of extension methods; since they can’t implement any of their own functionality, extension methods are the easiest way of associating actual code with interface definitions.See the Enumerable class for a whole collection of extension methods built aroundIEnumerable<T>
. To implement one, it’s the same as implementing one for a class
- [Wayback/Archive] c# – Can extension methods be applied to interfaces? – Stack Overflow (thanks [Wayback/Archive] Greg and [Wayback/Archive] Aaronaught):
It was a kind of follow-up on his earlier tweet that also sparked nice responses at [Archive] Bruce Tate on Twitter: “What is a #programming technique or construct that other people like but you think is overused?” / Twitter.
In my respons I phrased my decades long pet peeve [Archive] Jeroen Wiert Pluimers on Twitter: “@redrapids OOP: inheritance over composition. This leads to deep hierarchies that eventually nobody understands.” / Twitter.
Whereas with OOP (object-oriented programming) one should use composition over inheritance, often the reverse is true.
Actually my take can be generalised into two directions as these hierarchies:
- often crowd a single namespace, so: crowding namespaces is bad.
One does see this outside the Object Oriented realm a well.
JavaScript for instance takes the crowded global namespace one step further by many libraries taking
$q
,$_
or$x
, which is part of my take[Wayback/Archive] Jeroen Wiert Pluimers on Twitter: “@redrapids Mutation of global state followed by an overly crowded global namespace. Example on the JavaScript side: too many libraries and projects using the global `$` and `_` symbols.”.
- often have many levels of indirection, so: overdoing indirection is bad
One does see this outside the Object Oriented realm a well, just not as pronounced.
[Wayback/Archive] joao on Twitter: “@redrapids But to be more specific, I think sometimes there’s too much indirection with very deep class hierarchies. In the same vein those rules of “functions should have at most 6 arguments and 5/10/20 lines” can lead to a ton of indirection chasing the subfunctions being called”.
–jeroen
Leave a comment