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.
3
votes
2answers
153 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 ...
1
vote
0answers
43 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
99 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
80 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
77 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
112 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
41 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
272 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
217 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
324 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
44 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
54 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
169 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
43 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
67 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
122 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
47 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
90 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
147 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
103 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
54 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
55 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
57 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
79 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
150 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
180 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
163 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
161 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
71 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
127 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
780 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
132 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
122 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
165 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 ...
3
votes
1answer
163 views
Is it considered a bad practice to oversize an array so that negative indices behave well?
I have been practicing implementing some classic dynamic programming algorithms and was wondering if my implementation of the longest common subsequence search has a significant code smell.
In python,...
1
vote
1answer
73 views
Creating a software development process for teams that don't have one
My workplace has several groups that have little to no software development process. They use source control, and lightly use an issue tracking system, depending on the project. Teams are not ...
1
vote
2answers
107 views
Trouble conceptualising API's
I've been reading a number of articles on "what is an API" but they're either too high level or two low level for me... I can't seem to quite grasp the entire concept, or have that sneaking feeling ...
39
votes
5answers
9k views
Should you always program server side for a website?
I'm about to start creating a music project website for a friend. It should be pretty simple for now: no dynamic content (tour dates, etc.), and nothing more than a few embedded sample songs or ...
1
vote
0answers
52 views
Updating class property inside the method vs. returning a value from the method
In a large code base, what is a good practice between: Updating class properties inside the method vs. returning a value from the method and updating the property in the place where the call to the ...