Reputation
5,787
Top tag
Next privilege 10,000 Rep.
Access moderator tools
Badges
4 27 52
Impact
~312k people reached

May
11
awarded  Nice Question
Apr
30
comment Why is String immutable in Java?
@Shamit: Semantically, the JVM does not define what happens at that level. It is likely different on different CPU architectures. And of course, under the "as-if" rule the code that actually executes may look nothing like what you write in source code. What matters is the semantic meaning the language gives something. For example, strings are "immutable" but the JVM does mutate strings' guts under the covers (during construction or when reclaiming string memory, for example)
Apr
30
comment Why is String immutable in Java?
@Shamit: Nope, that's not true. A new int was created.
Apr
29
comment Why is String immutable in Java?
@Shamit: In that case, you mutated i, not 42. Consider string s = "Hello "; s += "World";. You mutated the value of variable s. But the strings "Hello ", "World", and "Hello World" are immutable.
Apr
28
comment Why is String immutable in Java?
@Shamit: Similarly, you can't do something like 43 = 6 and expect the number 43 to mean the same thing as the number 6.
Apr
28
comment Why is String immutable in Java?
@Shamit: Yes, I'm sure. Adding 1 to 42 results in 43. It does not make the number 42 mean the same thing as the number 43.
Apr
26
comment Why aren't more desktop apps written with Qt?
@Tim: RE: 3: Libraries that use C++ are compiler specific. You can't e.g. throw an exception from something compiled with one compiler to something compiled with another compiler. There's no reason to turn this into a bashing piece.
Mar
16
awarded  Famous Question
Mar
4
comment Why aren't more desktop apps written with Qt?
@Jon: See my comment to Dehumanizer earlier in this long long series of comments. I believe it addresses that point. The commercial license is too restrictive for a lot of projects.
Feb
26
comment Do you have to rename the software when you fork a repo?
@nbrogi: That's what I'd argue, yes.
Feb
24
comment Do you have to rename the software when you fork a repo?
To extend Daenyth's point, if (2): Legally speaking, the license doesn't require you to do that. But ethically speaking you should. (If nothing else you don't want people you want contributing patches to you mistakenly contributing them with the project with which you are competing)
Nov
1
comment Why can't Java/C# implement RAII?
@AleksandrDubinsky: Java and C# don't eliminate leaks. Careful design is still necessary to ensure you aren't referencing the whole world in terms of memory. They don't attempt to address non-memory resources at all, and failing to release a resource like this is a common source of bugs in Java and C# programs, because people don't pay as much attention to ownership as they should.
Oct
31
comment Why aren't more desktop apps written with Qt?
@AnnonomusPerson: I don't think your criticism here makes sense -- there are dusty / shady corners of every library. The question is talking about systematic problems with Qt as a whole, not problems with a specific component. (You also appear to be trying to write an answer as a comment)
Oct
30
awarded  Nice Answer
Oct
30
comment Why can't Java/C# implement RAII?
@svick: Yes, but in C#, someone who instantiates IWrapSomething for a T which is disposable needs to understand the ownership and act accordingly. If T is bound to a scope, the caller has no way of saying "please don't destroy this, I need it to live longer".
Oct
30
comment Why can't Java/C# implement RAII?
@Robert: A correctly written program cannot assume finalizers ever run. blogs.msdn.com/b/oldnewthing/archive/2010/08/09/10047586.aspx
Oct
30
answered Why can't Java/C# implement RAII?
Oct
25
revised Is it bad practice to call a controller action from a view that was rendered by another controller?
edited title
Oct
21
comment How to break the “php is a bad language” paradigm?
@Johnny: You also have to consider what PHP was designed to do -- embed small bits of code in web pages. If that's your use case, than PHP is a great platform as a "templating language," because its script nature meshes well with the way web pages work. The problem is that people use it to build things beyond the frontend processing for a web page, for which it was not designed and is ill suited.
Oct
21
comment How to break the “php is a bad language” paradigm?
@Johnny: To clarify -- I'm not saying that building large systems with PHP is impossible -- Facebook and Co. are proof positive that it is very possible. Just that it ends up being more difficult than with languages that provide better compile time syntax and semantic checks.