1,132 reputation
722
bio website accelerando.euweb.cz
location Prague, Czech Republic
age 52
visits member for 3 years
seen Dec 15 at 9:04

Senior developer, algorithms master, PM, analyst, applied mathematician.

The Three Little Daughters Raiser

Hobbies:
logics, history, psychology, sociology, pedagogics, photo, cycling, hiking.

In past:
space-/astro- geodesist, cartographer, astronomer, teacher, radiometrist on the liquidation of the Chernobyl catastrophe in 1986.


Jan
27
comment How can I indicate if an object operates with another one in an UML class diagram?
DAO loads data from DB and CREATES instances of Entity. It is EXACTLY the answer for the question.
Jan
18
comment Replacement for instanceof Java?
@delnan The author says he should avoid instanceOf with the reason, as I understood, being purely administrative. At least I don't know the reason. So, I can't argument for other ways, I can only propose variants.
Jan
18
comment Replacement for instanceof Java?
After reading from a DB, you are setting the value to a freshly created object. It will have a class as declared, not necesarily equal to the class of the read value. So, you have to find out what class you have. Or what sort of data a class has - in the case of single class with switching among different classes of data
Jan
18
comment Replacement for instanceof Java?
@Schmooo Are you sure you need three different classes? Maybe one class with a switch inside will serve better?
Jan
18
comment Replacement for instanceof Java?
@Schmooo And getClass should be avoided, too?
Jan
18
comment Replacement for instanceof Java?
@delnan The QA was - what else except instanceof can be used. I answered it. And added a link to comparison. As a bonus. So, your attack is excessive.
Jan
18
comment Replacement for instanceof Java?
@Schmooo If you have saved an instance of a class in some way that preserves the class, you can use either getClass or instanceof. If you haven't preserved the class, you can use neither.
Jan
18
comment Replacement for instanceof Java?
I have nothing against your first sentence. But the second one - sorry, I can't understand what do you mean at all.
Dec
31
comment How do I prevent unknowningly duplicating code?
@Secure 1. I thought I had explained it. Yes, in more theoretical terms, but I am talking to professionals. 2. As for "very often" or "very rare", I think, it depends on the language, frameworks used, the general task and the style of programming (I mean, Pascal style applied to Java etc.). 3. And what is "very often"? For me it is more than once for a project :-)
Dec
30
comment How do I prevent unknowningly duplicating code?
You have forgotten to mention what is the usefulness of expressing two algorithms that only look similar, but really are different, as one module? The code should express the logic of the task. It is my point. You insist that it is bad... Hmmm. You need really hard arguments.
Dec
30
comment How do I prevent unknowningly duplicating code?
@Secure Yes, you can't make code absolutely safe against changes, but you can make it safer. Otherwards all posts on this theme are senseless - go and punish all of us.
Dec
30
comment How do I prevent unknowningly duplicating code?
@Secure If you have two same pieces on different places, and these pieces are really the same - than if you have them united, the possibility to create a new mistake while changing that piece is lower. If these two pieces are the same accidentally, than uniting them will, on the contrary, create dangerous situation, it is very possible that you will need the change in merely one of them. And you will forget that it is used in another place where it is expected to remain the same.
Dec
30
comment How do I prevent unknowningly duplicating code?
@Spoike In the first two cases the potential code duplicating is bad and should be wrapped in some function/class/component/etc. In the third case it is not bad and should be left as is. Where do you see contradictions?
Dec
29
comment How do I prevent unknowningly duplicating code?
@Spoike Yes, it could be extracted, but I consider it ineffective and dangerous. Don't forget the target is to create a code safe against changes - that with greater probability remains correct during changes, not to fulfill some set of rules. Rules are secondary, not the vice versa.
Dec
28
comment How do I prevent unknowningly duplicating code?
@Spoike Sorry, I don't see any contradiction in the first 2 points. Could you explain it, please? As for example, there are very many primitive ones. Any logical structure that you use fits. For example, in matrix algebra programming I had used hundreds of times exactly the expression: "for(i=0;i<n,i++){}". But never had I heard about using a function instead. The logical construction could be longer - several lines, for example, but the rule remains - accidentally coincidence is not a rule and shouldn't be realized by such (function etc.)
Dec
28
comment How do I prevent unknowningly duplicating code?
I have put here arguments. You haven't. The reference to authorities won't work since 16th century. You can't guarantee that you have understood them correctly and that they are authorities for me, too.
Dec
28
comment what is the best way to ensure accountability in code checkins?
I have to learn the way of use both git and gerrit. I haven't used them yet :-). We use svn+fisheye+bamboo+JIRA now. But we want much more code reviews and some control will be useful
Dec
28
comment How do I prevent unknowningly duplicating code?
Should I bow to your authority? I had put my reasons here. If I am mistaking, show where is the mistake. Now it rather seems as your poor ability to keep discussion.
Dec
27
comment what is the best way to ensure accountability in code checkins?
+1 very interesting. Surely I'll try to use your advice.
Dec
24
comment As a junior programmer, how do I quickly make changes to large unfamiliar software?
I have in IT for 30 years and only the last year I am working on a project that uses test units. Advising to rely on test units (personally I do not consider them a nice change for analytic documentation), be at first sure that there really are some.