Skip to main content
The 2024 Developer Survey results are live! See the results
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

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,684
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

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,638
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

Java Tic-Tac-Toe game (implemented through MVC)

This is my understanding of MVC. The Model should handle all the logic and it knows the state of the board, such as where the pieces are, and the state for a Win. The view only displays things like ...
Quintinium's user avatar
4 votes

MVC design to fetch, store, and present data from an external source

Looks pretty good. Here are just some thoughts but nothing major: It would be more future-proof (and probably efficient) to use regular expressions in lieu of parsing hard-coded line numbers (in case ...
Tomanow's user avatar
  • 141
4 votes
Accepted

Revised - Game of Fifteen

Functions that do not modify the referenced data should be made const to indicate that in fact, the code does not change things. It also allows some optimizations, ...
chux - Reinstate Monica's user avatar
4 votes
Accepted

Using Identity to create user administration page

Let's take about the ManageViewModel for a moment, because it has a lot of things you can do better. ...
Der Kommissar's user avatar
4 votes
Accepted

Displaying game progress in a JApplet

Some short note without really reading into the source. In MVC usually the Model is independent of View and Controller. So your ...
Ped7g's user avatar
  • 671
4 votes
Accepted

Filtering ASP.NET membership roles without the default attributes

public abstract class BaseController : Controller { public MasterDbContext Context { get; } = new MasterDbContext(); } I really don't like this. Every single ...
Mathieu Guindon's user avatar
4 votes
Accepted

Simple log-in to system

Thanks for sharing the code. MVC The basic concept of MVC is: the model does not know of neither the controller nor the view . It consists of data structure classes only. It should only contain ...
Timothy Truckle's user avatar
4 votes

Passing $_POST from view to model in MVC

Superglobals I cloned your repo and it looks like you've already taken my advice about passing in the superglobals instead of using them directly from your methods. Formatting I would have also ...
I wrestled a bear once.'s user avatar
4 votes
Accepted

Snake Game in JavaFX

It looks good to me. I only have minor reviews. All constants should be declared in a final variable. ...
Cian's user avatar
  • 116

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