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
25 views

Global site settings middleware for Slim Framework 3

I have created this middleware code for slim. I just want to know that is this right way to store site settings globally. so, I can use where ever I want. What do you think about my class structure ...
0
votes
0answers
31 views

Applying “Tell, don't ask” to show objects from database on screen [on hold]

I'm looking for a review of my code. It's aim is to show objects retrieved from database on screen without any getters or another ways to ask objects for data. To achieve it, I used Command pattern: ...
0
votes
1answer
33 views

Acquiring payment service ID

I have a utility class, called Bills, that extracts some information from a billId and a ...
0
votes
0answers
20 views

Web-scraping library

Here are two functions that make a request for a given URL and then takes the response body (HTML) and loads it into the cheerio library: scrapeListing.js ...
0
votes
0answers
43 views

Pass several classes as one parameter with Poker user controls

I have two classes that hold some info about the user. One holds the data, the other one holds the controls info. Now I need to pass both of them as a parameters to a method. However they are ...
1
vote
2answers
58 views

Player classes for a playing card game

I have a simple base class and two derived classes. However, when I'm creating new instances of that class, the line where I instantiate the variables is getting way too long. I have it on two lines: ...
1
vote
1answer
27 views

Type Storage Class

So I have designed a "type store" in C++ that can hold a single instance of any subclass of a defined type. Here is an example of how it would be used: ...
1
vote
2answers
53 views

Online book reader system

I am learning to design classes, and in the effort to improve, I have designed an online book reader system with the following requirements in mind: Allow person to create and renew membership ...
-2
votes
1answer
13 views

ArrayList related method not functioning properly in main method [on hold]

Could somebody look over this code and see what I'm doing wrong? ...
5
votes
2answers
72 views

Showing object's data on GUI and HTML without accessors and mutable objects

I have been searching for a solution to show data of class with three assumptions: Class Employee is not responsible for showing itself Class ...
4
votes
2answers
174 views

C# Winform Amazon Application

This is my first program I've written ever. Don't hold back on me. Any help and feedback is appreciated. This code wont work because it requires some keys, but I censored them out, but it does ...
3
votes
1answer
46 views

Application Settings Helper

I'm developing an app which stores some different user settings in app.config such as connection strings, paths for saving reports, default printer e.t.c For retrieving them I made a static class ...
6
votes
1answer
225 views

C# Bitwise Operators

I have a simple program that calculates and outputs the results of all the bit operators. I'm planning to send it to my friend and to explain some stuff about them to him. Before I do that, I want to ...
3
votes
1answer
71 views
+50

Querying the Google ads API

I have a method which relies heavily on object supplied by third party APIs. Below is my working code, is there any scope of improvement? ...
6
votes
2answers
176 views
+50

WinForms Poker (complete project)

I have quite huge question/favor to ask but I hope I can get some useful answers. This is my first complete project, I'm still learning C#, my first programming language. I'm afraid that there will ...
0
votes
0answers
18 views

Render HTML/JS with Values for jQuery Modal Boxes

I have some code that I use to render the template + values for the HTML that makes up jQuery Modal Boxes in my code. ...
-1
votes
0answers
22 views

C# Poker Project WinForms [closed]

guys I have quite huge question/favor to ask but I hope I can get some useful answers. First of all this is my first complete project I'm just 16 years old and still learning a lot of stuff about C# ...
0
votes
2answers
42 views

PHP alternative syntax confusion

Newbie to PHP. Trying to output the results of an array inside a foreach loop. I have got the following code but I cannot understand what to do with it next. Mainly; Where/how do I start and end ...
1
vote
1answer
33 views

Database query inside a method of a class and return data [closed]

I'm trying to find out what is the right approach to return DB values from a class. This is what I came up with: ...
2
votes
2answers
41 views

Instantiating different kinds of error records for a database operation

I've written code to be called from Powershell like so: Rename-DatabaseUser -Name 'someuser' -NewName 'somenewuser' I'm wondering if there's another way I can ...
1
vote
2answers
97 views

Strategy pattern using an abstract class and an interface

I have implemented some sort of the strategy pattern using an abstract class and an interface: ...
3
votes
3answers
55 views

Tic-Tac-Toe project in Python

Here's a Tic-Tac-Toe program I wrote in Python. How can I improve it (.eg. make it more readable)? ...
1
vote
2answers
108 views

Derived methods with Poker classes

I have an interface with two functions. This interface is being inherited by an abstract class which implements just one of those functions. The other one is left to be implemented by the derived ...
1
vote
1answer
36 views

Initializing a game in SDL

I have recently learnt about RAII and exceptions and I have been trying to implement them into my code, but I have met an impasse. With this code here what I am trying to do is manage everything that ...
0
votes
1answer
21 views

Keep classes anonymous in TicTacToe program

My console TicTacToe program This is my first large project attempt and I want to learn how to keep classes as anonymous as reasonable and as protected/secure as reasonable. The program works as ...
2
votes
0answers
27 views

Interface modelling for a journaling program in Java

My program's Journal consists of unique Pages identified by their Day. Within those pages ...
5
votes
3answers
174 views

My first finished Python program: a deck of cards

I've recently started learning how to code in Python, and have even more recently learned the basics of object-oriented programming. Feeling inspired, I started on a program that would generate random ...
0
votes
2answers
87 views

Double linked list c++

I'm trying to figure out double linked lists. I'm looking for any type of comments you might have for my code. Anything that will make it better. ...
1
vote
1answer
31 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
27 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
44 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
636 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
70 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 ...
1
vote
0answers
34 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
335 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
56 views

Creating new team matches

I have a class which creates a new match. My problem is that I am sure the code is unnecessary long and can get much improved (just keep in mind it is beginner level). Specifically, I would like to ...
3
votes
1answer
51 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
46 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
32 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
48 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 ...
12
votes
3answers
708 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
94 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
31 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
53 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
799 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
36 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
2answers
126 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
70 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
141 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 ...