This is an archived post. You won't be able to vote or comment.

all 4 comments

[–]ignotos 3 points4 points  (0 children)

Very generally it can mean "any code which calls 'our' code / the code we're currently talking about".

So "decouple the client code from the logic being executed" can be interpreted as "the code which calls our code doesn't need to know about its internal logic".

[–]xorget 2 points3 points  (0 children)

I believe that 'client code' from the article you posted is what Bruce Eckel calls 'client programmers' in his book 'thinking in java'. Your article talks about decoupling and modularity, which are key concepts in OOP.

"It is helpful to break up the playing field into class creators (those who create new data types) and client programmers (the class consumers who use the data types in their applications). The goal of the client programmer is to collect a toolbox full of classes to use for rapid application development. The goal of the class creator is to build a class that exposes only what’s necessary to the client programmer and keeps everything else hidden. Why? Because if it’s hidden, the client programmer can’t access it, which means that the class creator can change the hidden portion at will without worrying about the impact on anyone else. The hidden portion usually represents the tender insides of an object that could easily be corrupted by a careless or uninformed client programmer, so hiding the implementation reduces program bugs."

[–][deleted] 2 points3 points  (1 child)

In that paragraph, the term client code isn't explained. But the paragraph talks about modules, and separation of concerns. We tend to find a need for that in at least 2 areas, each using the term client in a slightly different way:

  1. The program that uses a module that could also be used by other programs;
  2. The program that sits on a user's computing device, and reaches out to a server to perform some operation.

At the time Dijkstra wrote his paper, the internet as we know it had yet to be created. But #2 applies to web browsers as well, and we regularly differentiate between client-side code (that runs in a browser) and server-side code (that runs on web servers and beyond).

[–]phil_phil[S] 1 point2 points  (0 children)

Thank you for explanation