905 reputation
616
bio website
location
age
visits member for 3 years, 4 months
seen 2 days ago

Dec
1
comment When is inlining worth it?
Could you also explain why "code bloat" is undesirable?
Dec
1
comment When is inlining worth it?
I'm just getting into language design lately, and questions like those pop into my head... At this time I had compiled languages in mind... I think inline is rather equivalent no matter the language used, so I guess there have to be some common parameters defining when to, and when not to inline...
Nov
24
comment Exceptions in ANSI C
@ChristianHujer What about code.google.com/p/exceptions4c ? Have you tried that library? Does it have the same limitations?
Sep
20
comment PHP as a target language
I don't "hate" it, I just don't want to use it. But still it's a fact that PHP hosting is cheaper, and sadly it matters for me...
Sep
20
comment PHP as a target language
@BasileStarynkevitch I specified in question that I'm not looking for just a translator, because they usually can only translate at a syntax level, you still have to use target's language library (although I may be wrong).
May
12
comment How to debug weak references?
You mean if WeakReference is the only one left isEnqueued() immediately becomes true?
May
12
comment How to debug weak references?
@Neil Basically it would be nice if there was a way to check if some object can be (or is) collected at given moment, and if not to show where it is still referenced...
May
8
comment Do you have to have boxing of primitives in OO language?
Well, maybe it is possible to have primitives under the hood but make them transparently behave like the objects in the language?
May
7
comment Shouldn't Android's TextView.getText() return String instead of possibly mutable CharSequence?
@gnat See for yourself: developer.android.com/reference/android/widget/… . Yeah, performance is the obvious reason, still I believe documentation could use some warning...
May
3
comment If null is bad, why do modern languages implement it?
@DavidWallace 0 is not like null at all. 0 is valid member of its type (integers, rationals, real numbers etc.) while null has no type at all - it's a special marker.
May
2
comment If null is bad, why do modern languages implement it?
But it could be done without generics. Ha! I got you there ;)
May
2
comment If null is bad, why do modern languages implement it?
Maybe a dumb question (I'm just an IT undergraduate) - but couldn't option type be implemented on syntax level (with CLR not knowing anything about it) as a regular nullable reference that requires "has-value" check before using in code? I believe option types don't need any checks at runtime.
May
2
comment If null is bad, why do modern languages implement it?
Also if in your case file might not exist you should write if (fileexists("joebloggs.txt")) { file = openfile("joebloggs.txt"; ... } and not use try ... catch therefore not using exceptions as flow control...
May
2
comment If null is bad, why do modern languages implement it?
@David Than you can use ?file (option type) which forces you to to check if value is there, and handle the opposite case. Choose the one you prefer, both solve potential problems.
May
2
comment If null is bad, why do modern languages implement it?
I guess RualStorge was talking in relation to SQL, because there are camps that state every column should be marked as NOT NULL. My question wasn't related to RDBMS though...
May
2
comment If null is bad, why do modern languages implement it?
And here you gave an example of what's exactly wrong with nulls. Properly implemented "openfile" function should throw an exception (for missing file) that would stop execution right there with exact explanation of what happened. Instead if it returns null it propagates further (to for line in file) and throws meaningless null reference exception, which is OK for such a simple program but causes real debugging problems in much more complex systems. If nulls didn't exist, designer of "openfile" wouldn't be able to make this mistake.
Apr
18
comment Would using a hash table in garbage collection solve the stop the world problem of mark and sweep?
Yeah, you would run out of IDs after some time and would need to change all of them which would require a pause. But possibly it would be a rare event...
Apr
17
comment Would using a hash table in garbage collection solve the stop the world problem of mark and sweep?
Well we have a lot of memory today so we could have let's say 50 Mb table and hash could be simple modulo so only one instruction...
Apr
29
comment Index independent character comparison within text blocks
This is probably what you are looking for: en.wikipedia.org/wiki/Longest_common_subsequence_problem
Apr
29
comment Coding style (do more, then simplify)
Although the shortest code is also not always the right one. For example think about some quickly coded prototype and something that actually follows design patterns like MVC or whatever...