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
votes
0answers
41 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
31 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
99 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
67 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 ...
0
votes
3answers
280 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
146 views

Which language has most advanced support for proof based programming? [on hold]

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
51 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
294 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
140 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 ...
-3
votes
0answers
48 views

had a question here [closed]

So I am 36 and have spent about the last year learning python and slowly learning another language also and plan to learn others also in time but I understand this could take 3 or 4 or so years to ...
-2
votes
0answers
65 views

Text Editor with Autocomplete in C/C++ and OpenGL [closed]

I am looking for a text editor that is capable of auto complete for c/c++ for OpenGL coding. I will be writing a game and want to go with a text editor instead of a full-fledged IDE so that I can ...
-5
votes
1answer
64 views

Got stuck in this javascript program [closed]

I want to make this program which can multiply 2 numbers. Note: its not a homework or assignment it's just a simple guy trying to learn programming and I think that as I learn fundamentals I should ...
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
102 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
377 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
47 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
40 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
88 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
73 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
125 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
45 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
169 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
139 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
53 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
84 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
249 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 ...
2
votes
1answer
68 views

Under which circumstances does it make sense to lose track of where an exception was thrown from?

Is there any valid reason why a catch block on a lower layer would throw back an exception caused by a higher, unknown layer using the following syntax: throw ex; ... rather than: throw; ... ? ...
0
votes
1answer
52 views

Advice needed on rethrowing an exception

Consider the following c# code: public class ExceptionManager { public static void TreatException(Exception ex) { if (ShowAndContinue(ex)) // display a user-friendly ...
18
votes
8answers
2k views

Is it normal for a programmer to not have 100% clarity over their own code at times? [closed]

I'm not an expert programmer so this may be why, but I've come to notice that whenever I create complex code (like a Chess game I recently made), I am able to write the correct code to get the program ...
0
votes
0answers
27 views

Manual repetitive conversion between file types

Let's say i have an interest in file conversions, but everything should be made by hand and i have multiple output formats (say: csv and excel). Once i get contacted by a client, i have to link ...
4
votes
1answer
342 views

How to move php documentation closer to standards?

I have an large php project. I used to document it with NaturalDocs, but I didn't include the documentation generation in the build process for a long time ( years ). I recently started using ...