930 reputation
18
bio website
location Helsinki, Finland
age 24
visits member for 1 year, 6 months
seen 1 hour ago
stats profile views 53

2d
comment Reason for return statement in recursive function call
Because you need to return the value that is returned by the function
Jun
14
comment Which design patterns would I use for this algorithm?
He is asking if that flexibility is worth the tradeoffs you are making. Unless the requirements are going to change weekly, or something, it is not. You can also write 30 classes for the task of printing hello world, there is no end to accidental complexity you can add.
Jun
4
comment How do you demo software with No UI in the Sprint Review?
No you didn :-D
Jun
2
comment How to get started with computer science research
Here's an overview of the areas en.wikipedia.org/wiki/…
Jun
2
comment Is Node.js correct choice for JSON parsing and IO driven
What do you mean extremely fast? It is general purpose textual format, it's going to be much, much slower than custom binary formats usually used in database<->application comm.
Jun
2
comment Is Node.js correct choice for JSON parsing and IO driven
I don't see how Javascript has a distinct advantage in parsing JSON. First of all, JSON is not technically a subset in that line and paragraph separators (\u2028, u2029) are illegal in Javascript string literals but not in JSON string literals. Secondly, even if it was, I still don't see how the syntactic similarity could possibly affect performance. If it's because javascript has direct equivalents of JSON values, then, so do many other languages but it's still unrelated to syntactic similarity.
May
25
comment The rationale behind Falsy values
@Inaimathi yes, == or != in Javascript is a different game altogether, if ( a == false ) is not the same as if ( !a ) or other plain boolean conversions like in a || b or a && b.
May
25
comment The rationale behind Falsy values
@JeroenDeDauw yes, it's basically the good old "The code should protect the programmer from themselves" vs "the programmer is a responsible adult" :P Depending on situation, either one can be the right approach.
May
25
comment The rationale behind Falsy values
@JeroenDeDauw it should be a null, undefined, or string. If it's not, it's the callers fault - this is how we think in Javascript culture anyway.
May
25
comment When to store values in constants/finals
COLOR_SELECTED doesn't read like a constant at first glance (sounds like a variable I.E. what is the currently selected color or something)... maybe you should rename it to SELECTED_TEXT_COLOR or whatever it really means.
May
25
comment Video about Java hashmap with arrayList as values
Do you really need a video for every type of thing as a key? They are all the same.
May
25
comment Why are there so many numeric types (bit, int, float, double, long)?
Javascript only has one number type on the surface.
May
15
comment Why is the use of constructors discouraged when creating prototypes?
@CaseyChu not at all. And I mentioned it because in the linked post someone said "Object.create doesn't work in IE8" - which is just useless comment when you can implement it for this use case in 2 seconds on any browser.
May
15
comment Object Oriented Programming in JavaScript. Is there life without it?
@deceze well you do lose inheritance, generic methods and the ability to have a program that creates a lot of objects. That's a lot when you can just use underscore prefix/suffix.
May
15
comment Is it poor programming practice to pass parameters as Objects?
In Java the direct equivalent would be dialog( Map<String, ?> options ), not dialog( Object options ) so this is not what OP's code was trying to do.
May
14
comment What attributes of PHP make it insecure?
I don't think you are talking about the same thing, I meant that serialized input coming to PHP is not handled beyond putting it in arrays. Regardless of how stupid and random the rules for == are, they are deterministic and documented. If both of the values are strings, as they will be in the case of directly comparing to unprocessed input, they will be compared as strings. That didn't return true for me in 32-bit system either - they are both strings which will just do string comparison. Use var_dump to see what types you are dealing with for sure, because there is no "sometimes".
May
14
comment What attributes of PHP make it insecure?
Are you saying that PHP used to inspect the contents of every input to see if they can be parsed to more sophisticated types than strings? Doesn't sound very PHP to me :P
May
14
comment What attributes of PHP make it insecure?
"secret_pass" == "0" evaluates to false for me. You cannot pass 0 in a $_REQUEST - the input data is not automatically parsed to integer types and so on. Not defending on PHP but this really sucks the credibility of your post down for me.
May
10
comment regular, average programmer - scared of geeks and their skills
Starting at 20 is earlier than me :P Anyway, it's not really about raw time spent at all but taking those painful steps outside of your comfort zone. People who started programming at 12 and sticked to it were very likely to expand their comfort zone all the time rather than writing getters and setters for 8 years. Otherwise the 8 years meant nothing - "1 year's experience 8 times".
Apr
22
comment Structure vs. programming
How is following a never-ending trail of indirection ("treasure hunt"), that will inevitably result from this insanity, easy to understand? That's just going from one extremity to another, and is probably far worse than the extremity you started with. Each method contains at most 2 statements - are you serious?