1,921 reputation
615
bio website blog.herby.sk
location Slovakia
age 40
visits member for 3 years, 2 months
seen 8 hours ago

Garbage-collecting duck-typer. Test-infected. Hopefully he is not alone who would like UNIX rewritten with GC memory and closure support in system, kernel API in Javascript, (Python, Ruby, Smalltalk), and C layer deprecated and emulated on top of the former.

I use Windows on workstation and FreeBSD on server.

Recently dipped myself into the mobile app world.


Nov
20
awarded  Yearling
Nov
7
comment Which is more effective in coding? Reducing line of code and execution of code?
"one of TDD/BDD major goals is to write enough code only to make the test pass" Well, don't confuse tools with goals. Major TDD/BDD goals is good code design. "enough code only to make the test pass" is only a one of the tools to achieve that, but it's only half of the equation, the other side being you incrementally add more tests, until the code does what it should (or, as IIRC Ward Cunningham pointed and Kent Beck included in the book, "until fear transforms into boredom").
Nov
3
comment Is there a way to add unique items to an array without doing a ton of comparisons?
Algorithmically, this is still O(n^2), because of insertions. kevin cline's answer is the only hashless one which gets you to O(n*log n). You can then make an array from the tree after the whole operation and you're done.
Oct
31
comment I need some help creating a non-binary tree (or some other data structure that will better solve my problem)
Updated to edits in original question.
Oct
31
revised I need some help creating a non-binary tree (or some other data structure that will better solve my problem)
deleted 1 characters in body
Oct
31
answered I need some help creating a non-binary tree (or some other data structure that will better solve my problem)
Oct
29
awarded  Nice Answer
Oct
28
comment How do I put YAML code in GitHub MarkDown?
Add an empty line after closing ``` and it will work.
Oct
28
comment How do I put YAML code in GitHub MarkDown?
I just tried it, it works fine for me (in preview, did not actually save). Shows on three lines, plain black with only three backticks, syntax-highlighted with ```yaml. No trailing spaces.
Oct
28
answered How do I put YAML code in GitHub MarkDown?
Oct
27
answered Should a view and a model communicate or not?
Oct
24
comment algorithm to print the digits in the correct order
The problem with this solution is to properly cover edge cases. Logarithm is floating-point number (which are tricky themselves), not to mention, 10-based logarithm is not natural (natural is e-based one), so some more error can accumulate. Which can leads to situations, where log n will be off by one. So you should not blindly believe it, but test the edge case. Also, if you know you have an integer, it is safer (again, floating point, unsafe edge cases) to do things like (1234 - 1234 % (10 ^ [4-1])/(10 ^ [4-1])) to eschew the floating point.
Oct
24
revised MVC Can the model know ANYTHING about the view?
typo MVVC -> MVVM
Oct
23
answered MVC Can the model know ANYTHING about the view?
Oct
22
comment How can I explain object-oriented programming to someone who's only coded in Fortran 77?
OOP is (sort-of) simple, C++ "OOP" is not. Take Smalltalk (object has instance variables and a class, class has methods, you send message to and object which is serviced by a method, that's basically it). Prototype-oriented OOP can even put classes off the equation. --- That's why I would recommend (if possible) to only use subset (no private, no protected, no const, no multiple inheritance, all methods virtual, all destructors virtual etc.) so the model is simpler. Add other things later.
Sep
30
awarded  Nice Answer
Sep
26
revised Do any OO languages support a mechanism to guarantee an overriden method will call the base?
deleted 5 characters in body
Sep
26
answered Do any OO languages support a mechanism to guarantee an overriden method will call the base?
Sep
19
awarded  Nice Answer
Sep
19
comment Test Driven Development Code Order
@martiert: It is a wrong test. You do not test anything in that test (existence of class is implementation detail).