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

HttpSession Wrapper Class

Are there any aspects I could improve of my HttpSession wrapper class? Other suggestions are also welcome. ...
2
votes
2answers
58 views

Simple class, solely for setting “globals”

I'm aiming for the best and simplest way to access "global" variables set in the config file for my website. So I can use them anywhere, even inside functions It's for file versioning, and I use ...
4
votes
1answer
70 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 ...
4
votes
1answer
75 views

Cart mover- OOP usage and learning design patterns

Firstly, I would like to say that this site looks fantastic... I haven't tried it out yet, but I'm coming from SO, so I think it will be great. My code is for a simple "cart-creation" class and ...
1
vote
1answer
105 views

Should this container be a struct or a class?

I have a class that serves purely as a data container for passing values from a parsing class to a class responsible for saving the data. I have been wondering whether it would be more appropriate as ...
19
votes
2answers
686 views

Cleaning up class creation / extension

I was wondering for quite some time how to clean up the below code without blowing it up any further. The extension of the classes is the main concern here, it looks a bit too much like magic. That's ...
1
vote
1answer
335 views

File-downloading, unzipping and extracting content with a PHP script and tests

I am reading the book Clean Code by Rob Martin and am trying to write the cleanest possible code. I wrote this script as part of my project. Could you please criticise it and let me know how it ...
3
votes
1answer
46 views

Simple IRC bot with plugin support

I'm looking to see if there is anything in this I could have done better or see if could have structured the code better. Here is the project on GitHub. ...
0
votes
2answers
84 views

Validating basic data objects

I'm playing around with trying to do things in a better way, and in a class I have for sending emails, I have the concept of a recipient. This gets passed into my other classes essentially as a struct ...
2
votes
1answer
53 views

Simple Javascript state management class

So I needed very basic state management and notification for a small game-like thing I'm building. I decided to implement something like a finite state machine (but not quite, it doesn't transition ...
1
vote
2answers
110 views

Possible “shortcut” for accessing multiple data members?

In my Blackjack game so far, I have multiple classes that access each other frequently. For example, this is my hit() function for the ...
5
votes
1answer
44 views

Class for RegQueryInfoKey pinvoke

I'd like to make sure I'm following some basic coding best practices since I've had only little practice creating my own classes and using pinvoke. I've found this class to be pretty useful and I'd ...
2
votes
2answers
62 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 ...
11
votes
2answers
601 views

Too many objects, too “deep” class structure?

I have a pretty large model library I'm working on and it's turning out quite complex, or so I believe at least and I could use a second opinion. The basic idea is that the user should only have to ...
3
votes
3answers
75 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 ...
6
votes
2answers
217 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
92 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
151 views

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 ...
9
votes
1answer
106 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
562 views
2
votes
0answers
31 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
4k 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
104 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
96 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 ...
4
votes
2answers
137 views

Eliminating duplicated code blocks

I have an abstract PersonDao class, extended by several other DAO classes, for example EmployeeDao, ...
3
votes
2answers
182 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
371 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
96 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
113 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
48 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
7k 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
80 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
2answers
444 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
212 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
60 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
422 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
127 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
71 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
2k 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
239 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
117 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
65 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
102 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
93 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
51 views

Blog engine or somesuch

Would someone tell how I can improve this piece of code? ...
12
votes
1answer
328 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 ...