1,904 reputation
515
bio website blog.herby.sk
location Slovakia
age 40
visits member for 2 years, 7 months
seen 2 days 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.


Dec
6
comment Is Dijkstra's algorithm an appropriate solution to this signal routing problem?
@KimBurgess: Edited the answer.
Dec
6
comment Is Dijkstra's algorithm an appropriate solution to this signal routing problem?
@PeterTaylor: Interesting. Any source, please?
Dec
6
comment Is Dijkstra's algorithm an appropriate solution to this signal routing problem?
@PéterTörök: In that case, yes. Only the asker knows for sure. But when it is a tree, bfs is enough (and dead simple).
Dec
3
comment How did you pick up the art of solving real life problems? Can you shortcut the process?
@Maxood: Please, Smalltalk is not written with capital T. Thanx.
Dec
3
comment How did you pick up the art of solving real life problems? Can you shortcut the process?
@Maxood: Not at all. If you don't know the broad range of what (OO) programming is, your C++ (or whatever else) knowledge is just the desperate try. To use C++ (or whatever else) to its full extent, you must first know the concepts well, and then plug C++ into them, seeing what it really is. From my own experience, nothing learns you OO better (especially in world dominated by Java and C++) then Smalltalk. You then see C++ in context. You can then really use it as it was meant (because you see it in comparision).
Dec
2
comment How do you define, organize, and document your data?
Form: What I wanted to stress out is that someone who uses term 'OO-oriented classes' looks like a 13-year-old kid who just read his first book about OO and now wants to evangelize the rest of the world (not that you are be one, but the term is suggesting that way). Content: I'd oppose that objects (and restriction-enforcing constructors) are the answer. It can be answer in a monolithic environment. But if you pass data around between client written in JS and server written in PHP or whatever, and it can pass it along to something else, you need data, not the constructors for each language.
Dec
2
comment How do you define, organize, and document your data?
What's an 'OO-oriented class'? What other types of classes are there?
Dec
2
comment Elegant ways to handle if(if else) else
I use for(;;) just because do { } while(0) is longer. :-)
Dec
1
comment Where is the M in MVC?
The "real" controller of the old true MVC does processing of user inputs. The "misunderstood" controller of today's frameworks, which is fact Presenter and the pattern is MVP, not MVC (I'm talking about you, asp.net-mvc), the Presenter does some UI-related logic and is the mediator between the model and the view, since they are not directly connected any more (as they are in true MVC via Observer pattern).
Dec
1
comment Where is the M in MVC?
In the extreme case, when business logic is in the DB itself, you can have very thin model that mostly relays to the DB, or even say that db is your model (but then, it should have all the logic).
Dec
1
comment Where is the M in MVC?
Definitely. Nicely phrased.
Dec
1
comment Where is the M in MVC?
I see. You probably derived from my answer that you can see it a part of the model which serves to persist the application data which the code from the model processes. (I see the EDIT): If that database is something that must outlive the application, than look at the database as the external service, which model must communicate with, get data for computation and also send some back.
Dec
1
comment Where is the M in MVC?
(above holds only for scenarios when data in db are not shared with another application)
Dec
1
comment Where is the M in MVC?
The raw data you want to have persistent. In any organization that fits best for your model. The model is an API that makes your application logic live. That database is the storage for the (non-living) data. If it is possible for your app (I don't know which kind of app it is), try stop to think of it as a "database-backed app", but just an "app", which uses a database as a way to persist module data. Many problems stem from "iconizing" the database - it is nothing more than a data storage for the model; you can ditch it, restructure it or replace it if it helps.
Nov
30
comment Elegant ways to handle if(if else) else
Speaking of the evil solutions: I can have your solution without goto: for(;;) { if(!FileExists(file)) break; contents = OpenFile(file); if(!SomeTest(contents)) break; DoSomething(contents); return; } /* broken out */ DefaultAction();
Nov
30
comment Elegant ways to handle if(if else) else
That is taking ravioli to the extremities even I don't go to (and I am extreme in this)... I think now it is nicely readable considering the contents && f(contents). Two functions to save one else?!
Nov
30
comment How can I deal with the cargo-cult programming attitude?
@TMN: And the incremental "one (as easy as the developer needs) step at a time" would vanish.
Nov
30
comment Elegant ways to handle if(if else) else
Yes. Depends. @Benjol knows better.
Nov
30
comment Elegant ways to handle if(if else) else
Not if you restrict it to as local as possible scope. (function () { ... })() in Javascript, { flag = false; ... } in C-like etc.
Nov
29
comment Who can change the View in MVC?
In above mentioned patterns, Presenter is one that does it. Commands and changes the view and reacts to external events as well. They have subtle differences, but are fairly similar. Look it up at martinfowler.com, one of the great articles (more than one, probably, but I remember one) there is on this topic.