Reputation
2,128
Top tag
Next privilege 2,500 Rep.
Create tag synonyms
Badges
7 19
Newest
 Enlightened
Impact
~33k people reached

Dec
26
comment Are there any programming languages that follow a minimalist development approach?
"Worse is better" effect, and in case of Smalltalk also some marketing mistakes (it has its heyday in 80s but it was expensive so C took over). Performance was not the main issue (and is definitely not now, when compilers are much smarter, look up Self project if you want more details on this). But Lisp is THE functional language (and its descendant Haskell performs good), and Smalltalk is THE object-oriented language (Pharo is the contemporary professional dialect, and is free, with constantly developing VM).
Dec
13
comment DDD and Value Objects. Are mutable Value Objects a good candidate for Non Aggr. Root Entity?
Is there such thing as "mutable value object"? I always had the impression value objects are immutable.
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
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
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
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
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).
Sep
19
comment Test Driven Development Code Order
@ollins: Yes. Or, from the bigger PoV, "Never write a line of code without a failing test.", that is, never write any piece of production code which is not necessitated by existence of failing test and which makes this failing test pass. Kent Beck calls this approach "test-infected".
Sep
18
comment Misunderstanding Scope in JavaScript?
Sort of. I said it can't be "passed" because by passing I meant giving it to someone else to manipulate. But it is not passed in that sense, it is just "brought with" the closure - only the code inside the closure can see/manipulate it. But these are the details (the devil is in the details ;-) ). BTW, functions returning functions are pretty common stuff in JavaScript; usage of closures to "simulate private variables" etc. are common patterns which all base upon closures (returned from other functions) having lexical scope.
Sep
18
comment Misunderstanding Scope in JavaScript?
GlenPeterson said it right. apply and call are about setting this for a call; there is no way to pass scopes at all. But you must take into account that functions are in fact lexical closures so they take hold of their scope for their lifetime. The articles aim to show this, that is why I recommended them.
Sep
6
comment software architecture (OO design) refresher course
I would add more than +1 if it was possible...
Sep
5
comment Does software testing methodology rely on flawed data?
IIRC, Kent Beck did not say the curve is flat after the first rise, only that it is "almost flat" but still rises slightly.
Sep
4
comment How to write reusable code in node.js
It is not very clear what is your problem, maybe rephrase it. I'd have two comments: 1. Maybe you just need to get used to async/callback way of doing things, I do not see anything like "unmanageable code soup" there. 2. Ad "loosely coupled classes": do you really need "classes" there? Classes are not needed to do OO neither to do good design. Maybe change the title.
Sep
3
comment Is there a difference between multi-tasking and time-sharing?
With multiprocessor / multicore, you can have true multitasking where more programs actually run at the same time in parallel.
Aug
28
comment Why the overhead when allocating objects/arrays in Java?
C also has an overhead, each malloc-allocated block of memory needs a header which free then uses.
Aug
9
comment Is there a programming language where 1/6 behaves the same as 1.0/6.0?
In all Smalltalk-80 derivates (that is, nearly all Smalltalks). Amber is one of contemporary exceptions (which is understandable, being compiled to JavaScript).
Aug
1
comment How have languages influenced CPU design?
Maybe a possibility to reuse code without its recompilation is also of some marginal usability point for BP addressing. And God knows if BP addressing instructions are not faster in circuitry than SP addressed ones, since BP addressing is sort of standard...