2,117 reputation
617
bio website
location
age
visits member for 2 years, 8 months
seen Apr 11 at 0:34

Sep
16
awarded  Notable Question
Mar
15
awarded  Yearling
Dec
11
comment Is code duplication a necessary evil in C?
@faif. The classic example is c's void pointer based qsort vs C++'s template based std::sort. Sort blows qsort out of the water due to inlining the comparison function. You can sort just as fast in C, but you'll have to sacrifice elegance with duplicate code or macros.
Nov
23
comment Is It Common For a Company to Have Their Own Definition of Job Titles such as Software Architect
There is no standardization of titles in software development. There are so many dev styles and permutations of duties it may not be ideal to standardize titles.
Nov
2
revised Why can't Java/C# implement RAII?
mistyped sentance
Nov
1
accepted Why can't Java/C# implement RAII?
Oct
31
awarded  Popular Question
Oct
30
comment Why can't Java/C# implement RAII?
@RobertHarvey. The definition of sugar is ambiguous, but using-blocks are nothing more than a syntax expansion to try-finally-dispose. The fact it requires a compiler change does not make it non-sugar. Unless your programming in lisp, your sugar will likely require a compiler change.
Oct
30
comment Why can't Java/C# implement RAII?
@RobertHarvey. No the using-block is not anything more than sugar. It is exactly equivalent to try-finally-dispose. That's not a bad thing, I love sugar. But it is just that.
Oct
30
comment Why can't Java/C# implement RAII?
@RobertHarvey. I am not proposing replacing using-blocks. I propose to add smart pointers in a "seamless" way. I never suggested removing anything. I am suggesting adding a feature, that feature being implicitness in binding to a scope.
Oct
30
comment Why can't Java/C# implement RAII?
@bigown. I went off on a tangent unrelated to the proposed sugar. If the requirement of scope binding is moved to the type it can be enforced by the type system. This way it cannot be used is a regular heap reference. So there is no requirement for the programmer to "remember" to declare a pointer as smart (like there is in C++). If you cannot possible use the object without the pointer being smart, then it is implicit.
Oct
30
comment Why can't Java/C# implement RAII?
Do you prefer using-blocks over try-finally-dispose()? It too amounts to nothing but a mundane syntax variation.
Oct
30
comment Why can't Java/C# implement RAII?
@RobertHarvey. You seem to have a bias against anything not currently implemented in C#. We wouldn't have generics, linq, using-blocks, ipmlicit types, etc if we were satisfied with C# 1.0. This syntax does not solve the issue of implicitness, but it is a good sugar to bind to the current scope.
Oct
30
comment Why can't Java/C# implement RAII?
+1. That is some sweet syntax! In some ways even a smart pointer is explicit if you consider the act of declaring the pointer as "smart" to be an "explicit" action. My thought is to move the smartness to the type of the class so it is enforced by the type system. This would catch any non-smart use of the object at compile time and could be considered more "implicit".
Oct
30
comment Why can't Java/C# implement RAII?
Python's "with" is scope-bound resource management but it is missing the implicitness of a smart-pointer. The act of declaring a pointer as smart could be considered "explicit", but if the compiler enforced smartness as part of the objects type, it would lean towards "implicit".
Oct
30
awarded  Nice Question
Oct
30
comment Why can't Java/C# implement RAII?
@Telastyn. It's currently impossible. But I'm interested in the ability to add smart pointers to Java seamlessly. It is a language change that will likely never happen, but I want to know the technical reasons smart-pointers cannot be added seamlessly.
Oct
30
asked Why can't Java/C# implement RAII?
Oct
2
awarded  Civic Duty
Sep
28
comment Why many designs ignore normalization in RDBMS?
Many programmers don't know the basics of the relational model.