Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
2 votes
5 answers
1k views

Class method Vs. Interface?

I am relatively new to C# and OOP concepts in general, but am building a standalone application and have run into a question and want to make sure I'm doing it the "right way". I have a few ...
adc395's user avatar
  • 39
1 vote
2 answers
155 views

Going from Javascript to C++. I have teacher and student objects, and I want to display if they are teachers or students. How should I do this?

This may be too general of a question, but basically whenever I try to find an answer for something that would work from a Javascript approach, the answer heavily implies that you wouldn't do it that ...
sheepdeets's user avatar
0 votes
2 answers
4k views

Terminology: Classes that contain only methods [closed]

I am studying the programming language Kotlin, and I just came across the idea of a Data Class. I have a background in Java programming where classes can have fields and methods. I have heard ...
Steve T's user avatar
  • 141
5 votes
8 answers
2k views

Rule of thumb for deciding which class a method belongs to

For example, imagine a website which stores results about a certain sport or game, which has a typical "season" structure, such that there's both a Player and a Season class. To retrieve a player's ...
Cal7's user avatar
  • 377
112 votes
9 answers
180k views

Why have private static methods?

I just wanted to clear up a question I have. What is the point of having a private static method as opposed to a normal method with private visibility? I would have thought an advantage to having a ...
Rehan Naqvi's user avatar
  • 1,239
1 vote
1 answer
3k views

Dynamic method creation in python

I have a class that will have a number of external methods that will all call the same smaller set of internal methods. So something like: obj.method_one(a, c) and obj.method_two(a, c) where obj....
tonyl7126's user avatar
  • 297
3 votes
2 answers
3k views

Should I put utility methods inside a class?

I have been working on a library which contains a large set of functions. For the sake of simplicity, I am going to use just one set as an example. I am not sure which is the better way, in terms of ...
topherg's user avatar
  • 561
9 votes
2 answers
3k views

Refactoring several huge C++ classes / methods. How to start? [duplicate]

Possible Duplicate: I’ve inherited 200K lines of spaghetti code — what now? I'm dealing with legacy code. It contains some BIG classes (line count 8000+) and some BIG methods (line count 3000+). ...
TobiMcNamobi's user avatar
  • 1,171