Questions tagged [object-oriented]
Object-oriented programming is a programming paradigm using "objects": data structures consisting of data fields and methods together with their interactions.
3,799 questions
81
votes
6
answers
233k
views
Design a chess game using object-oriented principles
I would like to know if my approach is correct and how could it could be improved? Also, is there a way to get rid of the relation between the Piece and the ...
61
votes
11
answers
14k
views
Sales tax calculator, rejected for being not OOP
I applied for an Application Developer position. They require all their applicants to complete 1 of 3 programming assignments. I picked one for sales tax calculation. It was quite simple.
Write ...
57
votes
2
answers
60k
views
Class for reducing development time
There are many PHP PDO classes out there, agreed. However I find they do not allow for flexibility. So I created one that helps reduce development time as little as it may be but it does the job (...
43
votes
5
answers
41k
views
Designing a coffee machine
I was recently rejected from what looked like a really promising string of interviews. I did very well in a questionnaire style review, and then they handed me this assignment (more or less):
Design ...
39
votes
2
answers
14k
views
A new approach to multithreading in Excel
Intro
Multithreading tools exist in Excel - often to run macros in multiple instances of Excel, or to convert macros to vbscripts that can run independently. However I've often come across projects ...
38
votes
4
answers
8k
views
OO coffee dispenser
This picture inspired a contest between a few of my friends to rewrite this code in more proper OO style.
This is what I have come up with.
Any thoughts:
...
34
votes
5
answers
154k
views
Modifying an array during a foreach loop [closed]
This question is always on my mind. I usually alter the array while looping through its keys, based on my gut feelings:
...
33
votes
6
answers
3k
views
To 'this' or not to 'this'?
I was given a homework and I have 2 solutions: one that uses this and other one that doesn't.
I tested both solutions on jsPerf but sometimes it says the version ...
31
votes
1
answer
4k
views
Unit Testing in VBA
Unit testing in VBA is... lacking. (What isn't lacking in VBA though?) Since I've become more interested in unit testing lately, I decided I needed something better than ...
30
votes
7
answers
29k
views
Basic OOP Poker - Deck, Cards and Hands
I decided it would be interesting to simulate a game of Poker. Baby steps at the moment, and eventually I'll attempt to turn it into a GUI. The code I have so far is very basic such as populating a ...
30
votes
5
answers
19k
views
A Fraction class in C++
I am trying to learn clear and concise C++. Currently I'm learning classes in school, and to practice I have made a Fraction class.
I'd appreciate any help regarding style, cleanliness or anything ...
29
votes
1
answer
662
views
Lua OOP and classically-styled prototypal inheritance
I want to do some object-oriented programming in Lua, and I decided on something like this:
...
29
votes
1
answer
6k
views
Extensible logging
Whenever I need logging functionality in .net, I use a logging framework, such as NLog. Obviously there's no logging framework for vba, at least none that I know of.
As much as I love using NLog, the ...
27
votes
6
answers
13k
views
Simulating an OOP Coffee Machine
Today I learnt the basics of OOP. I have tried to apply them to this coffee machine project. However I'm still a beginner, and so I feel my code can be improved. Are there any tips, trick or other ...