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. Common Questions Include: Code Shortcuts Typedefs and Defines Converting Spaghetti Code
2
votes
3answers
118 views
Should a method do one thing and be good at it?
"Extract Till You Drop" is someting I've read in Uncle Bob's blog, meaning that a method should do one thing alone be good at it.
What is that one thing? When should you stop extracting methods?
...
0
votes
4answers
132 views
How does using #define for loop and condition bounds in C increase security?
My program uses the following define statements:
#define LOWEST_PATIENT_ID 10000
#define HIGHEST_PATIENT_ID 99999
#define LOWEST_CRITICAL_STATUS 1
#define HIGHEST_CRITICAL_STATUS 100
used in this ...
1
vote
3answers
81 views
What is considered best practice for printing usage / help (--help)?
When writing tools for the CLI of UNIX, how should I make the program print out help and/or usage?
I usually use fprintf(stderr, "help text here");, but there are several issues with that.
First, ...
1
vote
0answers
69 views
What is the trend with BDD? Is it gaining track or losing it? [closed]
In retrospective (as BDD is here since about 2007), is BDD appears to be a viable methodology or just another passing buzz?
I'm not asking this question to start a debate about BDD. I am interested ...
-2
votes
0answers
46 views
Literature for programming tasks/problems [closed]
I am in need of good books or articles on programming problems or should I say tasks, with collection of tasks and there answers with some explanation on how were tasks done why did they do this, etc, ...
9
votes
7answers
611 views
Checking if a method returns false: assign result to temporary variable, or put method invocation directly in conditional?
Is it a good practice to call a method that returns true or false values in an if statement?
Something like this:
private void VerifyAccount()
{
if (!ValidateCredentials(txtUser.Text, ...
-9
votes
0answers
60 views
What programming language should I learn next? [closed]
It's time for me to learn another language, so far I learned Java but I don't know what should I learn next? I was thinking about C++ or Ruby - what do you think about them and what do you recommend?
51
votes
12answers
2k views
Does programming in general become easier to read, write and understand as you gain experience?
I'm a beginner in programming and I've been reading books, studying, reading articles, and whatnot. I'm getting great results since I've started learning programming, and when I was a beginner I used ...
-3
votes
4answers
177 views
Why is “click here” such bad link text? [closed]
What is the reason that "click here" links are deemed such bad practice?
e.g.
To visit other questions click here.
To me, it seems logical and quite clear.
22
votes
17answers
2k views
Is it a good practice to name the returned variable “result”? [closed]
Is it a good practice to call the variable a method returns with a variable name result?
For instance:
public Zorglub calculate() {
Zorglub result = [...]
[...]
return result;
}
Or ...
111
votes
22answers
7k views
Why are shortcuts like x += y considered good practice?
I have no idea what these are actually called, but I see them all the time. The Python implementation is something like:
x += 5 as a shorthand notation for x = x + 5.
But why is this considered good ...
17
votes
10answers
1k views
Is programming or computer science in general, all about algorithms?
As a grad student, I find it more and more common for prestigious companies (like Google, Facebook, Microsoft,...) to put algorithm questions in their test and interviews. A few startups I applied to ...
19
votes
8answers
616 views
Private variable vs property?
When setting a value to a variable inside of a class most of the time we are presented with two options:
private string myValue;
public string MyValue
{
get { return myValue; }
set { myValue = ...
-3
votes
6answers
389 views
Why women's share is less than men's share in professional development? [closed]
As a recruit agent in a software company, I noticed that among each 10 candidates, at least 8 are men. So, this resulted in a search-for-reasons process, in which, I couldn't find what I sought.
...
18
votes
11answers
934 views
typedefs and #defines
We all have definitely used typedefs and #defines one time or the other. Today while working with them, I started pondering on a thing.
Consider the below 2 situations to use int data type with ...
-5
votes
2answers
114 views
Books for C/C++ [closed]
I need to know the best two books each for C and C++ where:
The first book covers the language itself in extreme depth.
The second one covers the advanced programming skills in the language.
I'll ...
-3
votes
1answer
62 views
What is the difference between ADT and API [closed]
I wonder if anyone could tell me what's the difference between Abstract Data Type and Application Program Interfaces's
1
vote
5answers
91 views
Automatic sorting of class/module members and its possible impact on productivity and code quality
Recently I saw some possibilities of some IDEs (via plugins) to sort members of their classes/modules based on some criteria, sou you could have everything sorted automaticaly no matter where you ...
2
votes
3answers
132 views
Is it important/essential to learn software development methodologies for beginners?
I'm a student and I've been programming for not very long.
Particularly, I'm learning CodeIgniter framework - The book I'm reading is "Professional CodeIgniter". In the book, the author mentioned ...
7
votes
7answers
457 views
As a programmer, what am I supposed to know like the back of my hand? [closed]
I am talking of stuff related to programming only and not system or network administration.
I am about to finish college and get a programming job, so I am interested to know about this. Although ...
5
votes
5answers
310 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 ...
-3
votes
3answers
165 views
Would Smalltalk be a good introduction to programming? [closed]
I've found this resource, http://stephane.ducasse.free.fr/FreeBooks/Gnu/ProgrammingUsingGnuSmalltalk.pdf
EDIT : Is Smalltalk a recommended language for a beginner to learn programming?
2
votes
6answers
349 views
How to make code writing more accurate?
I am trying to practice writing code for a long period of time before compiling and write unit test (if possible) for what I wrote (the language is C++). Of course, I got the IDE support (Emacs or ...
-2
votes
1answer
193 views
Why is BASIC bad? [closed]
Possible Duplicate:
Do you think that exposure to BASIC can mutilate your mind?
BASIC, and related dialects, have long been branded "bad". I've seen it said by some of the best programmers ...
16
votes
10answers
1k views
Struggling as a programmer. Need some advice [closed]
I've been a developer now for a number of years. I'm pretty good at what I do and can "get the job done".
But, there is a difference between "getting the job done" and "doing the job properly". Let's ...
17
votes
4answers
783 views
Two HTML elements with same id attribute: How bad is it really?
Just browsing the google maps source code. In their header, they have 2 divs with id="search" one contains the other, and also has jstrack="1" attribute. There is a form separating them like so:
...
26
votes
7answers
983 views
How to convert a copy/paste/spaghetti programmer to see the light?
This question was inspired by this one. While that other question was deemed localized, I believe the underlying problem is something that is extremely common in our industry. I know there are some ...
-2
votes
3answers
212 views
Why are stricter (real) programming languages better than something like PHP? [closed]
I have a few questions (related to the title) so please bear with me.
My first question, as the title states, is (considering that PHP wasn't originally designed as a programming languages, and ...
-5
votes
2answers
175 views
Is it OK to program in bed? [closed]
Do you lot sit with PCs on the bed or do you sit on a chair while programming? I usually sit with my laptop computer on a bed where I sleep. Is this a good practice? Do you ever feel lazy and then ...
9
votes
2answers
328 views
What does a “bodyshop” (in context of a programming job /environment) mean
I've kept on coming across the term "bodyshop" in terms of a programming job/environment but despite googling I can't find out what exactly this is referring to? Can someone please enlighten me?
3
votes
3answers
169 views
Separating the UI from its event handlers and database queries
Is it a good practice to separate the handlers and database queries in different classes?
There will be a separate class containing all the necessary event handlers, and there would also be another ...
1
vote
7answers
232 views
Are there any books that explain non-specific programming concepts?
I consider myself a beginner-moderately skilled programmer (dabbled in a number of languages now, settling on PHP for web development now) looking to better myself.
I've spent a great deal of time on ...
2
votes
7answers
180 views
What's a good way to prepare for this course titled “Programming Language Security”?
I have a course with the following description:
The purpose of this course is the study of programming language security features and languages designed to support it explicitly. Static and ...
0
votes
2answers
72 views
Session Variables and Proper Implementation
Is there any other reason for using session variables besides keeping the values longer than the current request? For instance, is it advisable to use session data when storing information in a file ...
3
votes
1answer
70 views
Linking a modular option to a program without creating a dependence
I would like to make my programs much less of a hassle to extend or create, I am imagining a scenario where the end user has a variety of check box options that affect how the program interacts. ...
1
vote
1answer
203 views
How to be successful in a 24h game hackathon? [closed]
In a few weeks me and my team will go on a full 24h game hackathon. They will give as game theme at the start of hackathon and we are allowed to use any programming ...
12
votes
7answers
419 views
Building a complete program?
Reading books, watching videos, and reviewing tutorials is all very easy. Taking notes and actually learning the material may be slightly harder, but even then, anyone with a decent brain and a fair ...
7
votes
8answers
345 views
What are some common examples of a Hash Table?
I was just wondering if there were some "standard" examples that everyone uses as a basis for explaining the nature of a problem that requires the use of a Hash table. What are some well-known ...
4
votes
4answers
126 views
Is reference to bug/issue in commit message considered good practice?
I'm working on a project where we have the source control set up to automatically write notes in the bug tracker. We simply write the bug issue ID in the commit message and the commit message is added ...
7
votes
7answers
296 views
Do you start writing GUI class first or reverse?
I want to write my first Java program, for example Phonebook, and I wonder what to do first. My question is should I write GUI classes first or util classes first?
I am database developer and want to ...
0
votes
2answers
131 views
How to concentrate on one project at a time. Divide and Conquer doesn't work for me [closed]
Possible Duplicate:
Tips for staying focused and motivated on a project
I have serious issues on concentrating on one project at a time. I cant even follow the Divide and Conquer Approach. ...
26
votes
14answers
2k views
Differences between programming in school vs programming in industry?
A lot of students when they graduate and get their first job, feel like they don't really know how to program even though they may have been good programmers in college.
What are some of the ...
2
votes
2answers
125 views
Sports Programming [closed]
Other than programming, I'm addicted to sports. I'd like to integrate the two together. What are different programming languages that companies like ESPN use to work with stats? What techniques are ...
2
votes
3answers
194 views
How to deal with the programmer's block? [closed]
Possible Duplicate:
Dealing with frustration when things don't work
Something I find myself coding something difficult and after hours of struggle my mind goes blank and I don't know ...
11
votes
8answers
240 views
Finding time for concentrated recreational programming when having kids [closed]
As a father of two young kids it's increasingly difficult to find time to concentrate on some recreational programming. There are small pockets of time here and there, but I notice it's difficult / ...
5
votes
3answers
263 views
What are combinators and how are they applied to programming projects? (practical explanation)
What are combinators?
I'm looking for:
a practical explanation
examples of how they are used
examples of how combinators improve the quality/generality of code
I'm not looking for:
explanations ...
3
votes
8answers
608 views
Why has the rate of programming language popularization slowed down in recent decades? [closed]
If I understand correctly, there was a huge birth of programming languages during the early decades of computing, but then things have stabilized.
Basically, why are many universities and industries ...
18
votes
9answers
2k views
Definition of a Software bug. Blizzard Entertainment insists that my “bug” is not a bug at all. Are they right? [closed]
According to Wikipepdia,
A software bug is the common term used to describe an error, flaw, mistake, failure, or fault in a computer program or system that
produces an incorrect or unexpected ...
6
votes
4answers
341 views
Forgetting basic language functions due to use of IDE, over reliance? [closed]
Possible Duplicate:
Should newbies use IDE autocomplete (Intellisense)?
Is it wrong or bad to use autocomplete?
Having used an IDE for the last 3-4 years, the other day a few of my ...
33
votes
11answers
1k views
Is it a good practice to code in English? [closed]
Possible Duplicate:
Do people in non-English-speaking countries code in English?
I have a development comming that is intended to be sold across Latin America (Spanish speakers), but I've ...