Skip to main content
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,795
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

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
  • 8,249
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

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

"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,169
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
5 votes

Show a list of downloads

I am going break this into three parts: Your question about the observer. Some big picture questions about the broader design. And a ton of tactical observations regarding the code in the question. ...
Rob's user avatar
  • 2,657
5 votes

PathFinding.java: The grid view and model

Model The main issue with this design is that the model doesn't get mutated through functions defined on it. You can get a cell and change it's contents, but the object instance that represents the ...
Maarten Bodewes'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
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
4 votes
Accepted

Getting statistics in rest api endpoint

Not using return values of TryParse The method receives several parameters as string, and parses them to other types such as <...
janos's user avatar
  • 113k
4 votes
Accepted

Business logic inside MVC Cart Controller method

I think there is more to discuss here then business logic inside your controller. I'm going to generally keep it to a high level of discussion, but feel free to comment and ask for specifics. I'm ...
Conor Mancone's user avatar
4 votes
Accepted

HttpClient wrapper for simple calls with optional cert

As is this does not work because multiple requests will concurrently operate on the same variables (instance variables and HttpClient internal state as it is being configured). This is fairly easy to ...
usr's user avatar
  • 745
4 votes
Accepted

Laravel UserController Design

First of all do not use Laravel 5.4 even if you've written some* code already, use latest 5.7, and try to always update. *: You really need to rewrite the application if you have code like you ...
Kyslik's user avatar
  • 181
4 votes

Simple dice game - JavaScript MVC implementation

MVC architecture Obviously it can be difficult to break up the code in JavaScript to MVC components. Typically an instance of the model would hold information about each model item- in this case, a ...
Sᴀᴍ Onᴇᴌᴀ's user avatar
4 votes

Simple dice game - JavaScript MVC implementation

I'd appreciate any helpful review on my code in any area possible. Here is, in Javascript, MVC stripped down to its essence MVC parts are intended to be coherent, complete, objects necessarily ...
radarbob's user avatar
  • 8,249
4 votes
Accepted

Convert IEnumerable<Reads> to CSV

I modified the formatting part for better readability and maintainability, at the cost of lower performance: ...
Xiaoy312's user avatar
  • 3,136
4 votes
Accepted

Custom MVC framework

Ill just jump right in; Composer To The Rescue So you have attempted autoloading, thats great! But by modern standards you should be using composer to; Manage your dependecies Manage autoloading ...
Dan's user avatar
  • 530
4 votes

Filtering data from MYSQL database based on parameters passed with POST request

The entire long conditional is definitely worth to be decomposed and consolidated. The main mechanics of optimization is based on 3 aspects: determining a common logic/behavior that needs to be ...
RomanPerekhrest's user avatar
3 votes
Accepted

Notifying view controller of changes to any of five types of models

The type annotation in ...
Martin R's user avatar
  • 24.2k
3 votes

ADO.NET database access layer

1. Alternatives Just as the other answer suggests, you should be looking into existing framework. There's no use reinventing the wheel unless you're specifically trying to improve it (which is not ...
Flater's user avatar
  • 5,720
3 votes
Accepted

Report Page on Volunteer Signup Website

Looking at your sql's you seem to be repeating the same queries in a loop. I will pick out one simple one for example, it doesn't take long to run on its own, but if you add them all up, the amount of ...
bumperbox's user avatar
  • 2,116
3 votes

Vanilla JavaScript ToDo List implementation

Overall the design of the code looks fine. Bearing in mind that this code was posted ~3 years ago and you likely have learned quite a bit since then, I have some comments about both the UI and the ...
Sᴀᴍ Onᴇᴌᴀ's user avatar

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