62,234 questions
Advice
0
votes
4
replies
84
views
How to learn OOP in 1 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
117
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
72
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
178
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
154
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
51
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 ...
1
vote
1
answer
53
views
In Racket, how can I access an object's field without knowing the field's name at compile time?
I'd like to write a function that can access an arbitrary field on an object, given the object and the name of the field:
#lang racket
(define (get-field* field-name obj)
(eval `(get-field ,field-...
Best practices
0
votes
8
replies
132
views
How do I determine the concrete subclass of an Object knowing only the abstract superclass?
I'm using an external library which builds an internal representation of an abstract syntax tree (AST) for a toy programming language given an XML file representation of the AST.
The method I'm using, ...
1
vote
3
answers
224
views
no match for call to '(student) (std::string&, int&, int&)'
I'm trying to create an array of class student that I initialize later:
#include <iostream>
#include <string>
using namespace std;
class student{
private:
string name;
...
Advice
1
vote
6
replies
244
views
C# turn-based combat system - code review and best practices?
I’m working on a small turn-based 1v1 console fighting game in C# and I’d really appreciate a general code review focused on code quality and best practices.
The idea is simple:
Each character has ...
1
vote
1
answer
113
views
Troubleshooting creating a Word document in an Excel vba Class module
For various reasons, I am currently refactoring some code to a more OOP approach. I am immediately having the following problem: When the Create method of the class module creates the new Word ...
Best practices
0
votes
1
replies
57
views
In LLD interviews, should class design be driven by domain modeling, database structure, or API/use-case access patterns?
I am trying to understand how Low-Level Design (LLD) should be approached in interviews.
My confusion is that the design changes depending on the perspective I start with.
For example, if I design ...
Advice
1
vote
12
replies
171
views
Should I focus on coding exercises or building projects to learn C++?
I am a begineer and i want to learn c++ by doing projects please suggest me any project that i can do to increase my experience of c++
my old projects are:
hang man game
bank management system
has ...
0
votes
3
answers
207
views
How to refactor multiple if-elif statements into a Strategy pattern in Python? [closed]
The Problem: I am building a simple data processing tool. Depending on the file format (JSON, XML, or CSV), I need to apply different parsing logic. Currently, I’m using a long chain of if-elif ...
4
votes
2
answers
174
views
Get multiple indexes of an array at once, for comparison
I am working on a Tic_Tac_Toe project. I have an object (gameBoard) that contains an array, then I have another object that i want to create a player from to play on the board, then I have a function ...