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.
1
vote
2answers
401 views
How can i get around of infinite circle of technology change [duplicate]
I have been in web developement for 6 years. I am facing one big problem and i want to know how can i get rid of it.
There are many personal projects like web application which i want o build.
As an ...
0
votes
1answer
152 views
Is it good practice to shorten functions? [duplicate]
Is it good practice to shorten functions? Like this code for instance:
using System;
namespace Hello
{
class Program
{
public static void ...
24
votes
8answers
3k views
Is throwing an exception an anti-pattern here?
I just had a discussion over a design choice after a code review. I wonder what your opinions are.
There's this Preferences class, which is a bucket for key-value pairs. Null values are legal ...
1
vote
1answer
68 views
Best practices for lookup tables in the application - by id or value
I have a complex database application. There are a lot of lookup tables containing a few values, in particular one contains pass / fail / waiting / unknown.
In the application I find many of the ...
-1
votes
0answers
58 views
Best practices for developing with remote front end developer [on hold]
I'm planning to work with a remote front-end developer, we will have access to a REST web service as server app, the server app is based on Spring it is hosted on a remote server.
the problem is ...
3
votes
5answers
129 views
Exception handling and 3rd party library
I'm currently having an issue with a 3rd party control library provider. They have an exception occulting culture that gets in the way of my general fail-fast approach when developing software.
An ...
8
votes
8answers
3k views
Are there any easy-to-follow/reliable methods for simplifying code? [duplicate]
There is a problem with the way I code. Regardless of how much of a plan I write beforehand, the code becomes overcomplicated quickly.
Reading books on good practice and attempting to adhere to their ...
-1
votes
0answers
30 views
What is the name for framework-style development? [closed]
When developing targeting frameworks, I tend to follow principles to support backward-compatibly (within reason), to avoid breaking existing application code:
Don't change class names or namespaces.
...
1
vote
5answers
465 views
When, if ever, should I daisy chain functions?
I'll try to be as brief as possible in respect to your time.
In a program divided up into many functions by which it is intended that they execute themselves one after another, when (if ever) is it ...
0
votes
1answer
58 views
How can I condense a case class with ~20 constructor arguments into 5 or 6 arguments in Scala?
Let's say I have a case class with ~20 constructor arguments? This is obviously very clunky to type. What would be the best way to condense these arguments into maybe 5 or 6 arguments? There are some ...
0
votes
2answers
64 views
What does one mean by UI Independent client logic?
I was reading this excellent post on Gmail's Blog.
And I came across this line in the end which says,
If you’re building an application that (a) has significant UI
independent client logic
...
3
votes
2answers
144 views
Software development - The industry & general trends / Bad practices [duplicate]
I am a Web Developer and part of a small team working on an abundance of projects. This is my first "actual" real company after graduating with a degree in computer Science and I have about 2 years ...
-1
votes
1answer
53 views
Injecting a javascript code to all requested web pages by a desktop application
I work in a community school and I have been requested to censor some words in all requested web pages (page content-html level). If I could inject a javascript code I can do that with a simple ...
0
votes
2answers
56 views
How do I organizing 2 different projects with shared code
I know there have been same question asked multiple times on the programmers stackexchange. I think my question is more specific and hence decided to start a new question.
My current a project which ...
9
votes
3answers
1k views
Are there any benefits of using this extra variable in the for loop annotation?
I have found the following loop annotation in a big project I am working on (pseudocode):
var someOtherArray = [];
for (var i = 0, n = array.length; i < n; i++) {
someOtherArray[i] = ...
0
votes
1answer
90 views
Is it reliable to use and download libraries needed from GitHub and copy-pasting codes in order to increase productivity? [duplicate]
I'm just wondering. Is it okay or true that some of the best programmers once taught that to become an effective programmer is through being a lazy programmer rather than spend time memorizing lots of ...
24
votes
7answers
3k views
What's the best way to avoid catastrophe caused by negligence? [duplicate]
I have been a programmer for almost 1 year.
As an ADHD adult, naturally I don't have the same strength of attention on ordinary stuffs as my colleagues do.
And I find the catastrophe made by me are ...
3
votes
1answer
73 views
Should I rename package after Android app name change?
I have an Android app.
I have changed the app's name from appname1 to appname2. I would like to know if I should also change my package name from com.myname.appname1 to com.myname.appname2 to reflect ...
-2
votes
2answers
99 views
which is a better practice one method that does everything or a series of different methods?
I'm working with asp.net and c#
Lets say I have a bunch of drop-downs and I want to bind data from a database, is it better to make a master-bind method that loops each one and gets the parameters to ...
-1
votes
3answers
137 views
Have you ever purposely memorized code, and was it useful? [closed]
In school, we memorize the basics - the ABC's , the times-table, the capitals of states.
Is there a place for memorization in Computer Science?
Or is memorization just a waste of time?
1
vote
1answer
69 views
Using conditional feature compilation/inclusion for release versioning
I have been playing with the following idea: commonly when different release series (1.0.x, 1.1.x, development code) of a product are maintained in parallel one uses different branches within a ...
1
vote
0answers
44 views
Java MVC: multiple use of the same event for different actions
I am working on a large Java project which employs the model-view-controller pattern. Should I use a different event for each action (to let the views communicate with their respective controllers)? ...
0
votes
1answer
119 views
Why is using break considered bad practice? [duplicate]
I am currently in a beginning programming course at my University (I've got plenty of experience in the subject already, but I still have to pay for that piece of paper with time and money.) and the ...
0
votes
1answer
76 views
Where does the Liskov Substitution Principle generally lie in different constructor parameter lists?
There are two other questions I've posted that dealt with specific cases of this:
Where does the Liskov Substitution Principle lie in a subclass passing extra arguments to similar, tightly-related ...
2
votes
3answers
591 views
Why is it a good practice to keep Javascript code in separate files?
In web development we are commonly used to keep Javascript code in separate files, but sometimes we need this Javascript code to manipulate server side data locally.
For example, making an Ajax Call ...
0
votes
2answers
159 views
Which language has most advanced support for proof based programming? [closed]
By proof based programming, I mean, you can somehow prove the correctness of your program without testing.
I heard that Ada has a feature called contract, I also heard that, if you can pass Haskell's ...
1
vote
1answer
59 views
Where does the Liskov Substitution Principle lie in a subclass passing extra arguments to similar, tightly-related callbacks?
Take the following examples, which have been abbreviated:
BasicButton:
public class BasicButton
{
private var m_fOnClick:Function;
public function BasicButton(pOnClick:Function)
{
...
2
votes
6answers
338 views
Why sacrificing good software engineering practices is typically the first choice for software development projects assuming “good enough” quality [duplicate]
I have observed a correlation between a customer ordering software of "good enough" quality and the same customer not willing to pay for good engineering practices (unit testing, code reviews and the ...
2
votes
2answers
164 views
When testing is it OK to use a method of the subject to test another method of the subject? [duplicate]
I have two methods in the same helper class one that creates an image (method A) and one that compares two images (method B).
I want to check the return of method A against an existing image. To do ...
0
votes
1answer
121 views
What is the correct way to bind few classes with similar functionality?
I want to do this in the right way to learn
I have a few classes which have only one method. For example:
public class RedColorText
{
public void AddRedColorText(string text)
{
...
0
votes
1answer
109 views
Testing - How to test if you are actually testing the code?
I was thinking about unit tests and code coverage, and I came up with this thought:
It is possible to have 100% code coverage and not test 100% of your code.
For example:
function ...
0
votes
1answer
47 views
Testing - Test for Specific Paths?
When (unit) testing, is is bad to expect the code to use certain paths.
For example, should I be testing for specifically "/build/static/public/css/", or just that server.cssPath has been set to a ...
1
vote
2answers
98 views
Should you test development features?
Is it a good practice to test features that only run in a development environment, or just a waste of time?
Specifics: The item that is prompting this question is a line of code that dynamically ...
51
votes
11answers
5k views
How do I avoid cascading refactorings?
I've got a project. In this project I wished to refactor it to add a feature, and I refactored the project to add the feature.
The problem is that when I was done, it turned out that I needed to make ...
1
vote
1answer
120 views
Special parameters for behaviour, good or bad practice?
I really was questioning to myself where to ask this, as I could not decide myself. This is more of a software design question.
Context
I currently maintain a small Node.js module on NPM which ...
11
votes
4answers
399 views
When should a private method take the public route to access private data?
When should a private method take the public route to access private data?
For example, if I had this immutable 'multiplier' class (a bit contrived, I know):
class Multiplier {
public:
...
0
votes
1answer
49 views
When to Save Assets (mainly Pictures) in DB and when on Filesystem?
For a web application we are planning (some kind of product information system). We have to manage all the assets (pictures) of the products.
There are system (Wikis or DAM System) that save the ...
2
votes
4answers
259 views
How does a developer code in anticipation of change? [closed]
I ask this question based on the fact that currently my environment is under constant change due to the type of work we do. We do not always work on a project bases we often have smaller changes that ...
0
votes
1answer
57 views
Publish Modules from a Java Project on Github and integrate into IntelliJ
What is the best practice to work with several Java modules from different GitHub sources using IntelliJ?
This might be an odd qeustion but I do not know what the standard workflow is to achieve what ...
1
vote
3answers
92 views
Nullable enumeration values vs. “NoValue” or “Undefined”, etc
I often write code which translates entities in the database to domain objects. These entities often have fields which are constrained and translate to enumerations in the domain objects. In some ...
1
vote
1answer
132 views
Should I use foreign keys in my database if I use laravel?
I'm creating a website with Laravel for the first time. I checked relationships documentation today and it seems that Laravel just uses simple SQL queries.
class User extends Eloquent {
public ...
0
votes
1answer
135 views
Suggestions on refactoring a poorly written ASP.Net MVC web application [closed]
I have recently "inherited" a project written in ASP.Net MVC which has quite a few issues
and I'm looking for suggestions on how to go about refactoring the code.
The technical issues found so far ...
3
votes
1answer
90 views
What is the correct way to publish a runtime? Should it be a singleton?
I have a compiler for a programming language that targets JavaScript. That language needs some global functions such as: alloc, memcpy, write and so on. My question is: where should I position those ...
0
votes
1answer
48 views
Developer account in OSX, admin or managed user with our without sudo access?
The tutorials I find to setup OS-X for web developer programming (installing x-code ruby js cocoapods sql c asm etc) leave out if it should be done from an admin account, or standard (managed) user.
...
1
vote
1answer
162 views
The Better Parts and Delegation: Is Crockford Too Extreme?
Douglas Crockford has recently been giving a talk called The Better Parts. The gist of the talk is that JavaScript developers should actually avoid a superset of the The Bad Parts, which now includes ...
2
votes
1answer
174 views
Redundant ElseIf-Else Blocks [duplicate]
These types of if-elseif-else blocks appear all over the place, and in no small number (so the less the better). Every time I have to think and decide: Do I want the simpler or the more thorough of ...
0
votes
1answer
71 views
Sending Out Functions To Return Or To Die
Which is preferable for both solid technique and secure coding?
Example #1:
function_one()
blah;
function_two()
blah;
print blah;
exit;
...
Example #2:
...
4
votes
2answers
238 views
Is it better to use strings or int to reference enums outside the java part of the system?
We were having a discussion at my work about the use of enums in Java.
A coworker was arguing that when using enums on the server-side, whenever required we should use string to reference to it (for ...
-3
votes
2answers
148 views
Is worth to read The Clean Coder book If Pragmatic Programmer is already read? [closed]
Some weeks ago I read The Pragmatic Programmer by Andy Hunt, and I want to know if The Clean Coder book by Uncle Bob will give me some improvements about a recommended attitude and practices to be ...
2
votes
1answer
62 views
Returning the object/$this [duplicate]
A very general question. I was thinking about method chaining, which seems useful, and began wondering if there is a reason to not return the object in a class member, as a matter of course.
For ...