Tagged Questions
65
votes
10answers
5k views
Started wrong with a project, should I start over?
I'm a beginner web developer(1 year of experience), here's my situation:
Couples of weeks after graduating, I got offered a job to build a web application for a company where the owner (boss) is not ...
0
votes
1answer
78 views
Automatically create or update object in database
I have a database class with the following interface:
public Database {
//returns false if p (its ID) is already available
//otherwise adds p the the list and returns true
public boolean ...
2
votes
4answers
208 views
Callbacks: when to return value, and when to modify parameter?
When writing a callback, when is best to have the callback return a value, and when is it best to have the callback modify a parameter? Is there a difference?
For example, if we wanted to grab a list ...
12
votes
8answers
2k views
Conception and design before coding: how much is this true? [closed]
I learned at school as well as I read everywhere else that a good development methodology needs conception and design before coding properly.
That is not a new information even for a beginner ...
5
votes
1answer
144 views
Strategies to manage multiple clients able to simultaneously edit same data
How can I deal with situations when multiple clients might edit same object at the same time?
For example, I have a web app with admin console, which lets you edit profile data. Several users want to ...
0
votes
1answer
47 views
Automating form error handling
I'm not sure if I'm being clever or making things more difficult. I'm working within a custom MVC framework, and within some of my "views" which contain forms I'm preserving input and styling errors ...
2
votes
4answers
212 views
Should refactoring be the exception or the rule? [closed]
I had a discussion with a co-worker yesterday about design philosophy. The other coder is more experienced then me, and I fully admit that he is likely much better at properly automating his testing, ...
4
votes
1answer
240 views
If TDD is design, how do you know your TDD is well designed? [duplicate]
Given a large group (50+) of programmers:
All given the same problem,
All using Test-Driven Development (TDD),
All pair programming,
All doing group-based code review,
I have personally seen the ...
0
votes
1answer
60 views
Contradiction of layered design and global data access for analytics reporting
While developing an application (mobile app for Android), our team always strives to use best development practices such as interfaces, layering and separation of concerns.
When it comes to reporting ...
1
vote
3answers
211 views
Does designing a method that changes the argument's (if was object) values a good practice?
The premise is using a language (e.g. C#, javascript) which passes an object by reference into a method.
Assume there is an object "Player" which has a property "Level" and there is a method takes ...
0
votes
2answers
162 views
Is it better to use already build plugins/extensions or code your own in programming projects [duplicate]
I am building a web app in PHP and Symfony.
Basically if we search there are plugins / extensions / bundles for almost 60% of stuff.
The advantage of using them is that you can easily get your ...
14
votes
2answers
636 views
Which is better: a bunch of getters or 1 method with a selection string parameter?
Our knowledge domain involves people walking over a pressure-recording plate with their bare feet. We do image recognition which results in objects of the 'Foot' class, if a human foot is recognized ...
0
votes
2answers
271 views
Is there any way without looking at the source code to know how modular the code is [closed]
I've been working with TDD, most patterns, mostly OO code and still not found a way of knowing if a particular piece of code confirms to modularity , without the need reviewing the code.
On a recent ...
0
votes
0answers
58 views
Access Control List with many roles
I normally have 2 roles in most of my websites, i.e.
Admin and Member and create one folder for each Role like
/Root
/admin
/member
but now I have come up with 10 Roles besides Admin and ...
5
votes
4answers
305 views
Is it normal to write all logs into a single file?
Our teamlead said that many files much worse than a single, despite of we are working on a big project.
He argued that our customers could more easily send logs to us if there will be just a single ...
5
votes
2answers
366 views
Buzzword for “performance-aware” software development
There seems to be an overabundance of buzzwords for software development styles and methodologies: Agile development, extreme programming, test-driven development, etc... well, is there any sort of ...
20
votes
10answers
3k views
Is over-engineering a warning sign? [closed]
So we present a straightforward coding exercise to new candidates with some well defined requirements. Occasionally we receive solutions which don't really solve the problem at hand, but are ...
2
votes
3answers
441 views
Parallel Class/Interface Hierarchy with the Facade Design Pattern?
About a third of my code is wrapped inside a Facade class. Note that this isn't a "God" class, but actually represents a single thing (called a Line). Naturally, it delegates responsibilities to the ...
3
votes
2answers
289 views
Can classes violate Single Responsibility if they delegate internal tasks?
I have two classes Output and Timeline, neither of which violate SR, but the two of them are linked together. So what I'd like to do is have a class called Elco (there's a reason behind the name) that ...
0
votes
1answer
106 views
Creating Set Subclasses or Allowing Outside Configuration
I have a TriggerCaller and a TriggerAction class. The Caller "calls" the do() method on the action, which is set with the TriggerCallers setAction() method. The rest of the program should deal with ...
1
vote
2answers
220 views
if i have many calls of single method that returns field value, is it better to make a local variable?
In a method, i have calls of single method of another object that returns field value, like foo.value(), which is defined like Field value() {return this.value;} Is it better to make a local variable, ...
0
votes
2answers
99 views
Making subclass more type-specific with accessors
I have a super class: TriggerManager with a subclass TimedTriggerManager. NOTE: I'm working in java
TimedTriggerManager only deals with TimedTrigger s, a subclass of Trigger. TriggerManager ...
4
votes
2answers
396 views
How to delete an object when other things reference it (and not making the code full of inter-dependencies)
The situation:
In my program, there are a list of cues. To call a cue at a certain time, there are objects called Triggers. Cues have many public methods that allow them, among other things, to be ...
4
votes
4answers
571 views
Is it bad programming practice to check if a class referenced by its interface is an instance of another class?
I have a class (Timer) with an array list of Timable objects. Timeable is an interface. There is some specific functionality that I need for the Trigger class (implements Timable), which has a ...
0
votes
1answer
63 views
How to record/store edits?
In many programs and web apps (stack exchange included) the program is able to backtrack what edits where made to the piece. My issue is similar: I want to be able to store a "timeline" of edits, ...
3
votes
3answers
374 views
Working alone on a project
So I am working on a small Project at my company, I am a mere trainee engineer (halfway through a Software Engineering degree), where we are developing an intranet - based project management and ...
2
votes
3answers
242 views
Implicit optimization versus explicit optimization
To explain what I mean, let me start with an example.
Consider a deque that supports O(logn) concatenation with another deque and O(n) addition of n elements at one end. This dequeimplements a ...
6
votes
2answers
2k views
Cyclomatic Complexity Ranges [closed]
What are the categories of cyclomatic complexity? For example:
1-5: easy to maintain
6-10: difficult
11-15: very difficult
20+: approaching impossible
For years now, I've gone with the assumption ...
5
votes
3answers
298 views
How can I create and manage permissions more dynamically?
I want to implement a security system into my web-based Intranet application which allows security administrators to 'fine-tune' exactly what type of access a user/role has to an object. For example, ...
4
votes
3answers
499 views
What is the best practice, point of view of well experienced developers [closed]
My manager pushes me to use his self defined best practices. All of these practices are based on is own assumptions. I disagree with them and I would like to have some feedback of well experienced ...
8
votes
3answers
325 views
Is there such a concept as “pseudo implementation” in software development?
I'm looking for a label to describe the practice of using human-based computation methods or other means of "faking" an algorithm for the sake of getting a product or demo off the ground quickly ...
11
votes
2answers
580 views
Build one to throw away vs Second-system effect
On one hand there is an advice that says "Build one to throw away". Only after finishing a software system and seeing the end product we realize what went wrong in the design phase and understand how ...
15
votes
8answers
1k views
Is perfectionism a newbie's friend or enemy? [duplicate]
Possible Duplicate:
Where do you draw the line for your perfectionism?
I see that the development community is very focused on doing things the right way and personally I would like to do ...
2
votes
2answers
217 views
Returning a mock object from a mock object
I'm trying to return an object when mocking a parser class. This is the test code using PHPUnit 3.7
//set up the result object that I want to be returned from the call to parse method
...
0
votes
3answers
241 views
How should compound words be handled when coding? Is there a definitive list of compound words? [closed]
QUESTION:
How should you handle compound words when programming?
Are there any good lists available online for developers of generally accepted technology-related compound words?
I can see how ...
1
vote
4answers
379 views
Is extensive documentation a code smell? [closed]
Every library, open-source project, and SDK/API I've ever come across has come packaged with a (usually large) documentation file, and this seems contradictory to the wide-spread belief that good code ...
0
votes
3answers
146 views
Best practice to propagate preferences of application
What is your approach with propagation to all classes/windows of preferences/settings of your application?
Do you share the preference_manager class to all classes/windows who need it or you make ...
26
votes
9answers
2k views
Simple vs Complex (but performance efficient) solution - which one to choose and when?
I have been programming for a couple of years and have often found myself at a dilemma.
There are two solutions -
one is simple one i.e. simple approach, easier to understand and maintain. It ...
1
vote
3answers
235 views
Defining formula through user interface in user form [closed]
I am a student and developing a simple assignment - windows form application in visual studio 2010.
The application is suppose to construct formulas as per user requirement.
The process: It has to ...
2
votes
3answers
167 views
Overloading interface buttons, what are the best practices?
Imagine you'll have always a button labeled "Continue" in the same position in your app's GUI.
Would you rather make a single button instance that takes different actions depending on the current ...
5
votes
4answers
2k views
How should UI layer pass user input to BL layer?
I'm building an n-tier application, I have UI, BL, DAL & Entities (built from POCO) projects. (All projects have a reference to the Entities).
My question is - how should I pass user input from ...
-1
votes
1answer
127 views
Are there any valid ways of eliminating/reducing state?
For definitions and examples of "state", see: http://en.wikipedia.org/wiki/Program_state , http://en.wikipedia.org/wiki/Finite_state_machine , http://en.wikipedia.org/wiki/State_diagram
A diagram ...
1
vote
1answer
172 views
Best practice for writing a service
We currently have a C++ socket server used by a java client. All of the socket code in both C++ and java is stick-built at a low-level with messages passed via JSON strings.
Are there cots packages ...
4
votes
3answers
301 views
When module calling gets ugly
Has this ever happened to you? You've got a suite of well designed, single-responsibility modules, covered by unit tests. In any higher-level function you code, you are (95% of the code) simply ...
3
votes
5answers
415 views
returning null vs returning zero, which would be better?
I inherited a project that I am managing and having to maintain pending the redevelopment of the code base. At the moment I am being tasked with adding little features all over the place and have ...
3
votes
3answers
469 views
Agile development : How to design your code for an iteration / Sprint?
In Agile development you work on small user stories and produce a working iteration.
But what happens when the next user story comes in and affects the design for the already done iteration?
...
2
votes
2answers
193 views
Methods of ordering function definitions in code
When I work on some programming project (usually command line application in Python with many switches), I'm usually creating about 30 and more functions. Most of the functions are in one file (except ...
18
votes
3answers
11k views
Which is a better practice - helper methods as instance or static?
This question is subjective but I was just curious how most programmers approach this. The sample below is in pseudo-C# but this should apply to Java, C++, and other OOP languages as well.
Anyway, ...
4
votes
4answers
879 views
Should I learn design patterns or algorithms to improve my logical thinking skills? [duplicate]
Possible Duplicate:
How can I improve my problem-solving ability?
When starting a programming task, I have trouble breaking it up into steps and figuring out how to go about solving it.
I ...
13
votes
4answers
1k views
What is the limit to the number of a class methods?
In different design books that I read, sometimes big emphasis is put on the number of methods that a class must have (considering an OO language, as java or C# for instance). Often the examples ...