I do not understand the use of legal jargon to describe a template or format etc within a programming language. When I write a method with parameters, I am not making a contract, I am making a template that requires that input or it wont work. Sure a contract is the same in the sense that if you don't fulfill it then you don't get whatever the other end of it is, but the term holds far greater meaning and reach than a programming language format can contain. You can sue someone for breach of contract... If I use a class someone else created in my code and fail to provide it the right parameters causing the class to not work correclty, they can't sue me for it, again it really isn't a contract, its just a format or a template etc.
Thank you for any insight.
Why are interfaces and almost everything in Java referred to as contracts?
Under discussion
Comments (4)
- Popular
- New
- Old
You must be signed in to leave a comment
Guadalupe Gagnon
1 October 2021, 17:15
Analogies are used to help understanding, but are almost never exactly perfect. Another analogy often used is that class code is described as a blueprint for objects, but you don't need to gather materials such as lumber, nails, and glue in computer programming.
0
Jason
8 October 2021, 17:32
Ok, thank you. Does CodeGym address GUI and eventhandling and such in the lessons?
0
Guadalupe Gagnon
8 October 2021, 18:31
event handling is touched upon in the later levels, above level 20. They do use JavaFX (a gui library for Java) for the games, though there are no lessons.
0
Jason
14 October 2021, 02:16
Thank you very much!
0