I think in a statically-typed language, Duck Typing would subvert all of the strengths of that environment. Indeed, Interfaces provide all of the function offered by Duck Typing, with the additional benefit of compile-time type checking. Duck Typing, to me, is more of an approach or way of thinking than an actual type system. In dynamic languages, with no compile-time checks, thinking in terms of "duck typing" can be a tool for designing code structure. In most cases, IMHO, if we work in a static language and think "duck typing" we should immediately think "interface" instead.
John Atten
Posts
-
Duck typing -
Blog Feed Not PulledMy blog feed was polled at 9:31 AM this morning, and I had just posted a new article last night. Was hoping to see it "consumed", but it wasn't pulled. It was assigned the Code Project category, and had the hidden code project rel tag just like all my others. Have I missed something? Here is all my other technical blogs: My Technical Blog Posts on Code Project and here is my Feed showing blog polled at 9:31 AM: My Blog Feed at Code Project
-
.NET is killing natural of programming from inside !?One of the vaunted goals of OOP is code re-use. It seems to me that this is the dichotomy of advanced frameworks and libraries - once evolved to a certain level, it begins to feel like "programmers" are becoming "API Experts." In addition, people learning to code in these environments (this includes myself, as a self-taught developer) may miss some crucial concepts, unless they pursue lower-level learning on their own (I do). in simplifying the development process through code reuse and frameworks, we also, in a manner of speaking, eliminate the requirement to know and understand lower-level operations. The level of abstraction is sufficiently high that it becomes easy to forget that there is a whole lot going on under the covers. I experience a sense of personal dismay AND relief that I will likely never become fully fluent in pointer arithmetic, and/or assembly. I do seek to learn about such things, as I feel it is important to understand what is happening further down the call stack, near the metal. Will I ever have to write production code using those constructs? Unlikely.
-
Programming QuestionTruly. When I am doing somethings that either is hard to figure out, not intuitive, or appears at first to be solutions in search of refactoring (but in reality is not), I like a comment to remind me why I did it the way I did, and to let others know there is a reason for the funky implementation.
-
Why wait to be outsourced when you can do it yourself?Seems to me bob would have done well to clone the work to a private source tree, then after merging commits made by his outsourced workers, made the commits to the company repo himself. Or something along those line (would depend somewhat on how the employer's source control was set up). Does not address the NDA concerns, but overall, his mistake was allowing the network footprints to reveal his scheme.
-
Hotel Web AccessSkipping the part about the machines available for use at the hotel, I find it hilarious the manner in which the hotel industry has set up the wifi availability. A. Low-end to mid-level hotels and chains tend to offer decent wireless service for free. It's not the best, but it works, for no charge. B. High-end and "executive" hotels seem to offer a really bad, tiered paid wifi service. The least expensive tier performs horribly, but for a non-negligible additional fee, you can "upgrade" to a faster connection. No doubt driven by the idea that the upper-end operations cater to clientele using corporate expense accounts. They throttle down the lowest tier to a level which your average business user will find unacceptable, in the hope they will charge the upgrade to the room "on the company." This is a deplorable practice.
-
Visual Basic for mAsochists (VBA)"
Quote:
I have failed in actually accomplishing anything in VBA for Excel without lines and lines of hacks and botched, messy code.
The first key problem here is the word "Excel" IMHO. VBA is most definitely showing its age (as is, of course, its parrent VB6). It is possible to build useful, workbale solutions for common business problems using VB6 and/or VBA outside of Excel, but using VBA in excel for anything other than custom functions for use WITHIN THE SPREADSHEET ITSELF is where things get really, really ugly. Back in the day, I found VBA to work fairly well within MS Access, and it also served as a great into learning environment. The very first time I attempted to apply my VBA "know-how" to an Excel spreadsheet, though, all that fell apart. Thankfully, I have moved beyond VBA/VB6 and into several other full-grown languages. But I would content that whatever issues are presented by VBA/VB6 are blown up by an order of magnitude when attempting to automate or code for an Excel spreadsheet.
-
Could you compile a program manually?Aren't we already almost there? VS: "File/New/ASP.NET MVC Project" or "File/New/Entity Model." Eclipse: "File/New/Java Package" Most modern IDE's abstract away so much boiler plate code that we have acheived almost the equivalent of Clippy already. Newcomers, such as myself, begin to believe that that's all there is to it. The "run" button, which in reality "builds" such projects then executes the build result, optionally stepping through in an integrated debugger, removes a whole lot behind-the-scenes operations. While all of these are great for productivity, and in many cases represent the ultimate goal of code re-use, they also deprive (for a time, anyway) us of the need to learn how these hidden parts of the process work.
-
Why I like C++Excellent advice for learning any programming language!
-
.NET is Hell (subtitle: An error message from Microsoft)Funny!
-
The Language/Coding propositionFor people who are very new, it can be challenging to even know what to ask. They face a problem, but due to simple lack of experience, also lack the context to know what to ask, or what to search for. I am self-taught, and I think I am getting pretty good at this programming thing. But only a few years ago, it was very difficult to even know A. What to search for on line, prior to asking (because I recognized that it is better to try to find an answer for yourself, first) and B. How to ask the question, or how to describe the problem. Fortunately, I am a native English speaker, and relatively adept with the written language. I shudder to think how I would come off, or how successful I would be, if I needed to ask questions about the complex subject of programming in a foreign tongue. While it can be painful to read some questions or answers posed by a non-native speaker, these people deserve all of our respect and some kudos. It takes some serious cojones to attempt asking or answering a question about programming when you don;t speak the language. Imagin posting your next question or answer in, say, Russian (if, that is, you are a single-language native English-speaker).