Yahoo Answers is shutting down on 4 May 2021 (Eastern Time) and the Yahoo Answers website is now in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

?
Lv 7

WHY do we have "classes" in evry b**y programs?

I CANNOT find the advantage of having "classes" in every languages...

I watched a lecture: "Don't use classes", where a multi MB code was, in the end, solved with a couple of lines (Without classes)

I used classes ONCE, for creating a PDF.

I had to define "sub-class" for what I needed. Mb of code for NOTHING!

What's the point?

I now find students working on classes, who are not able to understand the BASICS of programming!

I am lost!

You are including a class in your programming. It has 100 of methods, and you use ONLY ONE method!!!!

What's the point????

Update:

I understand your point of view, although I still disagree, mostly because I write programs that run on SMALL machines (not a PC with Gb of RAM and huge hard drives), so I am limited by SIZE... A code written in C++ with classes occupied 12Mb of space, the SAME program, in assembler (no class, no C, no C++) occupied ONLY 2Mb...

2 Answers

Relevance
  • 3 years ago
    Favourite answer

    I am not entirely sure what you problem with classes is. Classes are one of the fundamental elements of object oriented programming, you can't do object oriented programming without them. Not every language has classes, only object oriented languages.

    You said "has 100 of methods and you only use one", this sounds to me like you are using a programming library someone else wrote. It's not uncommon for libraries to have lot of functions you don't need, but that has nothing to do with classes, the same thing can happen with non-objected oriented libraries. In these cases you have a couple options. You can just use the class and not worry about the other methods, you can find a "leaner" library that just does the things you need, or can write it yourself, but often that create more work then it saves. The PDF creator is a good example, you could write your own, but you could spends weeks if not months writing even the most basic PDF creator, much better to use something that has already been created, it will save you a lot of time and headaches.

  • kathys
    Lv 4
    3 years ago

    I am not entirely sure what you problem with classes is. Classes are one of the fundamental elements of object oriented programming, you can't do object oriented programming without them. Not every language has classes, only object oriented languages. You said "has 100 of methods and you only use ...

Still have questions? Get answers by asking now.