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
1answer
13 views

Is it reliable to use and download libraries needed from GitHub and copy-pasting codes in order to increase productivity?

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 ...
1
vote
0answers
22 views

What's the best way to avoid catastrophe caused by negligence?

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 ...
1
vote
0answers
12 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 ...
0
votes
0answers
17 views

How should I order software contributors in a citation? [on hold]

I've been involved in a couple of software projects (academic and industrial), and occasionally there's a need to cite the software (e.g. in a scientific publication). It might come up in a job ...
-2
votes
2answers
83 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
124 views

Have you ever purposely memorized code, and was it useful? [on hold]

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
65 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
34 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)? ...
-1
votes
0answers
62 views

Advantages from “The pragmatic programmer” & “Pragmatic thinking and learning” for game developer? [on hold]

I'm 18 and have been coding for 2 years. Currently developing games with Unity3d (C#) and previously mostly have been studying algorithms, console apps and XNA. Now I'm intending to continue in the ...
-1
votes
0answers
34 views

Binary Search scheme alteration [on hold]

I'm having a bit of an issue with programming an algorithm..... below would involve some of the details of the assignment; now before you begin to say that I should actually attempt, in solving this ...
0
votes
1answer
113 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
72 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
560 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
150 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
52 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
309 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
141 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
103 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
46 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
96 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
383 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
48 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
247 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
43 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
89 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 ...
-3
votes
0answers
12 views

Recursive solution for 3n+1 [migrated]

I just like to do simple recursion. For a number if it is even then it'll approach to (number/2) and if odd then to (3*number+1). How many time it'll occur to reach 1. for 10 10-> 5-> 16-> 8-> 4 ...
0
votes
1answer
75 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
128 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
47 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
147 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
171 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
68 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
232 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
141 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 ...
1
vote
1answer
114 views

Is there a common set of best practices for passing anonymous functions as arguments?

This is a generic question about using anonymous functions as arguments to other functions. I give an example in Python, but the question is not about Python (and I'm particularly interested in ...
0
votes
3answers
100 views

Coerce bad input or always crash early

The general consensus seems to favor the Crash Early approach, the most reputable source being the acclaimed Pragmatic Programmer book. And while I understand and agree with the advice in many ...
0
votes
0answers
74 views

What is the best way to remember a successful execution over several program calls?

I'm working on a build process, that is called manually over the command line. To check if it exited unsuccessfully during the build I want to set a lock file (symbolic link) and remove it on ...
0
votes
2answers
56 views

Should I use ASP .resx resources if the website is available in a single language?

Is it a best practice to always store strings in ASP .resx resources files, even when the application is not localized according to the user culture ? (Web pages will be displayed in french.) Is there ...
2
votes
1answer
91 views

Enforcing manual inclusion of a specific header file (banned.h)

Banned.h is a list of ANSI C functions that Microsoft is trying to persuade programmers to deprecate. I already know how to enforce automatic inclusion of banned.h (such as the answer to Ensuring that ...
3
votes
3answers
252 views

Best OOP Practice in C#: Passing the object as parameter VS creating a new instance of the object

First things first, I would like to know if passing an object as parameter is much better than creating another object AGAIN in a class that will use it again and second what are the pros and cons of ...
6
votes
1answer
523 views

How can I tell when a program argument should be a configuration variable?

In simple cases I can see right away which direction to go. If I'm passing a working directory to my program, and it's the same for the vast majority of the runs, make it a configuration variable. ...
51
votes
7answers
3k views

Code First vs. Database First

When I design and create the software I work on, I typically design and create the back-end SQL tables first and then move on to the actual programming. The project I'm currently working on has me ...
1
vote
1answer
51 views

Who is responsible for stream positioning?

The samples in question are c#, but it applies to any language. If you have a function which reads content from a stream. Who should be responsible for ensuring that the stream position is correct ...
0
votes
1answer
72 views

What are the key areas to evaluate software (codebase) on? [closed]

I have been asked to do a code review of about 50 applications over a period of 6 weeks. (Management has changed and the new CTO asked for an full internal software audit) I am wondering, what are ...
3
votes
1answer
103 views

Is console logging inappropriate for chatty applications?

12 Factor states that applications should log to the console, those console logs should should be unbuffered, and the logs should be redirected to someplace useful (file, database, whatever). But ...