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
55 views
What do you call the layer of modules that call external APIs?
I'm creating a Node app.
I have JavaScript files that include custom functions that make calls to external APIs (in this case Google APIs)
I have JavaScript files in my node app that are related ...
0
votes
2answers
71 views
Should MySQL database tables only have a single unit of information per row?
I run an automated data collection service at work, which records measurements (temperatures, voltages, etc) from about a dozen sensors at a rate of about once a second. The MySQL database table looks ...
15
votes
5answers
991 views
Aren't “deep composition hierarchies” bad too?
Apologies if "Composition Hierarchy" isn't a thing, but I'll explain what I mean by it in the question.
There isn't any OO programmer who hasn't come across a variation of "Keep inheritance ...
4
votes
4answers
349 views
Should I be using const more in C++?
There are some things I am pretty strict about, but const has not been one of them.
For example, I might make a local variable that I use three times in a function, that does not get changed, and yet ...
29
votes
8answers
4k views
Are assignments in the condition part of conditionals a bad practice?
Let's assume I want to write a function that concatenates two strings in C.
The way I would write it is:
void concat(char s[], char t[]){
int i = 0;
int j = 0;
while (s[i] != '\0'){
...
2
votes
2answers
166 views
Is coupling a good thing or bad thing when I'm developing standalone modules in a framework?
Encapsulation is a mechanism of wrapping the data (variables) and code acting on the data (methods) together as a single unit. Client code is expected to inherit from system-supplied classes and then ...
2
votes
0answers
54 views
When should bool.boolValue be used?
Recently a co-worker has taken to checking boolean values in the following manner:
if boolVar.boolValue {
...
}
These variable are generally declared explicitly as boolean types either using:
...
0
votes
2answers
102 views
Is there such a thing as a 'pseudo-compiler' for proprietary software?
I'm interested in whether there is such a thing as a pseudo-compiler that can create a kind of binary or bytecode version of a plaintext script file, which can only be accessed by a proprietary piece ...
4
votes
2answers
81 views
Entrusting third party components in your projects
How do you guys go about entrusting third party packages, libraries, etc. into your projects? In other words, what steps, if any, do you take before incorporating an outside component into your ...
2
votes
1answer
80 views
Future data integrity (n years)
So recently, I had a client ask me to restructure his Database hierarchy which consisted mainly of changing table names and column names and creating cross-references to stop red locks.
He later ...
-2
votes
2answers
114 views
Where can I find the/What are the correct steps/strategy to plan before coding? [closed]
I know how to code and get things done but almost all the time it takes me too much time to create a first working version of the algorithm/application.
I start from one part and then jump to another ...
-1
votes
0answers
45 views
Drivers vs. adapters - difference and commonalities
I have seen in Python programs adapters and drivers classes. Is there any conceptual distinction between those two? What are the purposes, differences and commonalities?
4
votes
2answers
282 views
Practice for returning a value or equivalent variable?
I think it would be easiest to explain what I'm asking with an example.
function getLastNode() {
let current = this.head;
if (current == null) {
// Here, we could either return ...
0
votes
3answers
225 views
Mental model for working with linked list [closed]
I have been doing some practice problems on LinkedList but more than half of my time is spent on managing null pointer issue in my code, provided I have to keep track of current, previous and runners ...
2
votes
4answers
327 views
Data first or code first?
I have seen many questions on whether to design data first or code first when designing a new application. I wonder if some have the same conclusions/ideas as me. I come from painting/digital design/...
-1
votes
2answers
49 views
Does Multithreading help in web scrapping?
To my knowledge multi-threading is just an illusion since CPU schedules time for each of the process. So when scrapping at a particular time, only one content from the website will be scrapped and it ...
1
vote
0answers
18 views
Structure to store resources in SCM repository
I have 3 artifacts for my application as below.
One Jar file
sql scripts
Templates
I need to bundle all 3 as part of a snapshot bamboo build that uploads them into a repository. Is there any known ...
0
votes
0answers
55 views
Invent custom filename extension for derived format
Say I use a predefined serialization format X for certain data. Should I indicate the application in a custom filename extension or not? It is quite common
pk3 is a zip archive
XSL, SVG and many ...
5
votes
1answer
178 views
Log off system on all devices
On websites like Facebook and Twitter, you've got a function to log off on all devices. How does it work?
Does it work with IP addresses or something? What happens when you login on a device and use ...
0
votes
0answers
45 views
What is best practice for building your app on top of 'starter' code someone else prepared?
I want to build Angular2 application on top of angular2-webpack-starter. After pulling this repository, I'm going to add my own app code and commit many changes. Also, developers that built angular2-...
-1
votes
1answer
69 views
Can I use python 3.5.2 on my machine for development if the client is 3.4?
Here is the situation, I wish to use the last programming language of ruby, python and some more on my development machine, but the server where it will be is not last version of that programming ...
-1
votes
1answer
39 views
New project development & git guidlines and hints [closed]
We are two senior students and we want to develop an app.
Although we dont have experience on using git & github.
Our app will consist of a server handling requests with a mongoDB database. The ...
1
vote
1answer
128 views
const variable inside a c++ interface
Can I have const variable in a c++ interface?
Is it valid as part good design? (Not wrt syntax but as per good practices).
For example, if I want a class interface "modellable" which is implemented ...
1
vote
1answer
48 views
Should I give users the ability to 'unreport' on a forum
(I really hope this is the appropriate place for a question like this. Nevertheless, I hope some of you can give me your opinions, regardless).
I am building a forum with Laravel. Progress has been ...
-1
votes
1answer
96 views
Where does Firebase fit in?
I am a front-end developer who is familiar with HTML, CSS, JS and to a degree, AngularJS.
I've chanced upon Firebase (firebase.google.com) - and was wondering if I could, with my lack of knowledge ...
0
votes
1answer
64 views
Best practice for Managing 1200 Counties data for 56 states
I have a complex problem to be solved, I have several excel files containing data from over 1200 counties from 56 states. Problem is that most of the counties has some columns which are different from ...
3
votes
2answers
156 views
Is it good practice to use array.pop() assignment in a while loop condition?
Just saw a code snippet that used an array pop assignment in the while condition; was wondering if this is acceptable/good practice?
var arr = [0,1,2,3,4,5];
var current;
while (current = arr.pop())
{...
20
votes
8answers
3k views
Lie 2: Code should be designed around a model of the world? [closed]
I recently read the Three Big Lies blog post and I am having a hard time justifying the second lie, which is quoted here:
(LIE #2) CODE SHOULD BE DESIGNED AROUND A MODEL OF THE WORLD
There is ...
76
votes
11answers
9k views
Shouldn't unit tests use my own methods?
Today I was watching a "JUnit basics" video and the author said that when testing a given method in your program, you shouldn't use other of your own methods in the process.
To be more specific, he ...
0
votes
1answer
105 views
Is declaring 'const' variable a good programming practice? [duplicate]
Is it a good practice to declare all the variables in my program as a const variable?
eg:-
private int myAge = 20;
private const int Age = 20;
Now, from the above example, which one is a ...
6
votes
5answers
311 views
How can a programmer know whether he has to program a method or search for it in a library? [closed]
I am a beginner programming in Java. And when confronted with a new task I wonder whether I should code the function or search for it.
For example, if I want to calculate 10!, or cos A, I reckon that ...
3
votes
1answer
56 views
Functional testing of incomplete features
I've had several tasks where I'm to do functional testing (and to be writing automated test scripts) on features that are not actually complete.
For example, CRUD testing on a project to make sure ...
0
votes
3answers
56 views
If field is required when inserting data, should I check if null when retrieving?
If some fields are required when inserting data, should I check if null when retrieving them (suppose I need to do something with this fields that may throw exception if null), or I shouldn't unless I ...
0
votes
2answers
59 views
Validation for each record in csv file
I create page to import records so users can import records using a CSV file.
I am already using Sanitization to remove unexpected characters for specific field of the record, Do I have to validate ...
0
votes
0answers
81 views
How to clarify the control flow when dealing with many callbacks?
Traditional programming could be done quite readable. Like this:
FUNCTION do_HTTP_request(url) {
if(!ask_user_if_he_wants_to_connect()) return;
if(!network_is_enabled()){
...
4
votes
3answers
153 views
Should the developer provide steps/directions for SQA?
New to the field of QA, I've been asked to do SQA for a project that I'm unfamiliar with and that is close to completion. An example of a specific functional task to be tested looks like the following:...
3
votes
3answers
181 views
Is it good practice to create interfaces that limit usage?
So I'm coding a way to send events to multiple clients, and then having the clients decide how they want to handle it. I'll exclude the bits that don't lend themselves to explaining the situation.
...
1
vote
1answer
89 views
What is the best way to incorporate new language features into your code? [closed]
My main language is currently JavaScript, and I'd say I'm fairly proficient in it. That is, when I think "I want to do x", I don't (generally) Google "how to do x", but I think "I know! I will use ...
0
votes
1answer
164 views
C++ Basic Rotation Question
I've got a problem and I haven't yet found an explained solution to get it drilled into my head:
I want my object to make a basic rotation TOWARDS the mouse cursor, not the lock-on.
I know it must be ...
4
votes
2answers
169 views
Specification pattern and open closed principle
I'm studying the SOLID principles and I'm having some troubles dealing with the Specification Pattern and the open/closed principle.
The fact is that the Specification pattern introduced by Eric ...
3
votes
1answer
1k views
Why is Lustre used for programming critical control software (Nuclear power plants etc)?
So, as stated on wikipedia:
Lustre is a formally defined, declarative, and synchronous dataflow
programming language for programming reactive systems. It began as a
research project in the ...
-2
votes
4answers
73 views
Multiline formatting of long function signatures/calls [closed]
Let's say you have a signature like so:
public void MyFooBar(IExtraSuperLongTypeName param1, TypeA param2 ISomeotherReallyLongTypeName param3, TypeB param4, TypeC param5)
Formatting in on one line ...
0
votes
0answers
86 views
Close-distance phone location network
I want to design a network in which multiple devices (phones or tablets) very close to each other (between 0.5-20m) will locate themselves in a map shown in each of the devices' App.
Known that:
...
0
votes
0answers
32 views
Nodejs Patterns : Middleware/processor factory vs Generic “singleton” middleware
Say you have an express app, for each route you want to attach an object (lets call it a helper) to the exchange (ex: on res.locals) so that other middleware (like respond below) in the route can use ...
2
votes
2answers
128 views
Is it good practice to use a free website as a package
Is it good practice to use a free website as package identifier if I do not have a real website? EG com.weebly.vikarjramun.myapp.myactivity Just wondering...
17
votes
3answers
786 views
Code development process for Voyager mission?
Here's an intro
Voyager 1 reached interstellar space in August 2012 and is the most distant human-made object in existence. Launched just shortly after its twin spacecraft, Voyager 2, in 1977, ...
18
votes
7answers
2k views
What are possible disadvantages of pair programming? [closed]
Pair programming is quite famous now-a-days.
It has several advantages like:
Programs with fewer bugs.
Post production maintenance cost is much less.
Established practices are challenged resulting ...
1
vote
2answers
139 views
Two apps vs one app
We are developing a mobile app/apps which has two parties involved, creators and consumers. Creators first register themselves, get verified and then create the events. Consumers browse for desired ...
0
votes
1answer
126 views
Commonalities between Programming languages [closed]
I've tried looking on google but can't get the answer I want to this. Is there a book or article or a video where various commonalities of different popular high level languages like Python, Java, C++ ...
2
votes
3answers
167 views
Data duplication, can it be an unavoidable practice in this example?
Say I have different employees of type Employee stored in a list inside a class SubCase.
public class SubCase{
protected ArrayList<Employee> employees;
...
}
SubCase represents a part ...