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)

4
votes
1answer
33 views

Rock, Paper, Scissors, Lizard and Spock - Improving my answer

Today I saw an extremelly interesting question on the Rock, Paper, Scissors, Lizard and Spock game. And I've decided to take my swing at it. And I've written the following OOP implementation: ...
3
votes
1answer
49 views

Simple Vector2 structures (and interface)

I built a couple Vector2 structures (Vector2 and Vector2F) for use with a particular ...
1
vote
0answers
41 views

Small PHP-MVC system (for personal learning / use)

I've made an "simple" / "small" MVC-like PHP system. I've used some code of an project I used before and ask questions about it back then to. The thing is, it works (the admin part to begin with), ...
3
votes
1answer
62 views

Solving Project Euler problem #60 in C++

I have implemented a solution to Project Euler problem #60. In summary, the problem asks to find the smallest sum of a set of five prime numbers such that the decimal strings of any two numbers in the ...
2
votes
1answer
35 views

Get K most frequent tokens from a token stream

This is an interview problem: Given a token stream, find the K most frequent tokens in real time (the order of these k tokens does not matter). My approach: Use a hash table (...
5
votes
0answers
50 views

Find all the primes less or equal than N

This is not a novel interview problem. But I want to address it with the following points: Implement the algorithm with Object-Oriented Design principles in mind. Optimize the solution, if there are ...
5
votes
1answer
61 views

Avoiding code repetition while handling exceptions

For my application, I need to use two slightly different algorithms for persisting an entity: ...
5
votes
1answer
72 views

Inventories, Containers and Filters

Coming off a comment on this question, I figure it cannot hurt to post my Inventory work here as well. Basically, I have Item, ...
3
votes
1answer
35 views

Sorting a linked list using mergesort

This sorts a linked list using mergegort. Can you please critique my code and provide your thoughts on where I should improve my code? ...
5
votes
0answers
63 views

Multiple inheritance pattern for vehicle information

I wanted an easy way to augment objects, by adding functionality from any other object(s). More importantly, I needed a way to augment the object from multiple sources in a clean one-line solution. ...
7
votes
2answers
98 views

Tic Tac T-OO: Design and Implementation

I want to learn OO design and as a start, I implemented Tic Tac Toe. I'd like to hear your thoughts on the design and implementation. Classes: Player - Has just ...
4
votes
1answer
100 views

Simple hotel reservation system

This is a reservations software for hotel and restaurant management, allowing you to add and delete rooms, show available rooms, keep track of reservations etc. I am looking to trim my code a bit and ...
1
vote
1answer
49 views

JavaScript accordion

I'm trying to refactor some code I wrote months ago when I used to use lots of anonymous functions. The way I'm trying to do it now is by taking all those functions and rewrite them within Object ...
-4
votes
0answers
15 views

Which design pattern is suitable for three classes [closed]

I have a scenario. User will create a package and add tasks to that the package. For each task multiple users can be added as well. That's how I am trying to implement it. ...
1
vote
2answers
28 views

Cameras and ITrackableObjects

The purpose of these two classes (and hence why I am including them together) is to allow you to create a Camera, that indicates a "render zone", and track an ...
-1
votes
0answers
42 views

Simple Router class

I made a simple routing class that I like to get reviews for, mostly because I do not know how to make it SOLID, since I even made this class separate from the HTTP response, request ... for the sake ...
11
votes
1answer
107 views

Ultimate Tic Tac Toe A.K.A. Tic Tactics

My attempt at this challenge., incorporating lessons from this question, which turned out into a much bigger project than I anticipated, but it works. I'll definitely be refactoring most of this in ...
7
votes
1answer
67 views

Designing yet another coffee machine, Lombok style

After reading Designing a coffee machine, I decided to implement the same problem as an exercise to get to know Guava and Lombok. I used the problem statement from the given question: Design ...
6
votes
2answers
111 views

Simple Mastermind game in OOP form

I'm currently learning Java. I'm trying to get a good grasp on determining what becomes a class. I've started translating old games in to simple Java programs. I'm looking for any critique of use ...
2
votes
2answers
74 views

Immutable subclass of a Set class

If I'm creating an immutable class from an existing class, should I override methods that mutate the property or have an instance of it and write my own methods to read from the property? I have an ...
6
votes
4answers
290 views

Artillery game C++ practice project

I've completed a program as a learning experience to make sure I've got the concepts down. I found a practice project online and decided to try it out. The program compiles and runs exactly how it ...
3
votes
0answers
25 views

Search Class with Static Methods

Most of my programming experience is in PHP, and I have always been a bit wary of JavaScript. I have a JavaScript class to manage executing, caching and displaying search results. ...
2
votes
3answers
147 views

XML serialization helper class

Yesterday was JSON serialization, today is XML serialization. I've taken some of the suggestions from there and made modifications, as well as making other modifications that were not suggested but ...
2
votes
1answer
59 views

JSON serialization helper class

I wrote this class to one-line all my JSON serialization, and I'm curious of any input on it. It's only responsible for serializing/deserializing any type to/from JSON. The comments and code are ...
1
vote
2answers
65 views

Float.Parse issue

I have telerik radgrid that has an SQL backend. What this function is doing is conditionally formatting the cells with in the radgrid. It checks each column to see if the min and max values are within ...
0
votes
1answer
26 views

Input field that dynamically monitors model value

This question is regarding my approach to the following implementation requirement. Can you suggest a better alternative that doesn't suffer from the issues I'll point out in my implementation? ...
2
votes
2answers
62 views

Framerate Measurement Utility

As part of a project I'm working on, I need to measure FPS. In the past, I would do this within the actual project itself, but recently I've been trying to implement more abstract (and reusable) ...
3
votes
1answer
42 views

Google reCAPTCHA Validator

This entire class came out of a chat discussion, and I'm curious on how it looks. (This is like literally 30 minutes of development time.) The idea is to allow very easy, quick implementations of ...
5
votes
1answer
58 views

Listing Books nicely - a tour through a webapp

In this exercise, I do not want to use any container such as Spring or Glassfish. I am deploying my application to Tomcat. I only use JPA. What I want to achieve is to follow best practices and OOP ...
1
vote
1answer
139 views

Simple PHP session handler class (using MySQL for session data storage)

I have tried to write a small light weighted php session handling class that use PHP's session_set_save_handler() function to overwrite the default session handling ...
2
votes
1answer
52 views

Poker deck class /w generator function and list comprehensions

There are multiple aspects in the code I do not really like. [card for card in ...] looks really lame, also ...
2
votes
1answer
87 views

Lockable linked list

The existing design of class DList and DListNode is taken. The main criteria is to do successive updates in \$O(1)\$ time. Part ...
3
votes
1answer
22 views

Exception Handler on a Switch

I am working on rewriting an application in Laravel 5.1. I am new to the exception handling technique introduced in 5.0. I have overlooked taking advantage of throwing/catching exceptions frequently ...
1
vote
0answers
15 views

Web Scraping class schedules

I just want some advice regarding code style and best practices. Also I want to know if I'm using constant declaration and closures properly. This code is used to get the data from here ...
4
votes
1answer
55 views

Descriptor class with advanced (inspect/metaclass) functionality

Having answered this question over on Programmers.SE, I found myself wondering how much effort it would be to write a descriptor that can automatically figure out what the 'destination' attribute ...
5
votes
1answer
97 views

Robot arm manipulation library

I have created a DLL library that controls an robotic arm. Could you tell me if my design is correct? The robot communicates over serial port. The code works but I would like to receive a feedback ...
2
votes
2answers
83 views

Sharepoint Authentication Helpers

I'm working on a rather large SharePoint project that's going to contain helper classes for a variety of item levels (sites, webs, lists, items, etc'). When writing code I'm expecting that the same ...
1
vote
1answer
49 views

Implementing a linked list as practice for a coding interview

I am practicing LinkedList problems. How do I make it production level code as is mostly expected in a coding interview? Any other Suggestions? ...
2
votes
2answers
64 views

DataStream interface for reading and writing data

I am writing a C++ library which will interact on files, memory buffers and remote files accessible with the HTTP protocol. To handle that, I've decided to create some classes that will use the ...
1
vote
1answer
30 views

Selecting orders submitted by a user, segregated by status

I have recently started using Laravel as my chosen framework. It is my first time using a framework. As I have made progress through my project, my controller methods have started to increase in size. ...
7
votes
2answers
139 views

Color structure with single field for multiple properties

This struct is used a lot throughout my programme. This struct is responsible for only things regarding colour, not anything else. I'm largely concerned of the ...
3
votes
3answers
76 views

Linked list implementation - follow-up

Follow-up to this question as recommended. Can this code be improved from an OOP paradigm perspective? ...
1
vote
1answer
69 views

OOP paradigm implementation of a linked list

Can this code be improved from an OOP paradigm perspective? ...
4
votes
3answers
177 views

Free Code Camp - Pairwise

I'm working through the Free Code Camp syllabus and I'm on to Intermediate JavaScript Algorithms. This Pairwise problem was the last challenge in that section. The section came just after "Object ...
2
votes
0answers
23 views

Filtered Search Plugin

I need opinions on how to improve this code example github ...
3
votes
1answer
25 views

Adjusting Angular.js model based on browser width

I have an Array of 5 objects, some key values need to be changed based on the browser width. ie: 5 cols, 4 cols, 3 cols or 2. vs.streams is an Array which is tied to a AngularJS model. When the ...
4
votes
3answers
97 views

Solidworks EPDM add-in

I need to expand the functionality of this project to encompass more commands (you may notice in GetSelectedFilePaths() I have a case that is not currently used, ...
5
votes
1answer
59 views

CMake build system

I wasn't quite sure where to go with this, and this seemed to be the best place I could think of so I thought why not. I threw together a build system for C++ projects today using CMake and I wanted ...
2
votes
0answers
20 views

OOP Web scraper using regex to grab tag contents

I'm about learning about implementing the solid principle in PHP. I want to create simple content crawler/grabber from some websites. This crawler will grab the content from the website url. Since we ...
6
votes
2answers
169 views

Address book in Java

I've been learning Java for a month now using programmingbydoing.com in addition with reading the Java reference. I've had very very basic programming experience and I'm trying to improve my skills. ...