Hot answers tagged

14 votes

Simple Java MIDI player followup

Well, your post is over a year old, but hopefully this can still be of some use to you! Javadoc No need to say the method name again - the method name is automatically part of the Javadoc. What are ...
avojak's user avatar
  • 614
12 votes
Accepted

C# Rental Program

Disclaimer: if this answer feels like it gets less patient and more "to-the-point" as it goes on, I'm really tired as I am / was writing this and I can't English / logic right now. I promise I mean ...
Der Kommissar's user avatar
10 votes
Accepted

Medical diagnosis selector

Layout Don't hard-code dimensions and positions. On a Mac, everything looks wrong. (I don't have your images, so I'm going to ignore them for the rest of this review.) Furthermore, the user of the ...
200_success's user avatar
10 votes
Accepted

PHP Login System with persistent login

Ok, moving down the list... I would separate the content of the includes folder into 2 semantically named folders: includes and ...
I wrestled a bear once.'s user avatar
9 votes
Accepted

Simple dice game - JavaScript MVC implementation

MVC thing is hard to be taken right. And yet it is the most popular (my guess) approach in the modern web development. There are different ways to say what MVC means in particular application. I ...
sineemore's user avatar
  • 1,785
8 votes
Accepted

Winform, with a workaround to avoid dependencies

If you start thinking with code, you will almost always end up doing bad things. Why? Because it is not natural. OK, no more preaching and let's get to work. Review of Your Code I apologize for ...
CodingYoshi's user avatar
7 votes
Accepted

ASP controller for tracking equipment

Index It would appear you primarily do three things here. Sort, Filter, and Page. There's not much to say about your paging, but the sorting and filtering logic clutter the action. Try creating an ...
Shelby115's user avatar
  • 1,961
7 votes
Accepted

Civilization Wars Game

MVC The MVC pattern is described like this: The controller knows the model and the view. The view knows the model. About how components communication with each other: I've seen different opinions on ...
slowy's user avatar
  • 1,866
7 votes
Accepted

Chess application with GUI and AI in Java

On first glance, I wouldn't call things just View, Controller, and Observable, even if they ...
Christian Hujer's user avatar
7 votes

Employee Model definition without an ORM

I cannot use an ORM because I'm required to use Stored Procedures Exchanging one for the other (and back again if you like) should not impact the Model design. So the right question is "... ...
radarbob's user avatar
  • 7,434
6 votes

Baseball player statistics controller

Bearing in mind that you claim that you do not to maintain this code anymore1, there are a few suggestions I would have about this code: define functions and accept parameters- that should allow the ...
Sᴀᴍ Onᴇᴌᴀ's user avatar
6 votes

Factory for report handlers

Not sure if that's going to improve the maintainability index, but You're misimplementing Inversion of Control. IoC is when your dependency (namely, IReportHandler)...
guillaume31's user avatar
6 votes

ADO.NET database access layer

I suggest using a light-weight ORM called Dapper. Hides all the dirty work by providing extension methods over ADO.NET. Take a look at the examples here: http://dapper-tutorial.net/execute
amassani's user avatar
6 votes
Accepted

Upload and database insert php function

There are only two hard things in Computer Science: cache invalidation and naming things. -- Phil Karlton For the life of me I wouldn't think of the ...
Your Common Sense's user avatar
6 votes
Accepted

PHP OOP MVC structure

You have a lot of problems in your code, so let's break them down. First, you have a database class that is useless. Add all of your database access config (user, password, host, etc) in ...
Vinicius Dias's user avatar
5 votes
Accepted

Using viewmodel create comper and edit

Nested If-Statements: Nesting If-statements tends to lead to code that's harder to follow at times. So when you're able to reduce the amount of nesting that you do by returning early (once again this ...
Shelby115's user avatar
  • 1,961
5 votes

Keeping data processing out of controllers

Your brace style is inconsistent. Allman style is usually applied in C#. public class AppUser{ // snipped } public class AddressDetails { // snipped } <...
BCdotWEB's user avatar
  • 11.2k
5 votes

PHP, MySQL quiz application

Structure I'm not comfortable with what I've done: it seems to be complicated and unprofessional Honestly, you shouldn't be. Structurally, this seems far better than the average PHP code. You ...
tim's user avatar
  • 25.1k
5 votes

Factory for report handlers

Some observations: You shouldn't be creating the factory inside the class that uses it. That defeats its purpose! Instead, you should pass the factory to that class's constructor. You shouldn't be ...
Matthew Watson's user avatar
5 votes
Accepted

Building a model-view-controller application in PHP

I would consider moving your routing definition logic out of .htaccess and into your PHP code. I think you will find it much easier over the long haul to maintain your logic solely in PHP vs. being ...
Mike Brant's user avatar
  • 9,598
5 votes
Accepted

Caesar Cipher MVC implementation

Your understanding of MVC seems perfectly fine. You have the business logic in the model. The user input in the view. And lastly a controller to couple the user input to the model and back. The only ...
Imus's user avatar
  • 4,297
5 votes

"War" game app with the MVC model

There are definitely many ways to use MVC pattern. But I think there are some misunderstanding in the pattern's motivations given the implementation. Let me see if I can explain it by defining the ...
Frank's user avatar
  • 316
5 votes

Simple Python calculator applying MVC

Don't import tkinter twice. You're importing tkinter twice: import tkinter as tk from tkinter import * Just import it once, and prefix everything with ...
Bryan Oakley's user avatar
  • 2,089
5 votes
Accepted

Employee Model definition without an ORM

Naming: variables, methods Many popular style guides (e.g. esLint, Google JS, AirBnB, etc.) recommend camelCase for method names - use ...
Sᴀᴍ Onᴇᴌᴀ's user avatar
4 votes

mvc example: form post

Object Oriented Programming Improvements The first thing you can do to improve code like this is to use dependency injection, instead of instantiating objects with ...
Anthony Rutledge's user avatar
4 votes

Currency converter using MVC pattern in C++ & QT

I have used a similar approach to implement MVC as you have Mantosh. I would however use references/pointers for both the view and model objects within the controller-class. This would then enable you ...
A.Fagrell's user avatar
  • 141
4 votes

Identity OAuth implementation with Owin

A static class named OwinHelper, with methods SignIn, CreateIdentity and ...
Mathieu Guindon's user avatar
4 votes

Simple and reusable system for user registration and tracking and auto-updates - follow-up

if (decodedHeader.Equals(BasicAuthenticationKey)) { return true; } return false; Whenever you've got something like this, you can just directly return the ...
Pimgd's user avatar
  • 22.3k
4 votes

Rails guestbook with new, index, and Kaminari pagination in the same method

Yes, there's a lot that can be done differently. Firstly, Ruby convention is 2 spaces of indentation. Not 4, not tabs. Secondly, Guestbook isn't a great name for ...
Flambino's user avatar
  • 33k
4 votes
Accepted

Use of Ninject as an IoC container in a WinForms MVC application

This feels a bit awkward: ...
Mathieu Guindon's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible