62,227 questions
Best practices
0
votes
3
replies
41
views
How to suggest movies that the user didn't see already in real time?
I am building a simple school project, and the idea is that users form a group together, then an activity (for example movie activity), and then in that activity the app suggests movies for every ...
Best practices
1
vote
7
replies
140
views
How to use better OOP for a Huffman Compressor
So I refactored my Huffman program for better OOP practices. Now, I need to make an array of coded objects that represent a character and its
// C++ program to implement huffman coding
#include <...
3
votes
2
answers
162
views
Compare 2 object lists and extract objects that are different in the two lists into their own list
I am making an application where one of the things a user can do is add items to a product with an associated amount. Items, products, and the amount of times each item is used in a product are all ...
Advice
1
vote
2
replies
90
views
in Dart why does String start with capital letters and not the other types
in java the primitives types like int, boolean, double,... are in lowercase and String is an object that's why it start with a capital letter(from what I know). But why is it the case in dart, ...
Advice
2
votes
4
replies
106
views
Order of loading classes in PHP
Please explain the mechanism of loading classes in PHP, and why the first example does not cause an error, but the second does?
From documentation:
Classes should be defined before instantiation (and ...
Advice
0
votes
9
replies
198
views
Why we need Classes and Object when be have Functions?
Why do we need Classes and Objects when have functions where be can create functions for each and everything.
In Python we have modules and packages we can work so why actually we need the Classes ...
Best practices
0
votes
3
replies
112
views
Filtering packets using recvfrom() and MSG_PEEK
I've got a UdpPeer class:
class UdpPeer {
struct sockaddr_storage remoteAddr;
socklen_t addrlen;
public:
UdpPeer(struct sockaddr_storage const& addr, socklen_t addr);
void ...
-4
votes
0
answers
81
views
Trouble Moving Points in Python Pygame [duplicate]
I'm attempting to render a rotation cube in python using Pygame and an explanation from Tsoding's video on 3d graphics. One problem I keep encountering is all my positions reaching infinity or -...
1
vote
1
answer
67
views
Object of classes, using "extends" to reference another class in the same object
https://jsfiddle.net/jenqhg3o/1/
A = {
Foo: class {
},
Bar : class extends A.Foo {
constructor (){
console.log("test")
}
}
}
var a = new A.Bar()
Is extending in this ...
Advice
0
votes
4
replies
114
views
How can I learn OOP in one month?
I want to learn OOP for an interview and understand how I can study it effectively within one month. Can I fully learn and understand the topic with ChatGPT's help and regular practice every day?
Advice
1
vote
9
replies
137
views
If a beginner asks you about the object, how do you explain it?
What if a beginner asks you a question about an object? How do you explain it? How does it work? What is the difference between a class and an object? Give a real-world example of an object.
Best practices
0
votes
5
replies
83
views
How to restructure a static Java database to differentiate between 2D (Area) and 3D (Volume) shapes?
I am building an app that identifies geometric shapes. Currently, I use a single ShapeData class to store all shapes in a static list.
My class uses a single field called volumeFormula for the ...
Advice
2
votes
3
replies
188
views
Is DDD the "Final Form" of OOP, or a necessary abstraction to save us from it?
we’ve used Object-Oriented Programming (OOP) to model the world through encapsulation, inheritance, and polymorphism. However, in large-scale enterprise systems, we often see OOP devolve into "...
Advice
1
vote
5
replies
159
views
Game Development Advice
I am currently a second year college student. I am studying audio engineering/music with a minor in CS. As a summer project, I've decided to make a prototype of a rhythm game; this would combine both ...
Best practices
0
votes
2
replies
57
views
Constructor config vs explicit method parameters for strategy interface: which is better for an order processor API?
I’m designing an API for order batching and would like opinions on one specific design choice.
Context:
An API request gives me only a tenant_id
From tenant_id, I load warehouse_layout
From ...