Questions that deal with the organization and structure of the code should be given this tag.

learn more… | top users | synonyms

5
votes
2answers
73 views

Geometry table for use in regexes

I have been teaching myself Python 3. I watched a video on YouTube entitled "stop writing classes". The Gtable class doesn't even have an init function, so I can't help but wonder if I should have ...
4
votes
3answers
71 views

32-bit factorial calculator in x86 NASM assembly

This program calculates the factorial of a given positive number. This is how it handles input: if negative, terminate program if 0-2, display input without calculating if greater than or equal to ...
4
votes
3answers
122 views

Is my web site structured correctly?

I'm trying to get a better handle of code organization and how HTML5 (really HTML) stack works in general. I've worked mostly with ASP.NET Webforms and done some MVC as well. Let me say now, "I hate ...
5
votes
2answers
58 views

AutoComplete program using the n-gram model

For my Advanced Data Mining class (undergrad) we were to design a program that would predict the next word a user is likely to type via automatic text classification using the n-gram model. The ...
1
vote
1answer
38 views

Dynamically loading jQuery when it's not available or version isn't high enough

I'm writing a script for others to use on their websites. I'd like to use jQuery in this script. Because I don't have control over what frameworks people use on their sites, I need to make sure jQuery ...
12
votes
3answers
612 views

C Makefile boilerplate

This is the current Makefile that I use with my C projects. Here is what I would like to be reviewed: Reusability - is this Makefile easy to use for multiple separate projects with minimal ...
6
votes
2answers
91 views

VB.Net Database Access Class

I've recently been asked to make some emergency changes to a legacy application written in VB.Net. I come from a C# background so am not overly familiar with this language, though there are enough ...
1
vote
2answers
53 views

Capture and assign portions of char array to a struct

I am formally a PHP/C# developer and I am new to C. I need you to help to correct my coding with C. I have a kind of following pieces of HTTP user data string. ...
1
vote
1answer
57 views

A Ruby string analyser

I wrote this script for a code challenge on TreeHouse. I already submitted my code, but I am looking for an after the fact feedback. The challenge was to open a file of text, remove specific words ...
9
votes
1answer
299 views

Is this the right way to implement a hashmap?

Is this the right way? Any comments on the hash functions? If asked a question like this in an interview, do I need to follow all OOP concepts(because I am using Java)? Like encapsulating the ...
3
votes
1answer
173 views

My first controller rspec test

I'm just started learning TDD with Rails and RSpec. This is my first test for controller. Just plain RESTful UserController that responds with JSON, so it has no new and edit methods. Please review it ...
4
votes
1answer
60 views

Am I organising my PHP code effectively?

I'm very new to learning PHP & MySQL (I've got past experience with Java) and I'm doubting whether my code is organised well. I've got an index page which has two forms; the first is a form to ...
6
votes
1answer
53 views

Populate errors for objects

I have a map of objects and errors associated with those objects. I have to do the following: populate the errors in the object populate errors for valid objects based on the following: check the ...
4
votes
2answers
86 views

Better PHP Ajax Request Processing Structure

I have a server side PHP file which processes Ajax requests from the client browser. Some requests are only valid if they originate from an Administrator in the application, others are only valid if ...
15
votes
6answers
596 views

Print out table with start/end temperatures and step size

I am trying to learn C++ by myself. I looked up a sample question after going through some text. Though I would like someone to review my code. I'm basically asking you to break it to show some flaws ...
2
votes
0answers
61 views

Domain modelling with Repository [closed]

I've been struggling with some architectural problems which I'm having a hard time figuring out myself. Im trying to construct a basic structure of a project with the domain model and repository ...
10
votes
2answers
112 views

How can this Ruby format analyser be improved?

I have a requirement to validate file names related to architecture after they are uploaded. Once they have been uploaded I must warn the user if the file name is not standards compliant. What's in a ...
6
votes
2answers
114 views

Android Thread and Runnable

This is my code for running a background thread. I believe it is very poor in naming and code structure. ...
4
votes
1answer
62 views

Resource manager implementation, with resources being organized in a scope-like hierarchy

The original question where the general concept of this implementation was discussed: Using ID's with a "scope" -like hierarchy I have designed a resource manager as part of a game ...
6
votes
5answers
1k views

Movement code from a game

Could you suggest ways of writing this code better? ...
5
votes
2answers
105 views

PHP framework building: Sessions Managment Class

I am building a PHP framework and would like to get some feedback on a few different sections of the project so far. I consider myself still a neophyte in PHP so I would like to ask if I'm going about ...
3
votes
1answer
48 views

Determine local maximum from given points

How could I make this code more effective? I'm just experimenting and learning the different ways of how Python runs. ...
5
votes
2answers
72 views

Is it advisable to integrate SQL statements in the JSP pages that are not displayed to the user but handled at the back?

I have a signup form in which the user has to enter the email address and after some quick asynchronous processing at the backend I have to tell the user that whether the email address is already ...
2
votes
1answer
55 views

Prototype OO-style of my THREE.JS application

For several months I'm working with JavaScript and THREE.JS library. Firstly I dislike the prototype-based programming because I have to work a lot of with ...
1
vote
2answers
72 views

Same function but use different array data

I have these two carousels that randomly pick up pictures. [fiddle] Each of them picks up pictures and links from their own different inner array. It works fine as it is, but I was just wondering if ...
6
votes
4answers
767 views

Making a word processor

The Word Processor I had in mind would be similar to Microsoft's word and OpenOffice. I am trying to keep my logic separated from the User Interface and that separated from the controller, basically ...
6
votes
2answers
224 views

Optimization of file scanner

Program must to find duplicate files (by content) in a given directory(and subdirectories). I collect all data in Map<Long, ArrayList<String>> map ...
1
vote
0answers
27 views

Inheritance and setting up for an API request

I am setting up a class to be used for an API request (with JavaScriptSerializer) I am using it to send a complaint to their ticketing systems. So for example I send Title, Description, Custom_Fields ...
6
votes
1answer
102 views

Using ID's with a “scope” -like hierarchy

I currently have a ResourceManager class which is responsible for searching for resources with a given identifier, returning a reference counted pointer to the ...
4
votes
1answer
91 views

Abstract Person with Employees and Clients

I have a interface with the following implementation ...
1
vote
0answers
47 views

Class factory of virtual functions and delegates [closed]

I'm planning to make a factory of virtual functions and delegates on a separate class like this: ...
4
votes
2answers
98 views

Optimising LinkedList class - Part 2

This is part 2. My problems are with too any pointers and with long body code in the following functions: ...
9
votes
1answer
67 views

Shortcuts and imports for large RPG basic code

I decided to work on putting together an Arena-style (very basic) text-based RPG as a way to help myself learn Python. Unfortunately, after about 1,000 lines of pieced-together code, I realize that ...
4
votes
1answer
82 views

Radio ListView onCheckedChangeListener?

This is my adapter class, to create a custom listView with three radiobuttons: ...
10
votes
3answers
199 views

MS Excel type of grid in jQuery

I have created a MS Excel type of grid in jQuery. I want to learn best practices and I need your comments for more optimized code. Please review the code and offer your suggestions. Demo jQuery: ...
9
votes
2answers
141 views

Handling null arguments in a factory class

I have a Factory class that gives out instances of ResponseImpl class. It accepts one ...
11
votes
2answers
313 views

Knockout.js binding 2D table with rowspan

The app I'm working on should allows it's users to create tables. I have a view in which users are able to create a table. They should be able to define here the table's columns. The columns that the ...
7
votes
4answers
273 views
8
votes
1answer
76 views

Graphical game application

I'm writing my first JavaScript application (no 3rd party libraries used) and looking for some high-level guidance on how to better organize the code into separate classes & files. Here is a ...
-1
votes
1answer
84 views

Which code looks better? [closed]

I've got a question on what code style is better. There are two arrays containing some codes. One array consists of string elements, the other consists of integer elements. The corresponding values ...
8
votes
3answers
123 views

How clear is this ruby code?

Elsewhere, there was a question about an elegant solution to a problem. I'm curious whether this solution is elegant from the perspective of easy to understand for a ruby programmer (which I am no ...
5
votes
1answer
147 views

Improvements on Python game?

This is a game I made in Python. While it is not my first, I am not happy with the result. I would like suggestions on ways I can make it better, more user-friendly, and more enjoyable. Also, if ...
8
votes
2answers
221 views

Can this while loop be made cleaner

Moved to Code Review as per comments received on http://stackoverflow.com/questions/20907502/can-this-while-loop-be-made-cleaner Is there a way to make the following while loop a little more ...
1
vote
3answers
103 views

Three ways to add pronoun method/property to gendered class in Python

Say you have a Python class for something that has an optional gender field. You'd like a helper property/method to get the appropriate pronoun for an instance. You'd also like to be able to get the ...
3
votes
4answers
104 views

Coding upgrade (CSS3 x jQuery) tips

I'm just beginning web design, and I've come up with this code to scroll to a place in the same page. I don't know if this can or should be improved much longer, so I'm asking for any tips that can ...
2
votes
1answer
48 views

Hot 18 game (modified Blackjack) in JavaScript

I've just completed my first JavaScript game. I strongly welcome any advice/opinions/insults on how crappy or good my game is. Do you notice anything that is poorly done? Is there anything that I ...
2
votes
1answer
69 views

Convert three functions into a single function

Is it possible to combine all the functions into a single function? I'm providing my fiddle as well. I am trying to test it for different scenarios.. but I am not sure how to combine all the ...
2
votes
1answer
91 views

VARIANT structure deserialization code organization

In my project i work with COM object via System.Reflection. COM object returns pointer on structure VARIANT, that i cast as ...
5
votes
5answers
131 views

cleaning up and increasing performance of js code

I would like to increase my performance of js code write a clean code... can you tell me how to do it... providing my fiddle below with js code... http://jsfiddle.net/YYg8U/ ...