Reputation
24,941
Next tag badge:
84/100 score
32/20 answers
Badges
2 42 104
Newest
 Nice Answer
Impact
~1.0m people reached

Oct
8
answered Why does dependency injection encourage collaboration to be exposed via constructors?
Oct
7
comment Big O notation for the algorithm
@Ordous: only if you are sorting by comparison.
Oct
6
comment Why implement a lexer as a 2d array and a giant switch?
@greenoldman The lexical analyzer will construct a function to translate a character to a character class, and the DFA transition table will be indexed by character class. For your example, there is one character class. For mine there will be a couple of dozen, one for each character that appears in a token, and others for the digits, underscore, and whitespace.
Oct
6
comment How would you draw this UML class diagram?
Code is precise and executable. UML diagrams are neither. They are only useful to communicate ideas to people. Don't dwell on their precise semantics. I've been in this business three decades and class diagrams rarely last longer than one meeting. Even if they are saved in design documents, when the code must be changed, it's the code that is read.
Oct
5
comment HTML and CSS required for .NET Development
it means that the person who wrote the description is either ignorant, or a bad typist who meant to write "and" instead of "ans"
Oct
3
revised An algorithm for finding converse duplicates of ordered pairs
deleted 298 characters in body
Oct
3
revised An algorithm for finding converse duplicates of ordered pairs
deleted 298 characters in body
Oct
2
revised An algorithm for finding converse duplicates of ordered pairs
added 25 characters in body
Oct
2
answered An algorithm for finding converse duplicates of ordered pairs
Oct
2
comment Unit test private method in c++ using a friend class
@Nir: Do the trivial: extract a class with all those methods public, and make your existing class a facade around the new class.
Oct
2
awarded  Nice Answer
Oct
1
answered Unit test private method in c++ using a friend class
Oct
1
comment Why implement a lexer as a 2d array and a giant switch?
@JimmyHoffa: yes, performance is definitely relevant in compilers. Compilers are fast because they have been optimized to hell and back. Not micro-optimizations, they just don't do unnecessary work like creating and discarding unneeded temporary objects. In my experience most commercial text processing code does one-tenth the work of a modern compiler and takes ten times as long to do it. Performance is huge when you are processing a gigabyte of text.
Oct
1
comment Why implement a lexer as a 2d array and a giant switch?
The dragon book is pretty dense stuff, not written for beginning programmers at all. I rarely find employments candidates who fully understand ANY of the concepts in that book, even the basics of how a regular expression is compiled into a NFA or a DFA.
Oct
1
comment Why implement a lexer as a 2d array and a giant switch?
@Telastyn: it's almost impossible to go faster than a table-driven DFA: get next character, lookup next state in transition table, change state. If the new state is terminal, emit a token. In C# or Java any approach that involves creating any temporary strings will be slower.
Oct
1
revised Why implement a lexer as a 2d array and a giant switch?
added 12 characters in body
Oct
1
revised Why implement a lexer as a 2d array and a giant switch?
deleted 1 character in body
Oct
1
revised Why implement a lexer as a 2d array and a giant switch?
added 206 characters in body
Oct
1
answered Why implement a lexer as a 2d array and a giant switch?
Sep
30
comment What advantages does Linux give me when developing in PHP for the web?
I will accept that you are nowhere near as fast with Emacs. Many Emacs experts have rejected VIM as being far too slow and difficult to customize.