The code-organization tag has no wiki summary.
0
votes
0answers
83 views
What's wrong with this javascript programming approach?
Helllo people I'm now developing an instant messaging system but I'm a little confused : I can't decide which approach do I have to choose!
Here is a code and I want you to tell me what is good/bad ...
0
votes
0answers
15 views
exception handling class, static or object-oriented? [migrated]
I am working in a windows service (using vb.net) for internal use of my department. When ever certain type of exceptions (FooException for now on) are captured I follow the same logic:
Log the ...
1
vote
1answer
123 views
Which code is better? And why?
I found two ways of writing the same program (one that only uses local variables, but no methods other than the main one) and other that uses one instance variable that is used in two methods.
This ...
0
votes
1answer
64 views
Q&A system model design [closed]
Now I am trying to build a Q&A website by myself.The models below is my model design.I have some questions about this.
1、class Category:
public class Category {
private String name;
}
...
1
vote
1answer
72 views
How do I shorten my code?
I currently have a huge code for regenerating some things in a game a made. The code is very big and I think it can be compressed but I don't know how to do it. This is the code
Private Sub regen()
...
0
votes
0answers
32 views
immutable metadata constructor access
I want an immutable class, and the constructor should be package private. However, it ends up getting used outside the package:
package gnu.mail.providers.nntp;
import gnu.inet.nntp.GroupResponse;
...
3
votes
2answers
112 views
Palindrome test in Haskell
I am new to Haskell and, coming from a OO/procedural programming background, I want to make sure my code follows the functional way of doing things. I built this short module to test if a given string ...
0
votes
1answer
60 views
Progressbar in Python
i wish to improve my Progressbar in Python
from __future__ import division
import sys
import time
class Progress(object):
def __init__(self, maxval):
self._seen = 0.0
self._pct = ...
3
votes
2answers
84 views
improve the design of class “accuracy” in Python
I am learning about the class and methods in Python.
The class Accuracy is a class of several (13 in total) statistic values between a reference polygon and one or more segmented polygons based on ...
4
votes
4answers
187 views
Command line Contact Management
Can you please review the following code and give any suggestions for improvment?
Class ContactList.java
import java.io.*;
import java.util.*;
public class ContactList {
public static void ...
4
votes
1answer
45 views
Thoughts on organizing code for multiple mysql queries in php scripts
I have a web application where I connect with a MySQL database using PDO and in some scripts there are a lot of queries one after the other which don't necessarily concern the same tables. i.e I will ...
2
votes
1answer
122 views
Am I using Golang concurrency correctly to increase reliability?
This code takes text from the standard input, maps it to a struct (if possible), and creates a JSON string from that.
I'm using a barcode scanner for the input, and I've attempted to use goroutines ...
0
votes
1answer
26 views
Python right position for a Error message in a class
first of all sorry for this easy question. I have a class
class Grid(object):
__slots__= ("xMin","yMax","nx","ny","xDist","yDist","ncell","IDtiles")
def ...
3
votes
3answers
144 views
Would like some feedback on code samples
I am currently in my 3rd year of a computer science course, I am looking into getting an internship over the summer but, I feel that my coding skills might be lacking for the workplace. Below, are ...
1
vote
1answer
102 views
Help me simplify this gigantic class
I'm trying to think of ways to separate things out. I'm open to ideas, or if you see anything blatantly wrong, I'd like to know that too.
Generally, I'm happy with this, but the sheer size of the ...