Reputation
53,978
Next tag badge:
189/100 score
17/20 answers
Badges
10 153 237
Newest
 Enlightened
Impact
~1.7m people reached

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
Jun
10
comment Basing all .NET applications on a central CORE library?
All .NET applications are based on a central CORE library. It's even part of the name: MSCORLIB. ;)
Jun
10
comment Are (basic) SQL queries semantically equivalent to Higher Order Functions?
@Bart: Then question was "is there a sound semantic equivalence that can be proven?" Implementing one thing in terms of another is a time-honored technique for proving equivalence in computer science. For example, one way to prove that a language is Turing-complete by using it to implement another language that is already known to be Turing-complete.
Jun
10
comment Are (basic) SQL queries semantically equivalent to Higher Order Functions?
@Ixrec: Like this
Jun
9
comment How to handle 50% of worse than average sprints?
Yes, what @EricKing said, especially in light of the well-known fact that people suck at estimating.
Jun
9
comment How to handle 50% of worse than average sprints?
Theoretically, 50% of everything will be below average, by definition. (Well, one of the definitions of "average", at least.) This is to be expected, and not something to worry about. It's only a serious problem to worry about if you're badly below average.
Jun
6
comment Mocking delegate constructors
...oh. Wait. That's not the type of mocking you meant?
Jun
6
comment Mocking delegate constructors
Ha ha! Look how ugly those delegate constructors are!
Jun
5
comment Why would a program use a closure?
@RobertHarvey: Technically true, but they're different mental models. For example, (generally speaking,) you expect the event handler to be called multiple times, but your async continuation to only be called once. But yes, technically anything you'd do with a closure is a callback. (Unless you're converting it to an expression tree, but that's a completely different matter.) ;)
Jun
4
comment On testing the testers
And then how do you test the tester-testers? ;)
Jun
4
comment XQL vs. XQuery vs.
@Ahmad: Thanks. And yes, I came up with the "XM-Mess" version of that old joke myself.
Jun
3
comment XQL vs. XQuery vs.
@RobertHarvey: You do know that Jamie Zawinski got that from an even earlier quote about a UNIX tool? I don't remember if it was Awk or Sed, or something like that, but either way, I'm simply carrying on a tradition with an honorable history. ;-)