Reputation
17,760
Top tag
Next privilege 20,000 Rep.
Access 'trusted user' tools
Badges
1 47 70
Newest
 Nice Answer
Impact
~288k people reached

Mar
7
comment Thread safety IDE warnings
Thread safety is much more complicated than that. So my hunch is: No, it's about as useful as asking the compiler to find violations of GUI design guidelines ;-)
Mar
6
comment Using a public username as a login username
@Gaz_Edge The URL includes an ID instead, but still, from the URL of your profile and from a link on my profile, I can guess that the link to edit your profile -- yet I get a 404 there, as SE (like any remotely decent site) applies proper authorization checks.
Mar
6
comment Which of these OOP examples demonstrate proper OOP concepts?
@user61852 It'd be silly to claim it doesn't. It's just that there are many meanings to the term. Both the term and the things the term is used for exist obviously.
Mar
5
comment Which of these OOP examples demonstrate proper OOP concepts?
"OOP" means a lot of different things to a lot of different people, and like all design, there is rarely a single "best" solutions for object-oriented design. Treat all who claim to have "the best design" with extreme caution.
Mar
1
comment Will a program ever crash if the main loop is put in a try/catch block
Perhaps you won't have "unhandled" exceptions, but that doesn't mean it'll work. Not even remotely. There's even a line of thoughts (that has a point, I think) arguing that silencing errors like this, rather than crashing and burning loudly, leads to less reliable software as the latter forces you to actually (attempt to) solve each error.
Feb
28
comment Why do programming languages, especially C, use curly braces and not square ones?
@gnat Fair enough, I removed my downvote.
Feb
27
comment Why different testing methods are so contradicting topic?
Who says unit tests kill kittens? That never struck me as a popular opinion.
Feb
26
comment Why do programming languages, especially C, use curly braces and not square ones?
@gnat FWIW, grep -Fo tells me the *.c files of the CPython source code (rev. 4b42d7f288c5 because that's what I have at hand), which includes libffi, contains 39511 { (39508 {, dunno why two braces aren't closed), but only 13718 [ (13702 [). That's counting occurrences in strings and in contexts unrelated to this question, so this is not really accurate, even if we ignore that the code base may not be representative (note that this bias could go in either direction). Still, a factor of 2.8?
Feb
26
comment Why do programming languages, especially C, use curly braces and not square ones?
@gnat I ask for references because I know C and have written and read a fair amount of code in it, and the square brackets were significantly less common than curly brackets (at least that's my impression; hence I'd appreciate a study). Subscripting via ptr[idx] (a pointer operation rather than an array operation) is more common than array declarations, but still not very common in comparison to all the uses of curly brackets (recall that this includes many kinds of declarations and definitions, as well as any condition, loop, switch, etc.) in my experience.
Feb
26
comment Why do programming languages, especially C, use curly braces and not square ones?
Important for language design(ers) doesn't mean it is used more frequently than code blocks. Please, do you have anything actually indicating arrays (not the concept, but only the applications for which C uses the square bracket concept, which excludes dynamic arrays and such) are more frequent than statements grouped together by curly braces? Your entire answer appears to be based on a very questionable assumption (as well as other assumptions which others have pointed out) and I fail to understand all those upvotes.
Feb
26
comment Why do programming languages, especially C, use curly braces and not square ones?
I've had to look it up, so I may be missing a core point... but I don't really see how it helps your case. You don't need to convince me that more frequently used constructs should be terser, I agree with that (though the theoretical underpinnings are interesting themselves). What I'm critical of is your assumption that arrays are more common than (everything C uses curly braces for) at all. Or that this is an assumption someone who knows C very well and uses it a lot would consider.
Feb
26
comment Why do programming languages, especially C, use curly braces and not square ones?
Anything in support of this "apparent" expectation by the language designers? It doesn't take much programming in C to notice that curly braces are much more common than array declarations. This hasn't really changed much since the olden days -- have a look at K&R.
Feb
25
comment Is there a reason that tests aren't written inline with the code that they test?
@Simon doctests are too simplistic for serious testing, mostly because they aren't designed for it. They were intended for, and excel at, having code examples in the documentation that can be verified automatically. Now, some people use them for unit testing as well, but lately (as in, for the past years) this took a lot of flak, because it tends to end in fragile messes, overly verbose "documentation", and other messes.
Feb
24
comment what to make of a Microsoft Most-Valued-Professional who believes that .NET types are either primitive or complex?
Your definition of value types is wrong, and even when corrected, it focuses on the completely wrong aspect. See The Truth About Value Types.
Feb
23
comment Convert an interpreter to a compiler?
Are you "merely" trying to write a compiler (with the background knowledge from previously implementing an interpreter for the same language), or are you literally trying to turn your interpreter into a compiler? Your phrasing is giving me ideas ;-)
Feb
21
comment Deterministic and controllable fully automated memory management
One thing I've never seen solved by RAII automatically are cyclic references. There are weak references, but with a GC we do not need to care about those (for cycle resolution; there are other good reasons). Any thoughts?
Feb
15
comment Does the lack of states on HTTP make the protocol unfit for modern applications?
@MathewFoscarini I think you are confusing something. Nothing in the question would fit HTML, and everything fits HTTP just fine.
Feb
15
comment Text Editor Document Model
A linked list of characters, for a text editor?!? That easily makes the document take five times as much space as necessary! Nine times on 64 bit machines. Not to mention that many operations will become severely less efficient due to your code going crazy hopping all over memory. Why do you think you need a linked list?
Feb
15
comment What's the effect of this assignment (whatever the language)?
@KeithThompson I stand corrected, thanks!
Feb
14
comment Why does the .Net world seem to embrace magic strings instead of staticly typed alternatives?
@Earlz More importantly, anonymous objects are statically typed. There are no magic strings, the compiler knows the name and type of everything involved. Save for every other use of var.