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

0
votes
0answers
19 views

a practice about dev and prod environments

English is not my native language, please excuse me if I make mistakes. prod: production, dev: development I just began a new project in a new team and I am confused about a practice in our process. ...
1
vote
1answer
93 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 ...
-1
votes
0answers
74 views

Redundant ElseIf-Else Blocks

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
64 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
217 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 ...
-1
votes
0answers
57 views

Should I use the at symbol (@) in my php code [migrated]

I have recently learned how to use the @ symbol in my php code and I have learned to love it. However I have also been told that @ is not efficient performance wise. Is the elegance it provides enough ...
2
votes
1answer
60 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 ...
-3
votes
2answers
120 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 ...
1
vote
1answer
79 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
91 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 ...
3
votes
3answers
191 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 ...
-1
votes
0answers
34 views

Where can I get collection of programming problems from basics [closed]

A collection of programming problems ( both language specific + general ) , kind of checklist to become familiar with programing. Long version : A lot of questions are targeting how to learn ...
50
votes
7answers
2k 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 ...
7
votes
5answers
8k views

How to handle large numbers?

Well, I've just started doing puzzles and it's so annoying to see puzzles which are easy to do but also need to handle very large numbers. That's the problem. Say I have to deal with numbers like 10 ...
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
49 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 ...
26
votes
2answers
16k views

Git branching and tagging best practices

I am currently learning to use Git by reading Pro Git. Right now I'm learning about branching and tags. My question is when should I use a branch and when should I use a tag? For example, say I ...
2
votes
1answer
69 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 ...
13
votes
7answers
2k views

A defense for boilerplate?

To me, boilerplate code is obviously bad. However I've met a developer who displays resistance in any attempt to reduce boilerplate. I realized I didn't have a readily formed, well thought out ...
6
votes
1answer
517 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. ...
1
vote
1answer
48 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 ...
6
votes
2answers
1k views

When is it appropriate to do calculations in front-end?

My team is developing a WEB based finance application and there was a bit of an argument with a colleague where to keep the calculations - purely in back-end or keep some in front-end too? Brief ...
4
votes
1answer
283 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 ...
0
votes
1answer
70 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
100 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
66 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
47 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 ...
1
vote
1answer
419 views

JSP Include: one large bean or bean for each include

I want to refactor a webapp that consists of very distorted JSPs and servlets. Because we can't switch to a web framework easily we have to keep JSPs and Servlets, and now we are in doubt how to ...
0
votes
0answers
33 views

how to combine logs coming from multiple virtual machines for processing?

Scenario: Two virtual machines produce logs. I want these logs to be sent to a central server for processing (as soon as a line of these logs is generated-->streaming ). The condition here is that I ...
2
votes
1answer
263 views

Unit test storage on Android apps

I've been experimenting recently with Android applications. I've developed the convention (which I've seen used elsewhere) of placing my unit tests in a parallel source folder within an Eclipse ...
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 ...
1
vote
1answer
142 views

Methods for structuring JavaScript SDKs

I've built a REST API and have been using Backbone models throughout a couple different applications to communicate to it. I would really like to build a single JS SDK that can be used in any ...
8
votes
5answers
585 views

How to do Test Driven Development

I have just 2+ years of experience in application development. In those two years my approach towards development was as following Analyze requirements Identity Core component/Objects, Required ...
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 ...
3
votes
3answers
320 views

Should we add constructors to structs

We often use c++ structs to define data structure as opposed to class which can be a complete module with member methods. Now deep down, we know they both are the same (loosely speaking). The fact ...
3
votes
2answers
190 views

How and Why should class modifiers enforce or prevent inheritance and the ability to override

This isn't really related to anything I am working on currently, its more of a question I really couldn't find an answer for. Class modifiers like MustInherit or NotOverridable to me, seem like they ...
3
votes
1answer
92 views

Bringing coding best practices for non programmers (economists) [closed]

I now work in a team of economists, many of them specializing in a branch known as econometrics, that is heavy on statistics. I am the sole engineer on the team. They make use of EViews(a ...
1
vote
0answers
108 views

Program Architecture: How to manage objects that are interdependent

Consider the following case, image I making a simple chat program; I want it to be extensible such that it would be fair easy to add add different scripting and user interfaces. I want the core ...
5
votes
4answers
2k views

Should you ever use private on fields and methods in C#?

I am somewhat new to C# and just found out that: in C# all of the fields and methods in a class are default private. Meaning that this: class MyClass { string myString } is the same as: class ...
24
votes
3answers
1k views

Is it considered a bad practice to add logic in a property setter?

I jumped in to a project and I see that the other developers are adding a lot of logic in the setters of synthesized properties. I understand how this works, but I think that it makes it hard to ...
4
votes
1answer
2k views

How to avoid context switching while developing full stack web apps?

To give some context, I've been a Ruby & Rails developer for the past few years, and just recently started doing quite a lot of JavaScript to add more responsiveness to the apps. When programming ...
3
votes
1answer
109 views

Difference between patterns: Specification, Guarding, Conditions, Monads, Validation,

I'm currently trying to get my head around a few patterns (especially the ones mentioned in the title above) that are made to address different problems and are being used in different parts of the ...
15
votes
5answers
8k views

What are the pros and cons of HTML5, native and hybrid mobile app approaches?

I want to develop a mobile application .. I read lately an article on Telerik Forum : it compares among three types of mobile application and I don't know which one should I select to begin with .. ...
2
votes
5answers
84 views

Using DDL commands in programming language [duplicate]

Hello I am a student with no industry experience. My question may sound dumb, but, me and my friends were having discussions on use of DDL directly in programming language (any language may be Java, ...
-2
votes
2answers
176 views

Why doesn't array declaration guarantee proper memory allocation whereas malloc does? [closed]

In C++, when I declare an array like int array[10];, it sometimes uses memory assigned to other variable where as this problem is non-existent when I use an integer pointer and malloc to allocate ...
5
votes
6answers
417 views

is it a bad programming practice to return a new object in a property

I've always had this question and I think it is time to settle the answer, is it a heavy load to do this : public Rect Bounds { get { var Top = (_targetPosition ...
32
votes
6answers
6k views

Code that converts a value into a different representation, then converts it back to where it started is bad, but how? [closed]

I was reading an article about bad programming practices. It mentioned - "Yo-Yo code" that converts a value into a different representation, then converts it back to where it started (eg: ...
19
votes
5answers
583 views

Is staying implementation agnostic really worth it?

I have a project that I'm working on currently using Tomcat, Spring 4, Spring Security, MySQL, and JPA w/ Hibernate. I picked JPA from the standpoint that it's suppose to make swapping out the ...
0
votes
0answers
22 views

Add new/modify existing callback to/in API

I am working on a common API for a user interface. My colleagues use this framework in all their projects, but the UI is not our main aspect here, so the knowledge of the UI framework is somewhat ...
4
votes
1answer
485 views

How dangerous is it to take shortcuts when coding Web based applications? [closed]

I started working as a Web developer few months back. Previously, I had no prior professional experience in programming besides school classes and fun-side projects I did on my own. I am the only ...