Core to Object-Oriented Programming (OOP), a class is a template for creating new objects that describes the common state(s) and behavior(s).

learn more… | top users | synonyms (1)

1
vote
1answer
27 views

Working with Classes (inheriting), @ properties and Initialization

I'm working on this Objective C programming assignment I found online. I'm not sure if I have met all the requirements, especially part C. Any help or suggestion will be appreciated. Part 6 ...
5
votes
2answers
62 views

Blackjack game with classes instead of functions

To try out the concepts and tools I've been learning, I decided to write a Blackjack game. I wrote it entirely with functions, so it hasn't helped me at all with the concept I really lack ...
5
votes
2answers
76 views

Initiating class objects and arrays

I have a class that always has 14 instances. I'm just wondering if there is a better or more effective way of doing this. In this class I also have an array that is filled by calling 4 functions ...
7
votes
2answers
113 views
+50

Displaying a scrolling stock exchange ticker in a window

I've written my first OOP program (194 lines including docstring and comments) in Python that uses Tkinter as GUI and Threads. The program shows a window and displays a scrolling stock exchange ...
5
votes
1answer
85 views

Key Press Handler

I have made a class to import into my projects to more easily handle the state of the keyboard so I can use stuff like: if(Keys.returnKey(37)){ As opposed to ...
2
votes
2answers
548 views
0
votes
1answer
148 views

C++ Design Struct vs Class [closed]

I am writing class CollectingClass which collects much data in private members and prints them out later. To encapsulate all the private members, I decided to ...
2
votes
2answers
52 views

Generate the Norwegian equivalent to social security numbers - follow-up

First of, here is my previous post. That should explain a fair bit. The reason I'm posting one more time, is I have changed a lot. Using more classes, let them do all the work, and the overall ...
2
votes
0answers
23 views

Application Class Security

Is my Application.php class secure for continuing development? The Application.php acts as a registry for the whole application. I tried not to rewrite already working code that is being pulled from ...
4
votes
2answers
3k views

Random password generator

I just wrote my first Java class, and I wanted to share it with you and maybe get some quick check from more experiences coders than I am. I want to learn OOP, and Java is just the tool I thought was ...
1
vote
0answers
101 views

Trying to understand hooks class

I've built a small hooks class for adding some capabilities of basic plug-in functionality. Is there room for improvement? I am just beginning to learn OOP, so ...
4
votes
1answer
89 views

First attempt at making a user class

I've just begun creating my first user class. First, I need some clarifications. Am I using try and catch correctly? To ...
3
votes
2answers
119 views

Eliminating duplicated code blocks

I have an abstract PersonDao class, extended by several other DAO classes, for example EmployeeDao, ...
3
votes
2answers
176 views

Locate user of an Android device

I am new to oriented object paradigm and I work on Android using Java project for an internship. I must be able to locate the user and some around buildings I read stuff about how to setup ...
2
votes
2answers
350 views

Best coding practice for classes in a game engine

I just have a somewhat simple question on coding practices. I have never written a large application before and I am currently working on building a game engine in JavaScript. The part that confuses ...
7
votes
2answers
93 views

Specific PHP Data Access Class

As part of a fun project to help build my knowledge of PHP. I've written a Data Access Class here to bridge the site to the database. I know there are a lot of posts and articles out there explaining ...
6
votes
1answer
104 views

Creating C++ classes and objects

I'm brand new to programming (in general) and C++ (in particular). I'm learning the basics of classes and objects. I'm trying to do the following: Create a class called ...
6
votes
1answer
46 views

Sorted unidirectional list with add, delete and find

I am aware of the fact that a sorted unidirectional list has only very few use cases, but nevertheless, this python code feels fairly long for Python code. How can I improve it? ...
5
votes
4answers
5k views

Sharing data between Forms [closed]

I want to create a class that has properties that can be set from one form, and accessed by any other. I have created the class below which works perfectly, but I'm not sure if this is considered bad ...
2
votes
0answers
76 views

Another PHP upload class

I know there are many PHP upload classes out there, but I'm comfortable with my own code, so I made a simple one here. What do you think of my approach when ...
3
votes
0answers
53 views

Fixed point iteration and cobweb plot

I'm using Python to find fixed points of a given function and then draw a cobweb plot to visualize it. Thanks to this question, I have the core of the code written and can accomplish the task, but I ...
3
votes
2answers
421 views

Accessing MySQL to make queries and scalars

I've developed my own class in ASP.NET project to access MySQL and make queries and scalars, and read the results from it. I want you to review my class and tell me where I've made a mistake. Here ...
9
votes
5answers
2k views

Simple ASP.NET C# class design

Here's a class I'm designing: ...
7
votes
4answers
3k views

Text-based RPG game using classes

I am studying for a degree in "Bachelor of Engineering in Information and Communication Technologies." I am currently on vacation, just after we started learning C++ at the end of the semester. I ...
2
votes
2answers
205 views

Wiki API getter

I know there are other Python wiki API classes out there. I'm writing this one because I don't need all the bells and whistles, no edits, no talks, etc. I just need to be able to search for titles and ...
2
votes
1answer
54 views

Generate the Norwegian equivalent to social security numbers

This is just a little hobby project I've been working on. I've been using it to learn/improve my knowledge of C++. The program generate Norwegian personal-numbers (11 digits) for males born a given ...
7
votes
2answers
420 views

C-style array class

I often use C API's in C++ that force me to use C-style arrays. I got sick of constantly using a dynamic vector with &vec[0], so I wrote this C-style array ...
3
votes
3answers
121 views

Best practices to create extended class

I have two class Task and Award which extends Task. I create this class objects according ...
3
votes
1answer
40 views

Handling an IRController

At the time I try to write some code to handle an IRController, I got this following classes: ...
6
votes
2answers
70 views

Planning a rather large refactoring of physics code in a good way?

I have a large file that I want to refactor. My idea is to make helper classes with helper methods so that I can modularize methods. Is that a good idea? For instance before refactoring: ...
10
votes
2answers
1k views

Card Deck class for a Poker game

I have recently finished creating my own Deck class for my Poker game. It works the way I want it to, but I would like to know if I can make it better and/or more ...
2
votes
1answer
227 views

Implementation of a Vector3D class

I'm an amateur coder writing a geometry library in Python, and would like some feedback regarding my implementation of a class for 3D Vectors. My priority is to have a really friendly API for ...
4
votes
1answer
95 views

My simple PDO wrapper class

I made a simple database class and I wanted to know if there are any improvements I could work on as far as readability, efficiency, methods and making it modular goes. Any other suggestions are also ...
2
votes
2answers
54 views

Return custom assembly attribute variables

I have a custom attribute in my assembly called SemverAttribute, and I have a helper class called AppInfo that has a function to return a number called the Semver number. It accepts an id of null-6. ...
4
votes
1answer
99 views

Merging with different modules

We have an action merge for two projects. In the projects we have different modules like Feed, Files, Post etc.... ...
2
votes
1answer
77 views

How can I optimize my insert function for the cuckoo hash table?

I'm working on class for a hash table where collisions are corrected using cuckoo hashing, I had difficulty writing the insert function, the function is supposed to insert the key if the ...
4
votes
1answer
48 views

Blog engine or somesuch

Would someone tell how I can improve this piece of code? ...
12
votes
1answer
321 views

Is splitting to small classes good?

I have materials: class Material {...}; class ConcreteMaterialA : public Material {...}; class ConcreteMaterialB : public Material {...}; I want it to have a ...
3
votes
2answers
100 views

Bad usage of classes in Python

I was recently working on a project where I had the following setup: ...
1
vote
1answer
19 views

Categorizing utilities into modules [closed]

I have two classes in my program, the one is PropertiesUtils and the other one FileUtils. This is the general structure of ...
2
votes
3answers
203 views

Simple class exercise using the “this” pointer

This is my solution for an exercise from a book. It's a simple Golf class with member variables fullname and ...
2
votes
3answers
2k views

Simple class exercise - min, max, and average of vector items

This program calculates the min and the max value and the average of the items of a vector. It's an exercise from a book so I can't change the header file. Is this code proper? sales.h ...
1
vote
1answer
78 views

Text-Based Simulator in C++/Qt with many commands

The following is an excerpt of a mostly text-based simulator of the iRobot Roomba robot vacuum. I made a class called Roomba that handles everything the roomba does. For those familiar with QT; There ...
3
votes
2answers
112 views

Validating C++ Time class objects

I created a Time class. Now I want to modify the code to perform input validation. Hour should be between 0-24, minutes and seconds between 0-59. If class need ...
3
votes
2answers
187 views
2
votes
1answer
125 views

Accordion JS plugin, CSS3 webkit

Accordion plugin As I don't use jQuery (because I just have fun with Chrome and iOS/Android) and I prefer to write my own functions, I decided to write a simple Accordion function some time ago: ...
5
votes
1answer
1k views

Simple Socket class hierarchy

One of the things I wanted to do was make it impossible to forget to initialise or forget to cleanup WSA. Often the network examples will return as soon as an error occurs (say an socket didn't bind) ...
1
vote
1answer
41 views

Putting in order my two packages and possibly merging them

I am making an application which fetches tweets for a specified amount of time, then inserts those tweets in a database and when the user presses another button the top ...
8
votes
3answers
732 views

C++ Student Class

Is this a good approach of designing a class or is there some other way that I am not aware of? Student.h specification file ...