Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 37788

Object-oriented programming is a programming paradigm using "objects": data structures consisting of data fields and methods together with their interactions.

4 votes

OOP between projects

A couple of general points: You shouldn't be using properties to set an error message like that. The error message is associated with the action you attempted on the object- in this case the delete- …
Ben Aaronson's user avatar
  • 5,734
10 votes
Accepted

Avoid using object to hold int, bool, double application setting values

As you say, returning an object isn't ideal. This is a relatively straightforward use case for generics: public abstract class ModelSetting<T> { public T Value { get; set; } public abstract s …
Ben Aaronson's user avatar
  • 5,734
7 votes
Accepted

Billing for work using an hourly, dual, or flat rate

OO or not The first thing to do is decide whether or not you want an object-oriented design for this problem. From the requirements you've described, there's a very simple solution that doesn't need …
Ben Aaronson's user avatar
  • 5,734
7 votes

Sorting and search List with Icomparer

OrderBy over sort You can save yourself a lot of code here by using LINQ's OrderBy and OrderByDescending. These allow you to use a lambda to pull out a part of the object to order by, and the default …
Ben Aaronson's user avatar
  • 5,734
8 votes
Accepted

Decoration Freak, or OCP in action?

The Decorator Pattern - Part 1: DRY (ExceptionLoggerCodeFileReader) At fist glance, the decorator pattern is nice in that it gives the appearance of very easy adherence to the open/closed principle ( …
Ben Aaronson's user avatar
  • 5,734
7 votes
Accepted

Counting occurrences of different categories of characters

The good: Good naming, both in following conventions and in picking expressive names Your approach is good procedurally- e.g. good use of the dictionary and in-build char methods. Putting the result …
Ben Aaronson's user avatar
  • 5,734
0 votes

Savings account class and test program

Comments Comments should be there to explain something that the code itself can't. Many of your comments just repeat information already expressed just as well by the code you're commenting. For exam …
Ben Aaronson's user avatar
  • 5,734
20 votes
Accepted

Modelling a Call Center

Firstly, I'm not sure you're actually implementing the requirement as it's written. The description says: An incoming call must be allocated to a fresher who is free. If a fresher can't handle the ca …
Ben Aaronson's user avatar
  • 5,734