Search Results
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 |
Object-oriented programming is a programming paradigm using "objects": data structures consisting of data fields and methods together with their interactions.
3
votes
Rectangle Class
Rectangle as IEnumerable
Is it a bad design for my rectangle to implement IEnumerable? Is it counter intuitive?
I find a Rectangle implementing the IEnumerable interface is weird and counter intuiti …
2
votes
Sampling to collect data
DIP (Dependency Inversion Principle)
The OnPremisesClient class violates the DIP (Dependency Inversion Principle) and the IoC (Inversion of Control) because it uses the Console internally directly. Y …
2
votes
Loosely coupled movement
Here are few more things I'd like to add to the very good points mentioned by @Jk_xp.
You use nested classes. This should be avoided because it makes finding and using class harder. For grouping you …
3
votes
Accepted
Designing classes for non-standard arithmetics
You might want to define the base type like this
abstract class Primitive
{
public Primitive OpAccess(Primitive right)
{
switch (right)
{
case Number number: retur …
5
votes
Accepted
Basic traffic light simulation library
Without a deep understanding of the logic of this challenge here are some general ideas about the code.
fields & properties
class DelayItem
{
public object[] Data;
public DelayTypes Type;
…
2
votes
Accepted
Exception Handling Helper
You're crazy and the code is terrible :-P
catch (FaultException<DefaultFaultContract> ex)
{
((IClientChannel)client).Abort();
factory.Abort();
ExceptionHandlingHelper.HandleException(ex) …
3
votes
Read information from Outlook emails
In addition to @AdrianoRepetti's suggestions I find that the only public method you have there, the GetMailMessageInfos, does not require an instance. It could be just an extension for the MailItem[] …
1
vote
Collecting data into objects and POSTing to 3rd Party API
Use Dataflow
You could use the ActionBlock from the System.Threading.Tasks.Dataflow package to let it handle the throttling of InitalizeSenderAsync method that you currently handle yourself:
var wor …
2
votes
Accepted
Combining two classes to hold general and specific properties of an item
You make it more complicated then necessary. The duplication of all properties in the ItemBinder is a manintenace hell.
I have this whole situation in two places in my program, and as it expands, …
1
vote
Get collection of objects from CSV string and vise-versa
throw new System.NullReferenceException("No CSV string has passed in the parameter");
You should not be throwing this excepiton in the BuildObject method (actually nowhere). It's not only that it …
2
votes
Add multiple instances of a property to a list
You can shorten the first part to 3x this:
var teamAverage1 = Players
.Where(p => p.teamId == id && p.a == 'x')
.Select(x => x.Average1)
.ToList();
I don't like the p.a properties. They …
1
vote
Automated collage tool
You can greatly simplify the code and remove a lot of repetitions if you move the nodes enumeration into a separate method:
private IEnumerable<BinaryNode> Nodes()
{
var currentNode = root;
v …
2
votes
Load/Save application sessions
Current property
You should never throw the Exception. There is almost always a more appropriate exception already available or you should create a new one. The name of the exception usually already …
11
votes
Object-oriented dungeon crawler game
My main question is to what extent should each class know about the other classes?
At best nothing - they should know only about abstractions. (Further reading: The Dependency Inversion Principle …
3
votes
Project Euler problem solver in windows forms
I'd like to put in my two cents too.
Storing types and creating names
Your current code is based on strings e.g. you look for types by names that you both store in a dictionary and in the list. I fi …