9,406 reputation
12141
bio website
location
age
visits member for 3 years, 8 months
seen 3 hours ago

Aug
24
comment How does a garbage collector prevent the whole memory from being scanned on every collect?
Algorithm != implementation indeed, but an implementation can only deviate this far before it becomes an implementation of a different algorithm. An algorithm description, in the GC world, is very specific and includes things like not scanning the entire heap on nursery collection and how inter generational pointers are found and stored. It is true that an algorithm does not tell you how long a specific step of the algorithm will take, but that is not relevant at all to this question.
Aug
24
answered How does a garbage collector prevent the whole memory from being scanned on every collect?
Aug
24
comment How does a garbage collector prevent the whole memory from being scanned on every collect?
Both of you guys are describing how GCs are correct, not how they are efficient. Judging from the question, OP knows that fully well.
Aug
24
comment How does a garbage collector prevent the whole memory from being scanned on every collect?
-1 Stop confusing OP. That the GC is part of the CLR and not language-specific is not relevant at all. A GC is mostly characterized by the way it lays out the heap and determines reachability, and the latter is all about the algorithm(s) used for that. While there can be many implementations of an algorithm, and you shouldn't get caught up in implementation details, the algorithm alone determines how many objects are scanned. A generational GC is simply an algorithm + heap layout which attempts to utilize the "generational hypothesis" (that most objects die young). These are not naive.
Aug
22
comment How does the GPL work in regards to languages like Dart which compile to other languages?
@Paul My assumption, and everyone else's assumption, is the Dart program is in fact GPL'd.
Aug
22
comment How does the GPL work in regards to languages like Dart which compile to other languages?
Well, you appear to be the only one who read it like that. While OP does not explicitly mention that the Dart program in question is GPL'd, nothing hints at him assuming the Dart compiler is GPL either, so I'm not willing to assume he did so little research.
Aug
22
comment How does the GPL work in regards to languages like Dart which compile to other languages?
The question is not about a Dart compiler which is GPL (which would BTW be irrelevant to program (compiler) output), but about a Dart program that is GPL'd.
Aug
21
comment Is there a limit on how many global consts are used before an application is considered bad programming?
@jfrankcarr And how is global mutable state dressed up as singleton or with a dot and a class name in the variable name than global state that is accessed by a plain old variable name?
Aug
21
comment Is there a limit on how many global consts are used before an application is considered bad programming?
@jfrankcarr By the way, statics and singleton are also globals (constants or variables, depending on mutability).
Aug
21
comment Can a loosely typed language be considered true object oriented?
I don't expect a Q&A site post to strictly define everything, and I don't mean to disrespect your answer (in fact I concur and think it's very well-written, +1). I'm just promoting, whenever I can, the idea of collectively abandoning a term which is far more likely to cause confusion. The asker of the question I linked to is not the first to be confused, and there has been more than one heated debate (and holy wars too) about which language is strongly typed or not. Just ask any militant Haskeller how "strong" C#'s type system is. Or ask around whether Python has strong or weak typing.
Aug
21
comment Can a loosely typed language be considered true object oriented?
The problem is (and the Wikipedia article illustrates), weak typing has a dozen incompatible meanings, and all are in common use. That makes the term meaningless. Even if you define it to mean a particular, unambiguous property of programming languages in mind, you have to add to every statement that your definition of weak typing is such and such, and at that point you may as well use that definition directly instead of risking someone replacing your definition with his. I am convinced that the term is 100% useless to harmful and therefore shouldn't be used at all.
Aug
21
comment Can a loosely typed language be considered true object oriented?
Don't describe type systems as "weak".
Aug
21
comment Can a loosely typed language be considered true object oriented?
@Serg You confuse language and implementation. Also, JIT compilation is a mere implementation detail, and one with no observable effect (I'm talking about semantics, not performance) to boot. But yes, any implementation of a dynamic language has to track the types of values somehow. Regardless of object orientation.
Aug
21
comment Analyzing Memory Usage: Java vs C++ Negligible?
Thanks, interesting read!
Aug
20
comment A study shows that lines_written/time is language-independent for most programmers. Where can it be found?
@LokiAstari I see that flaw too. But the claims I was responding to were stated as "IF this [LOC/time being independent of the language] is true, it would mean ...", so that's an entirely different issue. I restrained myself to pointing out faulty reasoning, not why one may consider the assumption fishy (cf. the distinction between sound, valid and true).
Aug
18
comment Why are errors named as “Exception” but not as “Error” in programming languages?
Are you just talking about the naming of the specific exception classes? Then note that in some ecosystems, those are called XYError -- for instance, in Python.
Aug
18
comment A study shows that lines_written/time is language-independent for most programmers. Where can it be found?
@sepp2k Ambiguous, I admit. 100 lines of Python are "more code" than 100 lines of Java in the same sense as 100 Euros are (at least as of now) "more money" than 100 USD. That is, same number but different value per unit -- one buys you more stuff than the other, or in this case, does more stuff.
Aug
18
comment A study shows that lines_written/time is language-independent for most programmers. Where can it be found?
No, it would imply that programmers can yank out more code per time unit the terser the language used is. There are several important differences between "code produced" and "productivity" -- such as correctness, debug-ability, and maintainability.
Aug
18
comment Analyzing Memory Usage: Java vs C++ Negligible?
Regarding your first point: I'm no Java guy, but the Java APIs I've seen never used Integer (why would they?) instead of int. Only generic collections have no choice but to use Integer due to type erasure, but if you cared you could replace those with an implementation specialized to int or whatever primitive type you need. And then there's temporary boxing for passing through generic wrapping code (e.g. everything that requires an Object[]). Apart from that, do you have sources for the GC space overhead? I don't really doubt it, I'm merely curious.
Aug
18
comment Different ways to see a monad
#2 is not what a monad is in general. In fact, it's pretty much restricted to IO, and not a useful view (cf. What a Monad is not). Also, "strict" is generally taken to name a property Haskell does not posses (namely strict evaluation). By the way, Monads don't change that either (again, see What a Monad is not).