Object-oriented programming is a programming paradigm using "objects": data structures consisting of data fields and methods together with their interactions.

learn more… | top users | synonyms (3)

1
vote
1answer
24 views

Class to create dynamic php + mysql queries (safely)

I've started to learn PHP classes, interfaces, extends and things related to those. Before this i've worked only with functions and it started to be quite a mess with hundreads of separate functions. ...
0
votes
1answer
16 views

NestedHash Class

I want to make a Ruby nested hash table class to avoid repeating ugly code and to keep my programs as true to the OOP paradigm as I can. Are there any ways to make this class definition smaller ...
3
votes
0answers
42 views

Expression parser using Shunting-yard algorithm

I've been working on a expression parser which will be part of another project (some sort of DSL). This parser basically uses the Shunting-yard algorithm, except for the case of parenthesis: here it ...
9
votes
1answer
578 views

Simple one heap Nim game, OOP exercise

I wrote this game to practice some simple OOP. You play against the computer, but be aware that the computer has no real AI, as it just generates its moves randomly. The loser is the one whose turn it ...
5
votes
2answers
51 views

Randomized Lighting with Python

I use this to automate the lights in my home while I am away at night (simulating presence). The scheduling of when this runs is handled by my home automation software (Indigo Domotics). I'm open to ...
0
votes
0answers
26 views

Delphi 2009 Interface Memory Leak

I have this code and at the end of it, FastMM shows that there were memory leaks with all the objects of TSinc. ...
6
votes
1answer
320 views

Logging object for C++

I've been always updating my log methods, because I started SDL and I needed some new methods. First, I made difference between debug and release, and so console and file. But now I want a more ...
2
votes
1answer
44 views

OOP shortening class

This is not so much a question about execution as it is a question about improving code. I am a 2nd year student, we started to touch on OOP recently and I am finally getting the hold of it....sort ...
-4
votes
0answers
25 views

How can call both :this() and :base() in this specific case? [on hold]

I have a base class EntityModel (it needs to work with a database) ...
-1
votes
0answers
32 views

creating this string representation for this puzzle [on hold]

i am trying to make this jigsaw puzzle. class is jigsaw and im trying to import this script called Piece. ...
3
votes
1answer
43 views

City and District class examples for teaching OOP in PHP

I wrote these two classes for teaching OOP in PHP. Do you think it's breaking some good practices or SOLID principles? ...
2
votes
1answer
39 views

Simple calculator in PHP utilizing MVC

I have been struggling with understanding Model, View, Service, Controller architecture and wrote some code. Is my Model class the Model part of MVC (did I define ...
5
votes
0answers
31 views

Node that makes bots jump with weapon thrust

Today I decided to continue working on a UnrealScript (Unreal Engine 1) class that lets bots jump onto ledges by firing weapons beneath themselves. (The only problem is that they don't aim and jump ...
1
vote
1answer
45 views

Popup on footer to make an email list

I'm creating a simple popup to be shown on footer of pages to make a email list. I would like you to give a look at the code below if possible .. and would appreciate some suggestions in respect of ...
-4
votes
0answers
31 views

C# : Using struct , List and enum [closed]

I have enum called Department that has abbreviations. (e.g. CSIS, ECON etc.) I have struct Course with fields name, number of the course(e.g. 101 Fundamentals Of Computing just the number). I created ...
12
votes
3answers
681 views

Snakes Game Using ncurses

This is my version of snakes in C++ using the ncurses library. I would like to hear from you how this piece of code can be improved and general advice for future projects regarding coding and ...
4
votes
2answers
84 views

C++/SDL2 “Space Invaders”

My biggest issue in this project was the structure of the code and using the necessary data structures. I organized it to the best of my ability but I am sure there much more room improvement and I ...
2
votes
1answer
29 views

Slider control constructor

I've made myself a JavaScript slider constructor. You can create new sliders and tell it what elements it should refer to. ...
2
votes
2answers
51 views

Random positioning and movement of a rabbit on a table

I was inspired by this: If you would put a rabbit randomly on a circular table with radius r= 1 meter and it moves 1 meter in a random direction, what is the chance it won't fall off? I ...
8
votes
2answers
754 views

Skill creation in a python text based RPG

I am in the process of creating a text-based RPG for the purpose of learning more about OOP in Python. Right now things are going well, but I'm facing a problem that I don't exactly can find a good ...
3
votes
1answer
34 views

Wrapper for complicated Range manipulation

I'm playing around with a class module to try to wrap up some complicated(ish) Range manipulation in Excel-VBA. I might have a situation where I know the red range spans my target (the target is to ...
-2
votes
0answers
28 views

OO architecture for small game [closed]

I have a small space invaders game. The game consists of monsters, bullets and a rocket (the player). I have implemented this game in a functional language with ADT's, but in retrospect I think I ...
2
votes
2answers
115 views

Java method to check if a binary tree is a valid BST

I wrote a Java method (along with a private class) to check if a binary tree is also a binary search tree (BST). I would like some feedback on the design of my solution. Here is a brief description ...
4
votes
3answers
68 views

Playing with light switches

When you were a little kid, was indiscriminately flicking light switches super fun? I know it was for me. Let's tap into that and try to recall that feeling with today's challenge. Imagine a row of N ...
2
votes
0answers
12 views

Base class for the Oauth process and dance

At work we are interfacing with the Jira cloud storage for our ticket management system. I created a base class to make the process easier on the user side, and I did my best to make it re-usable and ...
11
votes
2answers
137 views

Forecast maintenance interval for fleet of aircraft

Being new to VBA, and many years removed from college programming courses in Java, I'm seeking opinions about design, implementation, readability and general better practices using VBA to tackle ...
10
votes
1answer
300 views

Implementing a String class using reference count

Design a STRING class. Provide support for: Assigning one object for another Two string can be concatenated using + operator Two strings can be compared using the relational operators ...
1
vote
1answer
30 views

OPP Sign In/Out procedure in PHP

As a self-taught student of Web-Development and Web Technologies, I created a simple sign in/out form in PHP, just for practice purposes and some fun! I read the O'reilly's book about PHP and I found ...
4
votes
1answer
92 views

PHP Route class

I was trying to keep it SRP. I'm new into PHP OOP and I'm wondering how I can make it better. Route.php ...
0
votes
0answers
15 views

Applying MVC design pattern to a Java SWING application

As the title says, for the last couple of hours, I've been trying to implement MVC design pattern into a project I've worked for a couple of days now. It took more time than expected and since the ...
3
votes
2answers
51 views

Chinese Poker using classes

I developed a Chinese Poker game for better understanding classes in Python. It is not finished yet, but the main part is. The game mechanics: There is 1 board for each player. Each board have 3 ...
3
votes
1answer
37 views

Using a separate class in Symfony to handle a list of entities with controller injection

In my Symfony (v2.7.9) project I have a set of entities which share some view functionality i.e being displayed in a table with some of their values as columns. Following the separation of concerns ...
1
vote
1answer
34 views

Filters for a JSON collection

I am trying to create a class that parses a JSON and selects all labels, or just a particular label that you prefer to later do a calculation with the value pair extracted off that label. This is ...
1
vote
1answer
41 views

Ruby backup/restore for provisioning

This is my second Ruby coding attempt. Also - this is my first OOP usage in Ruby. I'm using if __FILE__ == $0 form here - same as it is in Python because it's ...
-2
votes
0answers
38 views

Is this a good example for using both abstract classes and interfaces?

Trying to come up with a flexible design which represents a family of aircraft. I know factory pattern would a good way.But would this be a good design? ...
-2
votes
1answer
77 views

Database and user classes for my personal CMS

I have written my own CMS for learning, and have included all of my core files below. This is my first time playing with OOP and prepared statements, so I imagine there may be alot of changing. There ...
3
votes
1answer
89 views

Validating a model that requires database access

Let's say I have this User model: ...
1
vote
1answer
28 views

Creating a new JFrame on label click

So I've been looking for examples on the internet for a while now and this seems the most common way everyone is suggesting, but now I ask is there a better way to make a new jframe pop up on click ...
3
votes
1answer
25 views

Simple Notification class that models database

I'm updating a website I made awhile ago from a functional design to an OOP design. There are still a lot of functions below this class that I haven't implemented yet but I'm getting to it (such as ...
-2
votes
1answer
33 views

Implementing Arrays in Java Class

I have the following code to write: Modify the Student class so that instead of 3 tests you will now have an array of 100 tests. However, not all of the scores may be set. You need to add an ...
3
votes
1answer
37 views

Screen of chars

So its a class that lets you make a 'Screen' which is a n x n grid of chars. Your able to move a cursor by chosing the row and which column in the row and using that you can insert into into that ...
3
votes
2answers
382 views

Medical diagnosis selector

Alright, so my code is 'all over' and missing some fundamentals as regarding to the MVC design pattern.I should separate my concerns and I don't have a model layer and i'm clueless to how to implement ...
4
votes
3answers
54 views

Coding Button functions in separate classes

I've been trying to separate my button functions from my main GUI class The code works but as an programming beginner i want to hear if i'm doing things the 'proper' way. Point out what am i doing ...
0
votes
1answer
79 views

Simple Gender Guesser

I have made a simple gender guesser for an app and thought that this simple bit of code may be useful to other developers. It takes in a string and returns an 'f' for Female and an 'f' Male depending ...
1
vote
1answer
67 views

Object-oriented implementation of a real-world scenario of using a bathroom - follow-up

This is revised code for the previous question: Object-oriented implementation of a real-world scenario of using a bathroom Is there any object oriented way or design pattern I can use to make this ...
9
votes
3answers
110 views

A Text-Based Fighter - Like Pokemon

Okay, I'm a newb to programming/Python. To get a better understanding of objects/methods, I wrote a text-based, turn-based fighting game. I want to expand by adding new characters with new moves (one ...
3
votes
1answer
41 views

Monster Buff/Debuff System Design

Below are a collection of classes that compose my buff/debuff system. The largest flaw in my design that I couldn't overcome is the base class Effect having an ...
1
vote
2answers
46 views

Splitting code to modules

I'm trying to reach good understanding of how to build scalable modular application structure. Recently I've been practicing with canvas and rewriting one of the popular snake game realizations. I've ...
4
votes
2answers
55 views

Library assistant

HackerRank currently has '7 days of JavaScript' going, a quick intro into the JavaScript language. Every day a couple of challenges will be made available. One of the challenges of today was this: ...
3
votes
0answers
45 views

Demo for playing around with HTML canvas

I'm a beginner in JavaScript and I want to improve my skills. I decided to write a simple application that adds a GUI to CanvasRenderingContext2D. I have just ...