Reputation
54,575
Next tag badge:
197/100 score
18/20 answers
Badges
10 154 239
Newest
 Nice Answer
Impact
~1.7m people reached

2d
comment Why does C# have both out and ref?
@Random832: As Robert posted under his answer, have a look at Eric Lippert (former C# compiler guy) discussing this at stackoverflow.com/q/2876315
2d
comment Why does C# have both out and ref?
@Neo: Basically what I said in the answer: It communicates that you don't care about using this for input, and thus it's safe to pass an uninitialized value to an out param because the function receiving it isn't going to read from it.
2d
comment Are modern IDE's a 'crutch'?
@BasileStarynkevitch: What it means to me is "the G in GCC stands for GNU, and the GNU folks are, on the whole, horribly backwards devs who have never quite understood the fact that text-based UIs have literally been obsolete since the year 1984."
2d
comment Are modern IDE's a 'crutch'?
@BasileStarynkevitch If you've never used one than you don't know what you're missing.
Jul
23
comment i'm getting this error in python<__main__.Node object at 0x03A5F990> linked list
Actually, this doesn't appear to be an error at all. Can we reopen this? It's answerable from the available data.
Jul
23
comment i'm getting this error in python<__main__.Node object at 0x03A5F990> linked list
Where in the code does the error take place? Do you have a stack trace?
Jul
21
comment Clean Abstract Syntax Tree
@NSAddict: The way you "keep the bases clean" in a multi-pass compiler and make things easy to reason about is with a well-defined pipeline. Each step uses the Visitor Pattern to perform a certain operation on the AST. You can then reason that, at any given stage of the pipeline, the AST will be in a certain well-defined state because all of the transformations performed by all previous stages will be complete by that point. Keeping complexity of mutable data down to a comprehensible level is really not that difficult; you just need to apply some discipline and definition.
Jul
21
comment Clean Abstract Syntax Tree
@NSAddict: Sorry. It's just that I've never understood the "difficult to reason about" line, and people who use it always state it as a fact, (or at least an article of faith,) with no evidence provided or (apparently) required, even though the burden of proof should be on the person making the claim. It's hard for someone who reasons about stuff like this all the time to see a claim like that and not come to the conclusion that the problem actually lies with the person who seems to find this to be some really hard thing to do.
Jul
13
comment Is the question “What is the using statement” a bad question to ask an interviewee?
@JeffO: To Google something, first you have to know what you're looking for. That's not always an obvious thing.
Jul
13
comment What are some good books to use to learn ADA?
ADA is the Americans with Disabilities Act. The programming language is written "Ada".
Jul
12
comment The Critical Functionality of an API has changed, what should I do?
Google: "Don't be evil." Facebook: "Don't even bother pretending we're trying not to be evil."
Jul
1
comment How does one cycle back to previous options in a C# console application?
Some more constructive advice than rwong gave: The first few times I tried to build a game, I did what you're doing, trying to code all the content directly into the source code. What I learned is that that becomes an unmanageable mess very quickly. There's a better way, especially for a story-heavy game like you're doing: your source code should describe the basic rules, and then the content should go in data files, with scripts to handle special-case logic that doesn't belong in the main source code. Doing the game source this way is called a "game engine," and it's much more effective.
Jun
29
comment Do binary trees serve a specific purpose in storing hierarchical data? What is their canonical use?
@sw123456 Glad I could help explain it :)
Jun
29
comment Do binary trees serve a specific purpose in storing hierarchical data? What is their canonical use?
@sw123456: That's right. As with any engineering, it comes with tradeoffs, (uses more--and more fragmented--memory than an array with the same number of elements, O(n) access to element #n of the data set rather than O(1) access, etc,) but fast search is definitely the major benefit of binary trees.
Jun
29
comment Is method overriding always a violation of Liskov Substitution Principle?
Overriding isn't intrinsically a violation of LSP; it's the entire point of LSP.
Jun
26
comment Can you implement “object-oriented” programming without the class keyword?
The Linux kernel uses an emulation of several OO techniques, which all have to be coded manually without language support. This leads to plenty of opportunities for bugs, which, being Linux, is counterbalanced by a liberal application of Linus's Law. Yes, it's possible to do--Turing equivalence proves this--but my point that it's extremely difficult to get right without language support still stands. Also, why all these questions about C when the question was about Python? In C it's not possible to do the nested functions trick in the first place.
Jun
26
comment Can you implement “object-oriented” programming without the class keyword?
@overexchange: Those are structs with function pointers, not objects with methods. They're assigned at runtime, can be reassigned, can be null or corrupt if you screw up somewhere, add a dereference overhead each time they're invoked, and add sizeof(pointer) per "method" to your struct instance size. Real methods have none of the above disadvantages. (Except the dereference overhead, which applies to virtual methods.)
Jun
26
comment Can you implement “object-oriented” programming without the class keyword?
@overexchange: That's a non-OO attempt to fake it, but the compiler won't let you substitute one for the other. (You can't pass a child* to a function that takes a parent* as an argument, at least not without a typecast.) And even worse, C structs can't have methods bound to them, and there's no support for virtual methods, which are what make the magic of Liskov substitution work, so you have to construct VMTs by hand, which is a complicated process that's easy to screw up.
Jun
19
comment Database is performing slow, even all the tables are having normalization
"Sargable"? I looked at that and thought "no way that's a real word." Turns out it is. I guess I learned something new today.
Jun
15
comment How to quantify the work perfomed by a developer/programmer?
Relevant: -2000 lines of code