941 reputation
619
bio website
location Italy
age
visits member for 2 years, 2 months
seen yesterday

Jul
2
awarded  Curious
Jun
30
answered Functional programming strategies in imperative languages
Jun
22
comment How do languages with Maybe types instead of nulls handle edge conditions?
I don't know how it works in other languages, but in Haskell Maybe is just a regular data type, provided by the base library for convenience (so you don't have to define your own Maybe again and again). By itself it doesn't guarantee anything. Type undefined :: Maybe Int and you will still get an exception. The absence of null references in Haskell is due to its functional nature. Unless it has a different meaning in other languages, I think the reference to Maybe in the question is slightly off-topic.
Jun
4
comment Best resources for learning idiomatic PHP
phptherightway.com
May
28
awarded  Yearling
Mar
6
revised Should I refactor large functions that mostly consist of one regex?
deleted 6 characters in body
Mar
6
answered Should I refactor large functions that mostly consist of one regex?
Mar
6
comment Should I refactor large functions that mostly consist of one regex?
Are you sure a giant regex is the best solution to your problem? Have you considered simpler alternatives, like a parser library or replacing a custom file format with a standard one (XML, JSON etc)?
Feb
12
answered Is it better to use a switch statement or database to look through 5,000 to 10,000 instances?
Feb
11
comment An alternative to an array of functions?
I have no time to post a complete answer, but if you need the functions to call one another, you can just define them outside the array.
Jan
13
comment Does 'consider returning Null Object' apply to a DAO read method?
The Option (or Maybe) type is not 'being type-safe just for the sake of it'. 1) It forces you to always consider an empty result. 2) It allows you to compose functions, returning null on the first failure. It can make your code considerably shorter and clearer.
Nov
29
answered Is error suppressing bad practice?
Oct
5
comment Why is quantity in software still written as “1 result(s)”?
+1 Grammatical number can be very different from one language to another. Some languages have dual (which refers to exactly 2 entities), some languages use a singular form for every number ending with 1 (21, 31, 41, etc.)...
Sep
23
comment Best Practices: Database app programming patterns
-1 because it does not answer the question.
Sep
23
awarded  Popular Question
Aug
29
comment Changing a variable through a series of statements … What is this technique called?
@James Maybe to save a lot of precious time and minimize misunderstandings in the communication between developers. Not to mention learning what the possible solutions are without having to reinvent them each time.
Jun
21
comment Finally block for methods - is it a bad idea?
If I understand your question correctly you can simply put the decision logic in a separate function, and return when you want to "break the flow and perform the real stuff".
May
29
awarded  Critic
May
28
awarded  Yearling
Apr
13
comment Writing your own framework or using an existing one?
I have just discovered that my boss is one of those people who think having small functions is a new-fangled trend. Recently I told him that our code contains some extremely long functions (>=3 pages) which should be split into smaller ones. He replied: "Don't you think having a lot of small functions would make the application slower?" Apparently we should never take anything for granted...