Meaning of "code acting on data" and "data controlling access to code"

Asked

Viewed 201 times

7

This is a purely theoretical question about programming.

I would like to know from an example simple (response with complement of figures, drawings, etc.), the meaning of two sentences for two types of programming languages:

  • structured: "the code acting on the data"
  • object-oriented: "the data controlling access to the code"

1 answer

9


Not everyone agrees with that, but it’s just a way of thinking that makes little difference in the end.

I don’t know where you saw that comparison, but it already starts wrong. Programming structure, contrary to what may seem is about the algorithm. And object orientation is about the data structure, is about the organization of the code. So it doesn’t make much sense to try to counteract these two ideas.

The same goes for the imperative, which makes a little more sense to counteract, but not too much. It makes no sense to choose one or the other, they are complement. A object orientation is a secondary paradigm (in fact some people consider that guidance is even paradigm).

The "opposition" of object orientation is the procedural programming.

Hence it is already seen that much is said about the subject without much knowledge of what it is actually about. Much less it makes sense to separate language in structured or object-oriented. This is simply a wrong concept.

Almost all the time the code of people are imperative and with some use of object orientation.

What you probably mean by these phrases is that the most imperative pure code you call actions that will act on data and the object-oriented code you take the die and call an action on top of it.

Procedural imperative:

substring("abc", 3, 1)

Object-oriented imperative:

"abc".substring(3, 1)

I put in the Github for future reference.

So it ends up being just the first invoked behavior, or the state. So in the first the code of substring() act on the text "abc" (procedurally acts on the object), while in the second you have the text "abc" controlling access to the substring() (the object calls the procedure).

Besides helping an IDE fragment more easily what it can do with the dice, it changes very little and it is silly to fight more for one style or another. Object orientation has some advantages, as well as disadvantages in other parts.

This facility is even worse because many people think that the fact that it is easy to find the methods that the object can perform does not require you to study the documentation, and it ends up making much worse codes. Worse, by wanting to do what is fashionable anyway she ends up doing what she does not understand.

May be useful:

  • The phrases are contained in the book "Java para inicnantes - 5ª ed. - Herbert Schildt - editora Bookman - pág. 9". And the two sentences are written exactly like this.

  • 5

    He is considered one of the worst book authors on the market.

  • Being one of the worst and in the 5th Edition, the area’s book market is pretty bad so rsrs.

  • 3

    @Sam thanks for the opportunity to go into more detail. That’s what I always say, usually the layman in something is the person least able to assess whether something is good. She is always able to say what she likes, what he saw beautiful, but well depends on the person being qualified in that. Hence the famous https://en.wikipedia.org/wiki/Dunning%E2%80%93Kruger_effect. People always think they know more than they really know. And they feel entitled to indicate products that they can’t properly qualify you, ...

  • 3

    ....therefore indications of study material should only be considered if it comes from someone demonstrably very qualified, but we enter into a dilemma since the layman also does not know how to qualify his source of indication. People tend to trust random people on the internet for everything. It is true for politics, it is true for consumer decisions in general, and it is true even for someone who should follow a scientific criterion. It is even valid for the person to choose the one who votes or chooses answers here on the site.

  • 3

    So we usually say that acceptance is not worth much, it is the option of someone who clearly does not understand the subject, hence the larger vote tends to express better quality. It is not perfect, it is a little generalization, but it works better as a parameter. One of the reasons we do not accept indication of books and the like. People will post and vote for material popular, which is quite different from qualified. Schildt is a strong shelf author, made a mark, strengthened among laymen and turns the vicious circle, lay people continue indicating his books, ...

  • 3

    ... and continue to be laypeople believing in a lot of the wrong things published in these books (of course, there are a lot of right things too) and these people spend their whole lives believing in the wrong things they have learned. It’s very common for people to be stubborn with the second source they receive, so if she learned wrong at first it’s hard for her to change her mind afterwards. It is common for people not to look for a better source, not to take the test and to stick to their opinion rather than the fact. And yes, the computer publishing market is composed of a lot of problematic product.

  • 3

    The material on the internet then is not even spoken, almost everything has problems, and are usually the most popular sites. And so people remain full of holes in learning by believing in Saci Pererê. It happens to everyone. That’s why you have to keep your head open and always get better. Since I started posting here I’ve improved the understanding of a lot of things that used to be flaws, especially about object orientation, the subject that probably has more flawed material, and almost certain that the subject that people most want to master and do not get to understand even the basics of basic.

  • 5

    The reason I answer here is that I learn a lot from the doubts of others. I will put here some links on his books: http://www.lysator.liu.se/c/schildt.html, https://softwareengineering.stackexchange.com/a/7031/389 (see more on the same page), and here is a defence attempt, but careful reading shows how these books can destroy people’s little heads and make them believers: https://www.quora.com/Why-is-herbert-schildt-C-a-poor-book.E aidna https://www.quora.com/Why-do-many-programmers-dislike-Herbert-Schildts-books, ...

  • 3

    I understood your position perfectly, and I even support it. I think that what is sold around is not always the best. I believe that has much of the marketing issue, what is worth is the $ coming. If the guy arrived in the 5th edition does not guarantee quality, but in number of sales, it does not matter if the material is good or not, but is "swallowed" by a lay mass that thinks it is good. I give credibility to what you say because I know you understand the subject. I myself already bought books that after a while I saw that it was nothing but sensationalism and seasonal marketing, and I saw that the whole thing was silly...

  • 3

    http://www.cs.technion.ac.il/users/yechiel/CS/BadBooksC+C++.html ( Jamsa was very bad, but it seems that he disappeared, had a national authors who was of this level, sold horrors, has defenders until hj despite the amount of errors that he put in his books, complete relaxo), https://www.seebs.net/c/c_tcn4e.html, https://www.reddit.com/r/learnprogramming/comments/143wjc/whats_wrong_with_herbert_schildts_books_on_java/, http://www.catb.org/jargon/html/B/bullschildt.html (look how far we’ve come, there’s a term about his books), and the list goes on and on.

  • 4

    I have a lot of crap on my shelf (or had) some I’m discovering the problem more recently. Of course all books have good things, teaches more than misfortune, but the damage they do is too great. Today I read everything with one foot in the back, I will look for other sources, see if it makes sense. Even so I still fall into traps. Everyone falls, even some very consecrated people. That’s why so many people are buying bad ideas in dev that only serve to sell book, course, consulting, auxiliary tool, unnecessary service.

  • You spoke, we spoke rs... !

Show 8 more comments

Browser other questions tagged

You are not signed in. Login or sign up in order to post.