Programming Practices are the commonly or not so commonly used practices in development of software. These can include things like Agile Development, Kanban, Coding shortcuts, etc.
2
votes
1answer
53 views
When inheriting from a base class, should you retest constructor arguments?
Say I have something like this:
public class BaseClass
{
public BaseClass(string someString)
{
if(someString == null)
throw new ArgumentException();
}
}
public class ...
1
vote
1answer
153 views
Is this really necessary for solving this problem?
I came across the following article (http://www.codeproject.com/Articles/607791/ga-knapsack) which presents the problem:
A group of people walk into a restaurant and want to spend exactly
$15.05 ...
3
votes
3answers
254 views
Guid collisions
I have a product that lets game developers create games. Inside of their games they are required to give all the elements of their games GUIDs. I've told them that they need to generate their guids ...
6
votes
3answers
498 views
Break on default case in switch
I am a bit puzzled on whenever or not to include break after the last case, often default.
switch (type) {
case 'product':
// Do behavior
break;
default:
// Do ...
5
votes
5answers
306 views
Why would a developer create a public class that has all static properties?
A previous developer has a couple public classes that do not inherit from any other classes but are filled with static properties. Is this another way of creating a struct or enum? Is this an older or ...
4
votes
5answers
707 views
Programming as fast as you can touch-type… How to get to that stage? [duplicate]
I took a test recently and found that I could touch type comfortably at around 100 wpm... and if given some sort of autocorrect/intellisense then that would be even faster (who knows maybe 150 ...
5
votes
2answers
364 views
+50
What are the pros and cons of HTML5, native and hybrid mobile app approaches?
I want to develop a mobile application ..
I read lately an article on Telerik Forum :
it compares among three types of mobile application and I don't know which one should I select to begin with ..
...
3
votes
5answers
318 views
Does relying on intellisense and documentation a lot while coding makes you a bad programmer? [duplicate]
Is a programmer required to learn and memorize all syntax, or is it ok to keep handy some documentation?
Would it affect the way that managers look at coders?
What are the downside of depending on ...
1
vote
2answers
90 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, ...
3
votes
3answers
177 views
articles in variable names and hard-coding strings
re-edited by author: no this is not 2 questions. This is one question about code review questions containing two separate points. Please do not edit my question.
For naming variables, the two sides ...
2
votes
1answer
118 views
.c FIle Dedicated to Data
Is it completely unheard of to have a .c file dedicated to just data? In my case, I'd be using it for global variables that are shared across two other .c files. Here's specifically how I'm using it.
...
3
votes
3answers
170 views
When should I use or not BooleanUtils.isTrue(…) and BooleanUtils.isFalse(…)? [closed]
About this function: org.apache.commons.lang3.BooleanUtils.isFalse(Boolean bool) and the similar isTrue, my co-work (less experienced) use it for every boolean in the code. I am trying to convince him ...
0
votes
2answers
52 views
Where should the processing to structured XML be done?
I have been given the task of redeveloping an "in house" solution to make it expandable and easier to maintain and administer.
The original solution had been hashed together over time using PHP as ...
-1
votes
2answers
164 views
How web programmers works? [closed]
Two years ago, I wanted to become a Web programmer. Although my English is weak, I could learn the basics of programming languages such as HTML, PHP, JavaScript. But I don't know how to create any ...
0
votes
2answers
62 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 ...
0
votes
2answers
94 views
Code formatting for variable declarations [closed]
Is it looked down upon or bad to write multiple variable declarations on the same line? As in:
boolean playMoreGames = true; int length;
boolean win; int ...
3
votes
1answer
62 views
Should I write a wrapper within a manager object?
I have three classes that work together to do one function (from the perspective of the rest of my program). There is a little bit of set up between them, so, to make it easier for the rest of my ...
2
votes
1answer
47 views
Testing MVC models when using SQL referential constraints
I have an MVC web app that's wired against PostgreSQL. The DB uses the full gamut of various referential constraints to ensure referential integrity, as opposed to say the Rails approach, where you ...
10
votes
8answers
632 views
Is writing software easier than reading and understanding it from scratch? [closed]
Me and a friend of mine were discussing yesterday about differences between writing a large C++ software and understanding it as a new recruit.
Is it possible that since a software gets done one line ...
4
votes
2answers
104 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 ...
0
votes
1answer
57 views
Writing contextually related control statements next to each other [duplicate]
Recently I've been messing around with this. Note that I'm not using LINQ because while this could be easily be done that way, I could do this in any language.
Allow me to exemplify:
foreach ( var i ...
4
votes
4answers
300 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 ...
35
votes
10answers
3k views
Over thinking development
I've been working as a freelance web and app developer for a couple of years now (not long I know), and I've just been given my first large project.
Needless to say it didn't go very smoothly, so I ...
-3
votes
0answers
50 views
How to design my application - what technology? [closed]
I am trying to implement a solution to a problem but am unsure on the technology i should use or the approach
Essentially i have a client who owns multiple petrol garages in the country. I need a way ...
-1
votes
0answers
81 views
How to be good in computer science? [closed]
I've noticed that it's really hard for me to be good in computer science. I study and study and sometimes code, but there isn't a clean correlation between studying and being a good ...
-2
votes
0answers
102 views
Topcoder Beginner : how to understand problems? [closed]
I am beginner in Topcoder.
i feel like its tough to understand question and i don't know how to solve it?
I checked out problem archives, but even its hard to understand [Not explaining stating its ...
3
votes
1answer
177 views
Having a Starting Place for Coding a Site [closed]
This is more of preference question that I wanted to toss out to other developers to learn a bit more about others process when developing a site. Every time I start a site I feel I could save a lot ...
0
votes
0answers
55 views
How can I get a comprehensive overview of techniques and best practices in literate programming?
How can I get a comprehensive overview of techniques and best practices in literate programming?
Knuth's Literate Programming was published in 1992. There is a FAQ. There are various other ...
-1
votes
0answers
90 views
What is a good forum for discussion programming values/principles? [closed]
The StackExchange community of sites often asks that questions be answerable, rather than discussion orientated.
I'm interested in finding out people's perspectives on the question "What principles, ...
3
votes
3answers
113 views
Is it bad practice to have FooObject and FooObjectSummary?
I have a service where users can upload/download/replace/delete files. These files have about a dozen attributes that are saved to a SQL Database. Periodicaly throughout their session they will have ...
6
votes
7answers
932 views
Making Simple IF Statements Shorter
If we assume we have this little snippet of code:
string str = "checked";
bool test1;
if (str == "checked")
{
test1 = true;
}
else
{
test1 = false;
}
Is it bad practice to change a simple ...
2
votes
7answers
783 views
Should I “Fight” to use development environment I want to use and how?
I am the only developer for some of projects.
I used to pick environment I like, alike C# and C++.
But this time new task could come from another department head who used to write programs ~20 years ...
1
vote
2answers
146 views
Is it worthwhile to create a knowledge map for software?
Basically, the objective is to create a visual representation of the software specification document. This visual representation would capture various scenarios involved in the software.
Benefits:
...
18
votes
8answers
2k views
RESTful API design. What should I return if there are no rows?
I'm currently coding an API for a social network with the Slim Framework. My question is: What are the best practices when there are no rows to return in the json structure?
Lets say that this call ...
0
votes
0answers
129 views
Programming Skills and size of code [closed]
I have noticed in different application domains that there is a big difference in executable size for applications with similar feature sets. For example, among media players VLC is about 22 MB, while ...
0
votes
1answer
47 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, ...
1
vote
3answers
96 views
When to store values in constants/finals
This might seem like an odd question, but I'm worried that I'm putting too many things as constants/finals at the top of my java class. I've started to put every value that is in my program into a ...
0
votes
3answers
132 views
What is the preferred access modifier for instance variables of a data transfer object?
I'm creating a data transfer object and can't decide whether it would be better to just give public access to the instance variables or if there would be a purpose to using getters and setters to ...
1
vote
2answers
94 views
Is repeating links to the same class in a single javadoc comment a bad practice?
I'm currently writing an API and its documentation. For example I have something like this:
public interface Event {
}
public interface Process {
}
public interface EventProcessor {
/**
* ...
0
votes
1answer
101 views
What about demonstrability of good work? [closed]
This is one of the sad parts of our job as programmers.
Managers and other non-tech's, have no way to really understand the level of quality of our work.
If it's working, even if it's horrible work, ...
0
votes
1answer
52 views
npm packages.json: devDependencies vs global installation
I'm new Node.js development and I have a question about best practices when writing package.json files.
From my understanding, you have to list all devependences that you need to execute your app ...
-1
votes
2answers
147 views
Coding a personal project to learn a new language [closed]
I've been learning Python and I quite like it, but I consider that the best way of learning is by doing a personal project, the thing is, I can't seem to come up with an interesting and challenging ...
35
votes
9answers
3k views
Is it a bad practice to modify code strictly for testing purposes
I have a debate with a programmer colleague about whether it is a good or bad practice to modify a working piece of code only to make it testable (via unit tests for example).
My opinion is that it ...
0
votes
4answers
212 views
Char and unsigned char [closed]
Where is unsigned char used in C ( please tell about some real-world examples )? Why would we need both char and unsigned char?
Char ranges from -127 to 128 ( 8-bit integer )
Unsigned Char ranges ...
8
votes
5answers
621 views
What to do as a Dev when for years their team has lacked product innovation, not used project mgmt methodologies, and kept bad Software Dev practices? [duplicate]
Note: To those who have marked this question as duplicate: The answers on that post do not address my question, unlike the ones on this post that do address my question directly. Also, that question ...
1
vote
5answers
172 views
Is it a good practice to write a method that gets something and checks the value? [duplicate]
Occassinally I have to write methods like this:
string GetReportOutputDirectoryAndMakeSureExist()
{
string path = Path.Combine ( ... ) //whatever logic
if(!Directory.Exists(path)) ...
1
vote
1answer
116 views
ViewController in programming
ViewController is a term for classes that handle views in a framework. This is especially used in MVC frameworks. I go through various projects, written by various programmers, who implement MVC in ...
3
votes
3answers
190 views
Programming task organization
My friend and I decided to create a large programming project together. Before that, I have never worked in a pair (I had quite many projects on my own and at work the boss defined the task for me). ...
-1
votes
1answer
51 views
Using third party/ open source controls [closed]
I usually feel reluctant to use any third party or open source controls while coding in Objective-C iPhone due to following reasons.
Open source controls are developed in incremental manner. So once ...
1
vote
4answers
409 views
Creating a coding standards document
I work in a control systems company, where the primary work is SCADA and PLC, along with other control systems stuff.
Softwre development is not really something the company does, apart from little ...






