-1
votes
1answer
35 views

Problem using private Int Data Variable [on hold]

I have this problem xyz.h class xyz{ private: int number; bool **matrix; public: xyz*fun(int number); int fun1(xyz*point); }; xyz.cpp xyz*xyz::fun(int ...
3
votes
2answers
175 views

PHP Classes and variables

Hy all, First of all, i'm trying to learn OOP PHP, so any advise will be great ( and sorry for the bad English ). The later idea is to create some kind of MVC Framework CMS kind of thing, just to ...
5
votes
3answers
508 views

Is it wrong to write an entire program under one class/method in Java?

I'm new to programming an created a simple rock, paper, scissors game. The entire program is under a single class and the main method, i hear that's probably not the best way to code. How should i ...
4
votes
4answers
166 views

General advice on a practice linked_list for C++ classes/templates

Introduction I'm learning C++ (Coming from Haskell, C, and Assembly - and other languages sparsely) and this was my practice with classes and templates. It's a linked list that you can call in this ...
1
vote
1answer
43 views

autoloader class fine tune to be usable in every project

I'm open to any advice to help improve this code for general use. /** * * This code was created by Joshua Getner. * @license http://opensource.org/licenses/bsd-license.php BSD * * */ namespace ...
1
vote
2answers
101 views

Is this class structure good?

I'm writing a pong game in Python and I created classes for the game objects. The top level class is Object, and Ball and Paddle inherit from it. And ComputerPaddle is a child class of Paddle. # ...
4
votes
1answer
335 views

PHP Extending PDO Class

I am trying to convert myself from using mysql extension to using PDO, with that being said I was curious if I am going about this the right way. I have a custom logging system that I built I am ...
0
votes
2answers
87 views

Consistent implementation of PHP class constants (arrays not allowed)

I'm currently writing a class: final class MyTestClass { const URL = 'http://www.example.org'; private static $MY_ARRAY = array('...'); // since this is not allowed // const MY_ARRAY = ...
0
votes
0answers
299 views

Good, flexible and secure MVC router PHP

I have developed a new router after having learnt a lot from my previous attempts and I will be using this in sites I make from now on. In a previous question, the issue of REQUEST_URI being too ...
7
votes
3answers
335 views

Class with a sometimes unused property

From times to times I stumble over the following situation: I have got a class with a property that's only used if another property has a particular value, for instance: public enum ...
2
votes
1answer
138 views

Please review my classes - Database, User and Validator

I am very new to OOP and I am sure this code is very, very bad. I will appreciate if you review my classes and give me some advice to improve them. Any recommendations are welcome. I have also put ...
1
vote
1answer
115 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 create a struct Data, keeping all the ...
1
vote
1answer
92 views

Is this a good JavaScript class?

I'm trying to get my head around object oriented programming, and I'm starting in JavaScript. I have put a working demo of my code on JSFiddle (here), but the class is below. My main concerns are ...
4
votes
2answers
325 views

Validation Class - Feedback Welcome!

I have written a Validation and Form class in PHP. Validation class allow you to define the rules of each field and a error message. Form class allow you to get a error message and also allow you ...
3
votes
1answer
615 views

How to improve Try…Catch Block for PDO?

I have written a PDO wrapper and a class file like a model. So far, it's looking so good! I am just confuse where I should put Try...Catch block - Would it be better to place in PDO wrapper ...

1 2 3
15 30 50 per page