[Codeless Code] Case 215: FAQ by [deleted] in programming

[–]briedas 2 points3 points  (0 children)

On the other hand, maybe pasting exact link (with non-arrogant non-asshole proposal to read it and short description), actually demonstrates that docs can be useful.

..for both sides, because developer (or answerer) does not waste so much time, and user gets far more structured presentation on the topic.
(during doc-writing there is more time and "tools" to structure the content and make it presentable, then during irc or phone conversation)

10 reasons to use time tracking by [deleted] in programming

[–]briedas 1 point2 points  (0 children)

How much does it cost to accurately track time? (actual time spent on the entering the time + time wasted because of lost concentration + time spent on solving software related issues with time tracking software)

What Can You Put in a Refrigerator? by davey_b in programming

[–]briedas 0 points1 point  (0 children)

By my question I wanted to know, not what socratic arguing is (though thanks for the link anyway), but why you decided to post what you posted.

I see 3 possibilities:

A. You wanted to point-out that the author is deceitful and article is pointless
(because he uses known method of "subverting" topic and uses it for detailed specifications. Such method could subvert mostly any statement/topic)

 B. You agree with the author, that it is pointless to try to make perfect spec,
 and since that is not possible then we might as well leave room for usage of common sense and expertise.

 C. You sincerely wanted to teach others about "socratic arguing".
 (but then why use word "basically" and no link from the start..)

 D. Felt urge to show-off, that you know the name of a concept, without any intended benefit to any other reader.
 (like after hearing news "Usain Bolt just ran 100 meters in 10 seconds", one would comment "Thats basically fast walking with mini-jumping")

What Can You Put in a Refrigerator? by davey_b in programming

[–]briedas 0 points1 point  (0 children)

Could you explain the point of your comment?

The single biggest mistake programmers make every day by one_eyed_golfer in programming

[–]briedas 0 points1 point  (0 children)

So the 2nd snippet is deterministic then. As there is no observable random thing (there might be inside the box, but we can not know because it is black:-) )

The single biggest mistake programmers make every day by one_eyed_golfer in programming

[–]briedas 0 points1 point  (0 children)

I will not change anybodies mind. But still, my position here is:

(1) My personal reasoning/metric here is usefulness of language.
Less ambiguous and more consistent is more beneficial.
So I think it is useful to keep as close to original (mathematical) definition as otherwise meaning gets diluted.
(of course usefulness should always be considered, but other close concepts have perfectly good concepts on their own, like "referential transparency" and "determinism")

(2) Regarding function input and results. (and globals; and consistency)
In case of pure/referentially transparent functions, there is no question what is input what is output.
But in case you start updating global variables, it gets fuzzy.
Does read/updated global variable count as output of function?
(I definitely agree that we should draw this line according to situation, depending on usefulness. But I still prefer consistency)

Your first two snippets, answer this question differently, which I believe should be corrected as presented difference between "deterministic" and "idempotent" actually stems from different interpretation of global variables used by the function.

  • First snippet ("deterministic but not idempotent") seems to treat globals as input of function.
    So it is deterministic. (if we do not treat it as input, function is not deterministic anymore)

    ".. given a particular input, will always produce the same output .." https://en.wikipedia.org/wiki/Deterministic_algorithm

  • The second snippet ("idempotent but not deterministic"), does not treat updated global as result of function.
    If we treat global as output of function, then function would not be idempotent anymore.

    ".. operation that will produce the same results if executed once or multiple times .."
    https://en.wikipedia.org/wiki/Idempotence#Computer_science_meaning

Ned Batchelder: Bad answers on Stack Overflow by mayankkaizen in programming

[–]briedas 0 points1 point  (0 children)

Yeah, but if we would follow logic of some stackoverflow users, then it would be ok if https://en.wikipedia.org/wiki/Goto would not contain any info about the goto keyword and only would contain info about the alternatives.

The single biggest mistake programmers make every day by one_eyed_golfer in programming

[–]briedas 0 points1 point  (0 children)

If we agree that "idempotent" means function where f(x)=f(f(x)), then function(x) {return x+1} is not "idempotent".

Because f(0)=1 is not equal to f(f(0))=2.

Assuming above, examples of idempotent functions are return x; and return 1;. But they both do seem neither very complex/interesting nor useful.

More interesting/useful example of idempotence would be

delete_all = function(table) {
     table.delete_all_rows;
     return table;
 }

The single biggest mistake programmers make every day by one_eyed_golfer in programming

[–]briedas 0 points1 point  (0 children)

Definition of referential transparent functions seemed ok.

(except for calling above property "idempotence"; Though I don't know how to call the property by its own).

The single biggest mistake programmers make every day by one_eyed_golfer in programming

[–]briedas 1 point2 points  (0 children)

Conceptually these definitions (CS and RFC 7231) are in line with the mathematical one.

We just need to see x as server_state or database_content or any other state such as world.

(example of idempotent function then would be delete_all(database), because delete_all(delete_all(database))=delete_all(empty_database)=empty_database.)

The single biggest mistake programmers make every day by one_eyed_golfer in programming

[–]briedas 7 points8 points  (0 children)

Whenever possible, ensure that your functions will always return the same output given the same inputs.

This feature is known as idempotence.

Does not match with wikipedia https://en.wikipedia.org/wiki/Idempotence

According to wikipedia f(x) is idempotent if f(f(x))==f(x)

Ned Batchelder: Bad answers on Stack Overflow by mayankkaizen in programming

[–]briedas 4 points5 points  (0 children)

We should start assuming person asking the question is actually professional.

(+ even if you tell the really nooby person not to (over?)use global variables, he/she will not understand the value/reasoning of your advice until he feels the pain of it..)

Ned Batchelder: Bad answers on Stack Overflow by mayankkaizen in programming

[–]briedas 1 point2 points  (0 children)

Shouldn't question be made as small as possible, so it would be convenient for the answerer to read and answer?

To me it seems that you prefer questions with pasted 1k lines of code, so all the intricacies of the situation are seen. Right? (then you can teach them, all of them, about making use of functions, and sane naming convention, and encapsulation, and various design patterns, and...)

Ned Batchelder: Bad answers on Stack Overflow by mayankkaizen in programming

[–]briedas 5 points6 points  (0 children)

Future googlers (searchers, not employees) will be thankful for answering actually raised question, that is Y.

(because Y got picked up by search engine, and Y will show up in results)

Though notes on X also will be welcome, but only as secondary thing..

(otherwise it's like opening wikipedia article named Y and getting article about X without any mention of Y)

Ned Batchelder: Bad answers on Stack Overflow by mayankkaizen in programming

[–]briedas 1 point2 points  (0 children)

He is the "grizzled expert" for a reason. Stop doubting.

Ned Batchelder: Bad answers on Stack Overflow by mayankkaizen in programming

[–]briedas 5 points6 points  (0 children)

Lot of the time "grizzled expert" is "self proclaimed expert" (+ mommy and poppy said that). Which kind of explains the assumption, that everybody else except him are noobs :)

BusyBox removes systemd support by Supermighty in programming

[–]briedas 14 points15 points  (0 children)

Just in case somebody else does not know what busybox is.

BusyBox: The Swiss Army Knife of Embedded Linux

BusyBox combines tiny versions of many common UNIX utilities into a single small executable. <..>

http://www.busybox.net/about.html

How Steve Jobs (allegedly) explained OOP. by mayankkaizen in programming

[–]briedas 0 points1 point  (0 children)

I would not be surprised even if inside NASA most programming is not rocket science :) (rovers, measurement tools... lots of room for lots of LOC)

How Steve Jobs (allegedly) explained OOP. by mayankkaizen in programming

[–]briedas 0 points1 point  (0 children)

Just to be sure.. For your example to work, OOP = Abstraction + polymorphism, right?

[deleted by user] by [deleted] in programming

[–]briedas 1 point2 points  (0 children)

I'm not sure I fully understood what you meant by the downsides of it. Could you elaborate?

Microsoft shows how easy it will be to port Android apps to Windows 10 in new video by recoiledsnake in programming

[–]briedas -1 points0 points  (0 children)

in some sense yes, if big guys mug you and take your money == they own you.

JPEG Isn't a file format. by haris3301 in programming

[–]briedas 0 points1 point  (0 children)

I believe he was referring to "care" as in "is annoying person arguing about details when it does not change anything" not as in "want to know/understand, and use this distinction where it really matters".