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

2
votes
1answer
216 views

Events in WCF Service Architecture (Server Side)

Problem: Now, I have some events that will take place when the client submits a request to the server. These events will arise on the server and they will be subscribed by the services themselves ...
5
votes
1answer
146 views

Good way to program an orchestration / processflow

I'm programming a process in which clients will be separated in 3 different groups, and for every group a different action will be performed. My question concerns the process of deciding which client ...
49
votes
8answers
7k views

Is it good that testers are competing to see who opens more bugs?

I'm a software developer. There is a team of testers who follow and run test cases written by the analyst, but also perform exploratory testing. It seems like the testers have been competing to see ...
-2
votes
1answer
113 views

Copying desired bits from variables [closed]

What's the best way to copy desired bits from char, int or any other variables? I want to see all possible and the most efficient techniques for this purpose. I have for example 16bit variable 0000 ...
2
votes
1answer
59 views

Making use of constant data

My team is working on an android app. A co-worker and I have different ideas on how to load constant data. To clarify, the data we are going to use are 100 × (n × 〈integer-integer pair〉) where 10 ...
77
votes
7answers
7k views

Short circuit evaluation, is it bad practice?

Something that I've known for a while but never considered is that in most languages it is possible to give priority to operators in an if statement based on their order. I often use this as a way to ...
1
vote
0answers
58 views

Using AngularJS to develop easy to implement modules for customers, wondering if this is a good way to implement this functionality?

Where I'm working, we currently have quite a few clients, both using Wordpress and custom site solutions that require our data to be sent via JSON to their site where they can then display it without ...
-2
votes
1answer
89 views

How to name variables without plural in a for-each loop? [closed]

How do you name loop variables when the list item is named after something without a plural? For instance (in python): [x for x in sheep]. x is not a great name, but sheep have/has no plural that ...
1
vote
2answers
141 views

Is it a good idea to install more libraries than you need? [closed]

I decided to try Anaconda, it seems that too many large companies are using it. I was amazed by the number of libraries included by default installing: python-2.7.9-2 ... installing: ...
0
votes
2answers
333 views

What algorithm should I use for a lot of if else(s)?

I have to implement a lot of if else statements and I'm thinking of using Decision Tree but I'm not sure if it's going to be the right algorithm. I don't want to insert a piece of html code based on ...
0
votes
1answer
43 views

Sense user-agent to determine HTML - Keep HTML and Logic separate?

I am of-the-understanding that you should try to keep HTML out of your logic, and keep logic out of your HTML. E.G.: You don't write HTML in (C# strings or Javascript Services) and pass them into the ...
2
votes
1answer
274 views

Should all functions be fully self-contained (is it bad practice to share a variable between functions)?

There are two ways to do the same thing (pseudo code) Define databaseHandle in the parent function, and use it as a global in this scope: function API() { function openDatabase() { ...
-2
votes
2answers
142 views

Yoda conditions: if you use more than one language? [closed]

Ive started coding for Wordpress and the coding standards recommend using Yoda conditions. if ( true == $the_force ) { $victorious = you_will( $be ); } But I also do some Android development, ...
2
votes
3answers
382 views

Using System.err.println() for debugging in Java

System.err The "standard" error output stream. This stream is already open and ready to accept output data. Typically this stream corresponds to display output or another output ...
2
votes
1answer
159 views

How much trouble can the use of Singleton class as Model cause?

In my latest WPF applications I've been using a Singleton class, that I call Model, to contain all my application's logic, such as file reading, information handling, etc.. In the WPF Views or ...
3
votes
3answers
194 views

Is it better to make database calls or external API calls first in the context of a single Web request?

Say you have a Web app that uses data from both a database and an external API, and for certain pieces of functionality, you need to call in to both in order to read/write the necessary data. Is it ...
1
vote
1answer
293 views

Why is it common to put an underscore before a method in JavaScript? [closed]

For example, I noticed that in the jQuery UI widget factory, methods like _init, _start, _on, ect.
4
votes
2answers
120 views

Is it considered good practice to declare base interfaces without mutators, supplying mutatators in a sub-interface

I asked a question on StackOverflow on how to properly implement an ImmutableMap that abides by the SOLID principles. Due to Java's Map interface containing put and putAll, it violates the interface ...
-1
votes
1answer
58 views

One symbol - one meaning?

It's well known recomendations that: 1) class or function should have one responsibility 2) variable should not be reused in different contexts We can generalize this recomendations to general ...
0
votes
5answers
509 views

Is String processing more complex than number processing in programming languages?

I feel that string processing is always more complex than Numbers or mathematical processing. Are our programming languages are designed this way that mathematical operations are pretty much straight ...
1
vote
3answers
53 views

Clarification on Acquire/Release Semantics in multithreaded programming

In an attempt to fundamentally understand any concept, I try to understand the meaning of the words within the context it is being used. Currently, I am trying to fundamentally understand the whole ...
0
votes
1answer
141 views

Project has become so complex and big that I am lost [closed]

Hello this has never happened with me before . I am making an online shopping android app which has become huge and complex . While developing the code I have followed all the clean naming ...
1
vote
1answer
110 views

How do you build the confidence to work on large projects? [duplicate]

So I'm a programmer who works in telecom. I'm currently in school as well and I'm also an avid gamer (shocker). I said this to form my question: Take a big game title such as DotA 2 - how do you know ...
8
votes
2answers
386 views

Role-based REST API?

I'm building a REST API for which several users with different roles will have access to the resources it contains. To keep the scope simple let's take the "student/teacher/class" domain: GET ...
11
votes
1answer
567 views

Slicing up the Development Stack - diagonally?

We've got a new project going on, and at the moment developers have been split into two teams, team A and team B. This project has 2 parts to it which require development throughout the development ...
-1
votes
2answers
107 views

Having one server for the whole team [closed]

I'm currently in a team where it lacks of its resources. The dev't team had only one websphere server for testing and we could not deploy our project in our local desktop because the websphere is only ...
2
votes
1answer
107 views

Is it OK to deprecate methods that need to be public due to the packaging model but are not to be used outside the codebase in Java?

I am currently working on a semi-large project that has several packages. There are 3 main packages, a "client" package, a "server" package and a "common" package. There are two jars, one for the ...
0
votes
1answer
146 views

Has pre-increment operators become that common? [closed]

Bit of background to explain the reasoning: I've been programming for a good while, but took a break between 2012 and 2014 for other stuff. Before that break, I would hardly ever hear about "++i", let ...
-1
votes
3answers
109 views

What is an initial skeleton of the website called? A Framework? [closed]

I am building a website but I am wondering can I call the initial set of pages a framework? Say I have a project to build a website for a school. Before I start implementing the requirements I have ...
3
votes
2answers
255 views

Are there standard formats for keeping a “programming notebook” or any sort of paper planning for software development? [closed]

Personally, I've had several programming notebooks since I've started coding, but most of the time I don't keep a standard format between projects or even within projects. My ideas end up a little ...
1
vote
2answers
168 views

Is lazy loading always required?

I know lazy loading is required when an expensive database call is being made. It would make sense using lazy loading in this example. The below example is in the context of asp.net so it's thread ...
7
votes
5answers
954 views

Why are objects instantiated this way?

Some times I see an object instantiated this way. ICustomer oCustomer = new Customer Obvious but the Customer class is implementing ICustomer interface in this example. Are there any advantages of ...
0
votes
0answers
108 views

Test-first iterative development in Common Lisp environment

Given: I want to practice proper test-first, continuous delivery-style software development in Common Lisp environment. Problem: How each red-green-refactor iteration of the process should look ...
1
vote
3answers
228 views

C# Subject Observer Architecture question

I'm making a C# application using the Subject Observer design pattern in a slightly different way. I am passing the Provider Class, implementing IObservable (this has the OnNext() method that ...
3
votes
3answers
183 views

Development Time: sql in UI code vs domain model with datamapper

First, sorry for my English guys. Currently this is my first programming job. I am labeled as the most incompetent programmer in my company that's because they measure the performance and ...
6
votes
5answers
821 views

What is the effectiveness of code reviewing by just reading? [duplicate]

I have been given the task of reviewing a change request comprising of more than 20 changes, the problem is that we do not / cannot install a version of the software to be evaluated as the development ...
2
votes
3answers
175 views

Documenting intent Vs knowledge

It is said you should document the intent of your function or class which I agree with. However recently this line became a little bit blurred when I was wanting someone to document why this ...
3
votes
3answers
134 views

How to write tests for function that depends on a config file?

I have a function that uses information from a config file. How do I test the function? Ideally, I'd want to inject my own version of the config file and test from there, but I'm not using dependency ...
0
votes
1answer
64 views

Is it OK to use name like `CLASS_CONSTANT` for class constant variables according to PEPs? [python]

On the code I'm viewing, I saw a class like this: class User(ModelBase): """# User: docstring""" COMBAT_RANK_KEY_PREFIX = 'combat_rank' LEVEL_RANK_KEY_PREFIX = 'level_rank' ...
4
votes
1answer
945 views

Should I avoid using style like `for k, v in dict_sample.items()`?

Today I was viewing my colleague's code and I saw a function like this: def manager_skill_tree_func(*args, **kwargs): """# manage_skill_tree: Initialize the manage skill tree """ ...
2
votes
3answers
85 views

Data padding for different hardware support?

Some hardware cannot read non-aligned data. For example Bitmap images are aligned to 4-bytes from the header and with each scan line in order to maintain device independence. For example you can ...
3
votes
3answers
388 views

Use interface or abstract class?

Now the title might seem like the question has been asked before but let me explain my situation and you'll see why I am asking this question. Let's consider this interface : public interface ...
5
votes
1answer
513 views

Compute Adjacent Pair

I was given the following problem: Integer V lies strictly between integers U and W if U < V < W or if U > V > W. A non-empty zero-indexed array A consisting of N integers is given. A ...
9
votes
3answers
1k views

How did desktop applications communicate with remote server before webservices?

I don't have lot of expierence with desktop applications, but if I had to create a client server desktop app, the data access would be done through a webservice. I believe data access through a ...
35
votes
9answers
12k views

Why do schools teach arrays over List? [closed]

Most of the assignments in my school for the initial programming classes required me to use arrays. I work full time now, and I never used an array for any project that I have worked on. Even in the ...
1
vote
0answers
101 views

Single page application automatically download dependent HTML

I'm currently developing an application using ASP.NET MVC5 and Knockout. For now, the typical architecture is this: FooController.cs: public ActionResult GetFoos(){ //... var model = // ...
1
vote
2answers
296 views

Is setting “permanent” persistent login cookies a bad practice?

I realized that in Rails there is a built in permanent method for its persistent login cookies (aka. "remember me" cookies) method to give the client a cookie that expires in 20 years: ...
2
votes
3answers
539 views

Can a Java Boolean be used for ternary (3-state) logic?

I'm trying to make a basic cache of a boolean value, and I did it like such: private Boolean _valueCache = null; private boolean getValue() { try { if (_valueCache == null) { // if cache ...
1
vote
1answer
340 views

What programming technique is this?

I have two Java classes. The first one is called "Index", and the second one, temporarily, I called it "IndexCache": public class IndexCache { private static Map<String, Index> map = null; ...
3
votes
1answer
1k views

raw, weak_ptr, unique_ptr, shared_ptr etc… how to choose them wisely

There is a lot of pointers in C++ but to be honest in 5 years or so in c++ programmation (specifically with the Qt Framework) I only use the old raw pointer : SomeKindOfObject *someKindOfObject = ...