People, machines, programmers

There is a feeling that there is a certain gap between the practice that you face when you start working as a programmer and the theory that you dive into. Not a contradiction, just a small white spot. The entire theory focuses on data structures, algorithms, patterns, paradigms, and principles. Practice (read "making money") revolves around the relationship and communication of people - the parties to the contract for the manufacture of software products to solve their pressing business problems, often very mundane. And the situation becomes as ironic as possible when, with knowledge of all these principles and best practices in the task of making a conditional Internet store, we get a terribly confusing code and the project surrenders as a feat. I want to share a metaphorical idea,which for me works as a missing link between the high matters of structures-algorithms and the mundane questions of users β€œWhere is my favorite button gone? !!”.





m-

: β€œ ” β€œ ”. :  β€œ , β€œβ€ ()”. 





-





button_salaries.Visible = user.Permissions == Permission.Max







, - . , , , , - , - .   - ?





, , ,  :





if (user.Permission < Permission.Max) throw new Exception()







, , , - , β€œ ”, , , - , . - .





, - . - - . β€œm-” β€œMachines”. , , β€œβ€ . 





  - β€œ, ?!!” , . - , - . , , , β€œ ” - . . , - -   -  ? , , β€œβ€ β€œ ” - .





h-

, , - β€œβ€ - . , ?   . , : , m-. - - h- (β€œHumans”). 





, , m-. , , , UI : , . 





, ? - Salaries



try..catch



, , , m-. , . -. , - , .   h- : , - . , , , , - .





- , β€œ! ! !”   -, . , , , - , -   , ? - .





, , , m- . , Salaries



.  , - , - .  





bool Salary(User user) => user.Permission < Permission.Max;







, , .





if (!Permissions.Salary(user)) throw new Exception();







? , β€œβ€.   -  m- - . - h- . m- - .





,   - , . - - , .





, h- , β€œβ€ : . , - , β€œ ! !” h- UX . 





- . m- , h- ui-, .. .  0 null - UI- -   ?





, h- - - , , .





d-

β€œ ”. 1 , (Permission.Min



) 2 , (Permission.Middle



).





, m- :





void Job(Permission p)
{
    if (p == Permisson.Min) Counter = Counter + 1;

    if (p == Permissiio.Middle) Counter = Counter + 2;
}
      
      



, : , ,



- - , ? , - BetweenMinAndMiddle



? , . , β€œ, - . - ”. 





- , , , . , - - . , , , β€œ ”. m-. p, - , , : ? , - - - . ?





? . - 0 , - - , . , - ( ). , - - . , .





, - , d-? , m- , β€œβ€ , , . , d- - , , Fatal, Error, Warning . ( , .)





, , h- - , . , , Test()







(!Permission.Salary(user) && button_salary.Visible) Warning(β€œ , !”)







d- . , ? β€œ, - !”.                     





HMD

. , . , , - . , , ( ) , .





, , ,   , , . - try..catch



, - . , m-, .





, , . , , , d- - .





, ,   . , hmd- - - - .





, - m- - , h- , . .





h- , d-. , , . h- .





  h-, , , . UI-, - β€œ-”.





m- . , -  " " .





, , - - , . β€œβ€ , , . 





, - β€œβ€ -   β€œβ€ - . 





,   β€œ ”, β€œ UI” - β€œ ”.





, , , : β€œ ”. , β€œ ” , . , . hmd , . , , , , . , , - .





In my understanding, to make good software, you need to pursue two goals: to correctly manufacture each of its individual components and then to connect these components correctly. Hopefully, the metaphor in this article can help you with both.








All Articles