1,677 reputation
513
bio website inf.puc-rio.br/~hgualandi
location Brazil
age 24
visits member for 3 years, 5 months
seen Sep 22 at 4:57

Jun
6
comment If immutable objects are good, why do people keep creating mutable objects?
BTW - even if we ignore the whole mutability vs immutability issue, public getters and setters are a well known source of pain in OO design, since they tend to break encapsulation and invariants.
May
22
comment The “blub paradox” and c++
A note on pattern matching: I wouldnt say its easier to write in general, but after you read a bit on the expression problem it becomes clear that things like if and switch statements, enums and the observer pattern are all inferior implementations of Algebraic Data Types + Pattern Matching. (And lets not even get started on how Maybe makes null pointer exceptions obsolete)
May
22
comment Teaching Programming Concepts Without a Specific Language
Im sure someone, somewhere, must have written an introduction to the RPGMaker language for non-programmers. It will be much easier to move on to more advanced topics once he goes through that.
May
21
comment Why is Invariance, Covariance and Contravariance necessary in typed languages
@JoachimSauer: co/contra variance is an important concept whenever you add subtyping to a programming language, so yes, Id say its "necessary".
May
17
comment How can I apply OOP concepts to building a simple, but real-world, web app?
A rule of thumb I have, specially for dynamic languages, is to try to only create classes if I want to take advantage of polymorphism (that is, if those classes will implement different versions of the same method, and the logic will depend on that somehow). Otherwise, I try to err on writing in a more "procedural" style, in order to keep it simple.
May
17
awarded  Yearling
May
10
revised When should you use a document vs relational vs graph database?
There is no need to apologize when asking a question.
May
10
suggested suggested edit on When should you use a document vs relational vs graph database?
May
10
comment Is it wrong to use a boolean parameter to determine behavior?
@Blrfl: Yes, I think the more straightforward refactorings would be either creating a doOne and doBoth methods (for the false and true case, respectively) or using a separate enum type, as suggested by James Youngman
May
8
awarded  Citizen Patrol
May
8
comment Where are null values stored, or are they stored at all?
@Neil: You might want to check this entry in the C faq or this SO question
May
8
revised What are the roles of singletons, abstract classes and interfaces?
deleted 2 characters in body
May
8
revised What are the roles of singletons, abstract classes and interfaces?
added 629 characters in body
May
8
answered What are the roles of singletons, abstract classes and interfaces?
May
7
comment The modern way to perform error handling…
@Giorgio: Checked exceptions don't interact well with the generic system, making it harder to define many sorts of useful higher-order functions. james-iry.blogspot.com.br/2012/02/…
May
7
comment The modern way to perform error handling…
@Giorgio: Its very hard to foresee every kind of exception that a method might throw, since this needs to take into account other subclasses and code that has yet to be written. In practice people end up with ugly workarounds that throw away information, like reusing a system exceptions class for everything or having to catch and re-throw inner exceptions frequently. I have also heard that checked exceptions were a big hurdle when they were trying to add anonymous functions to the language.
May
4
comment Good ways to jump to a particular state in a yielding stateful function?
I don't think your use of goto there is actually that bad...
May
4
awarded  Nice Answer
May
4
answered Refactoring Switch Statements and is there any real use for Switch Statements at all?
May
4
comment Refactoring Switch Statements and is there any real use for Switch Statements at all?
Heve you ever heard of the Expression Problem? The OO and the FP are better in different situations, if you stop to think about it.