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.

learn more… | top users | synonyms

1
vote
0answers
23 views

Preferred method for handling Failed CRUD operations in Entity Framework (6)?

I am using EF 6 as my ORM. I am trying to decide how to handle CRUD failures. Option 1: Use exceptions (custom or built-in) to inform the web layer that an item didn't correctly save. Handle the ...
-2
votes
0answers
20 views

What are all the most common Errors,misconceptions & misperceptions a new (Objective-C)Developer can Face? [on hold]

Let me exemplify with this scenario: My First misconception: 'In objective c, by using == operator we are n't comparing string values but pointers (which will always remain different despite their ...
10
votes
6answers
1k views

Is there a constant for “end of time”?

For some systems, the time value 9999-12-31 is used as the "end of time" as the end of the time that the computer can calculate. But what if it changes? Wouldn't it be better to define this time as a ...
11
votes
5answers
2k views

“Forgot Password” - How to handle this?

I read this answer and found a comment insisting not to send password by email: passwords should not be able to be retrieved by email, I hate that. It means my password is stored in plain text ...
5
votes
1answer
390 views

Scoping recommendations while developing in C

While developing a library using C, what are your recommendations about variable and function scoping? In C++, OOP and namespaces made the whole thing a lot easier. But how to do that with plain C? ...
1
vote
1answer
326 views

JSP Include: one large bean or bean for each include

I want to refactor a webapp that consists of very distorted JSPs and servlets. Because we can't switch to a web framework easily we have to keep JSPs and Servlets, and now we are in doubt how to ...
-7
votes
0answers
47 views

i have this project to do its about matrix in [on hold]

well i have to write a Java program to perform matrix multiplication. The program should read two matrices (the value of the matrices should come from two different files, for example Matrix1.txt and ...
1
vote
2answers
57 views

Creating menu structure using DB - is that fine?

Also I have an application that basically consists of a lot of screen so user needs to navigate a lot (like go from A>B>C>D) etc. I have been thinking how to implement this (mainly hold the structure ...
0
votes
0answers
7 views

Reversing a loop with incrementing margin (CSS Stylus) [on hold]

I have a loop in Stylus: ul for num in (1..9) li:nth-child({num}) margin num px for num in (11..19) li:nth-child({num}) snum = num - 10 margin (10/snum) px The ...
2
votes
2answers
289 views

Why to declare a String (as final) and then use it?

In a typical spring mvc validator class, while inserting an errorCode value in the Errors object, what difference does it make between using a String (props.somefield.req) like so ...
5
votes
2answers
185 views

How to handle a vendor who asks for the solution of an issue they could not solve

Being a small department of developers, it's not uncommon for us to outsource projects. We have a set of companies that we really like to work with, very reliable and good local people who appreciate ...
0
votes
2answers
80 views

Why are some files in programming projects named “commons”?

I have seen numerous projects have a file named commons for example: commomns.go I was wondering, why was this convention adopted and what did the meaning of naming a file or a package or something ...
8
votes
1answer
459 views

I know JavaScript really well, but i bomb coding interviews [on hold]

So I'm currently on a hunt for a new position as a Front-End Developer. I know JavaScript very well and can wax poetically about Closures, Currying, Prototypal Inheritance, Design Patterns, App ...
0
votes
2answers
185 views

Whats the best way to build a HTML/AJAX site that requires login? [on hold]

Let's say that hypothetically you wanted to build a website that delivered content to the visitors entirely using HTML and Javascript (AJAX to fetch server side data). The site would require login for ...
6
votes
8answers
584 views

How you return to a code when you don't remember what you were doing? [duplicate]

Well, I have some problems with procrastination and whatnot, but those get infinitely worse, when I cannot remember what I should be doing. I mean, I know my project, I wrote 100% of the code so far, ...
7
votes
4answers
2k views

Multiple Same Object Instantiation

What exactly happens in Java when you instantiate the same object multiple times? For example: Test test = new Test(); then later on I will call it again, Test test = new Test(); again or inside a ...
158
votes
16answers
12k views

Started wrong with a project, should I start over?

I'm a beginner web developer (one year of experience). Here's my situation: A couple of weeks after graduating, I got offered a job to build a web application for a company where the owner (boss) is ...
1
vote
2answers
68 views

Daily builds with SVN for a small team

I have a general question regarding best practices. I have a small team working on a medium-scale software project, which involves integrating code from different environments, etc. The project is a ...
1
vote
2answers
82 views

Best way to indicate more results available

We have a service to return messages. We want to limit the number returned, either allowing the caller to specify the max number to return, or else to use an internal hard limit. We also have thought ...
0
votes
2answers
202 views

Preventing ip resolvers in a skype-like program

I'm currently in the process of creating a Skype-like program, that uses a hybrid peer to peer system to communicate between users (i.e. server contains all users IPs, a client that wants to connect ...
2
votes
2answers
82 views

How to prove that following practices and industrial standards are profitable, and investment in refactoring are good

I started working in a company not much time ago, and what I see a lot inside a project is a high amount of low quality code and some custom ideas instead of industry standards and selected best ...
1
vote
1answer
130 views

What to do if no one knows what they need from you? [duplicate]

A year ago i started to work for a company where i work now. At first time there was been some big project, but after time it's (successfully) completed. Now my manager assigned new project to me, ...
0
votes
1answer
110 views

What coding conventions to use for open source software development? [closed]

So far I have mostly written code just for myself and I was free to choose my own conventions. Now I'm thinking of contributing to open source projects and as I look at some, I see a common pattern. ...
-2
votes
0answers
33 views

Develop own MVC for Python (User defined custom framework) [closed]

I have been creating many PHP applications and have also developed many applications based on the custom MVC that I have developed. When I started learning PHP MVC, I learned it from JREAM MVC for ...
5
votes
11answers
715 views

Starting all over again? [duplicate]

Have you ever been developing something and just came to a point where you think that this is rubbish, the design is bad and although I will lose time it will be better to just start all over again? ...
5
votes
3answers
372 views

Refactoring previous intern's noodle code with future interns in mind

Background I've run across this problem as I am currently an intern at a large company's local software division. I have been given the task of extending a project that several previous interns have ...
2
votes
2answers
188 views

What happens if I close an InputStream that is passed as an argument?

I have read that Java is pass-by-value, and I've been reading about it in this question at StackOverflow, but I'm still a bit confused, regarding the close() or shutdown() methods in various classes. ...
1
vote
1answer
149 views

Are the over-usage of delegates a bad thing?

Good day. I have been told that a good practice for writing methods is to make the method only responsible for doing one thing. It made sense to me now that I look back upon it in retrospect. There ...
6
votes
2answers
197 views

Is it good practice declare a function inline?

I'm writing a method and depending on a config field I need to change where I get my data from. What this results in me having to write code that looks like this: List<string> result = new ...
0
votes
3answers
132 views

Programming with emacs instead of a debugger-integrated IDE [closed]

There's a question that might be deemed a duplicate of this one (I use an IDE (Eclipse) to develop software. Why should I switch to vim or emacs?) but I don't think answers my question. I usually ...
1
vote
2answers
100 views

Pros and cons for choosing between different return types

This is in context of a client-server architecture, although I don't think the architectural setting is needed to put up the problem. I have a function whose output can be classified into different ...
1
vote
0answers
49 views

PHP Framework that favors better general habits over convention

This is intended as an objective question. I've been reading about most of the Frameworks for PHP. We use Cake at work, and I've had exposure to CodeIgniter and Symphony. They all have their own ...
0
votes
2answers
53 views

Automatically propagating changes

When working on multiple similar projects there are often changes that can't be extracted into a library, but should be applied to most of the projects. I mean changes like a modified directory ...
1
vote
3answers
251 views

Trying to come up with a mapping convention for C# objects

so this is C# but it could apply to any OO language where different sets of objects exist across different layers of an application. We have been trying to come up with a convention within the team ...
-4
votes
6answers
2k views

Is having two conditions in an IF statement faster than having two separate IF statements?

I just wonder if having two conditions in an IF statement executes faster than having it separated into two like these: Single Statement, two conditions if ( (conditionA == true) && ...
4
votes
4answers
965 views

Exceptions vs ErrorCodes when working with devices

Out team is at the cusp of a new project. One of the components at the boundary of the system is the component which interacts with a printer through an external COM component (referenced as a usual ...
0
votes
2answers
106 views

How to deal with a new version of visual studio's directory?

When upgrading Visual Studio to a newer version, a new directory is created e.g. "Visual Studio 2013". I understand that that makes sense as we want to differentiate between code targeting different ...
1
vote
2answers
237 views

Is it okay if we use an arbitrary string as UUID?

I found the tutorial of client (android) and server (pc) bluetooth tutorial from here. But my question is about the UUID. Is that okay if we define it randomly without the proper format? Because I ...
0
votes
1answer
80 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 ...
38
votes
6answers
16k views

Method vs Function vs Procedure

Simple question, but I often hear these three terms defined with such ferocity, but which have been known to me to mean different things over the years. What are the "correct" definitions of ...
3
votes
2answers
158 views

How to do documentation for code and why is software (often) poorly documented?

There are some good examples of well-documented code out there, such as java api. But, a lot of code in public projects such as git and internal projects of companies is poorly documented and not very ...
2
votes
1answer
126 views

Is serialization better done in instance methods or static methods

Say I have a class workStockItem, that I wish to serialize. Which is the better style? using a static method or using a non-static method (maybe even implemented as a property as seen below) ...
0
votes
4answers
366 views

File exists vs. File does not exist. Is there a difference in performance?

Let's say I am checking a directory for the existence of a file, and then depending on whether or not the file exists, I act accordingly. For example, see the two Python snippets below. if ...
1
vote
2answers
93 views

Scalable Job Handler

We have a job table that triggers a notification when a new job gets inserted. Clients that can handle such jobs may subscribe to those notifications. When a client receives a notification, he can ...
143
votes
16answers
11k views

Is there a benefit in compiling your code as you go along?

I recently had a job interview in which they gave me an hour to write some real code. It wasn't a huge amount, probably less than 100 lines. After about 45 minutes, I compiled, ran it, and got it to ...
71
votes
10answers
13k views

Why do most of us use 'i' as a loop counter variable?

Has anyone thought about why so many of us repeat this same pattern using the same variable names? for (int i = 0; i < foo; i++) { // ... } It seems most code I've ever looked at uses i, j, ...
0
votes
2answers
85 views

Should a variable name be changed if its purpose changes?

I'll change my personal code often and not worry about going back and changing the associated variable names. Should variable names be maintained in case of meaning changes? var accountCurrentValue ...
1
vote
3answers
82 views

Setting global parameters: is this a reasonable use of const_cast and volatile?

I have a program that I run repeatedly with various parameter sets. Different parameters are used in different parts of the program (including different source files). The same parameter may also be ...
0
votes
3answers
92 views

Wrapping a map with instance or static method

I have a java.util.Map<String, Object> object which different types of values in it. I don't want to cast whereever I do a get operation over this. To do this, I created different classes ...
0
votes
1answer
138 views

Why is the “app” folder now a (more) common pattern in web projects?

It might be related to the Yeoman project, or they might have adopted this from somewhere else, but it seems to be the default for all of their generators. Aside from Yeoman generators I've also ...