Tagged Questions
2
votes
2answers
210 views
Avoiding boilerplate in PHP classes
I am working on a PHP code and as it grows getting more and more tired of repeating the same standard pattern again and again and again:
class BolerPlate
{
protected $property1;
protected ...
1
vote
2answers
164 views
Any suggestions on how to over-rely on Google? [closed]
I don't know whether you Google a lot while you coding. I discover my coding practise always rely on Googling. One of the reason why is I don't familiar with the framework, So, I will do How to XXX in ...
7
votes
2answers
443 views
What does Uncle Bob mean by 'noun phrase names'?
I am reading Clean Code by Uncle Bob. Because I am not a native-English speaker, I couldn't understand following statement:
Classes and objects should have noun or noun phrase names like
...
62
votes
19answers
11k views
How important is it to reduce the number of lines in code?
I am a Software developer who works on J2SE (core java).
Often during our code reviews we are asked to reduce the number of lines in our code.
It's not about removing redundant code, it's about ...
4
votes
7answers
424 views
Should I spend time prettifying unit tests? [closed]
The company I used to work for before we had automated unit tests to test our work. However the coding standards and architecture was not very important for tests. Of course you had to indent code ...
3
votes
1answer
782 views
Why Doesn't Java Allow Default Parameters/Arguments [closed]
Basically something like
public void jumpToRoom(String roomName = Rooms.DEFAULT_ROOM)
would be convenient.
Many languages nowadays seem to support it (Ruby, PHP, even C#).
What is Java's ...
21
votes
8answers
1k views
Should comments say WHY the program is doing what it is doing? (opinion on a dictum by the inventor of Forth)
The often provocative Chuck Moore (inventor of the Forth language) gave the following advice (paraphrasing):
"Use comments sparingly. Programs are self-documenting, with a
modicum of help from ...
4
votes
2answers
246 views
What should my “large codebase sample” look like?
If an employer asks for a large code sample, one for an entire project, what characteristics should the project have to show architectural skills and the ability to manage a large codebase?
For ...
7
votes
7answers
1k views
Why would an employer ask for a 'long' code sample?
What would a large project that spanned multiple files and >1000 lines show to an employer that a few individual files and a couple hundred lines couldn't capture?
25
votes
9answers
2k views
Simple vs Complex (but performance efficient) solution - which one to choose and when?
I have been programming for a couple of years and have often found myself at a dilemma.
There are two solutions -
one is simple one i.e. simple approach, easier to understand and maintain. It ...
5
votes
4answers
380 views
Method flags as arguments or as member variables?
I think the title "Method flags as arguments or as member variables?" may be suboptimal, but as I'm missing any better terminology atm., here goes:
I'm currently trying to get my head around the ...
11
votes
9answers
845 views
Should a programmer take writing lessons to enhance code expressiveness?
Given that programmers are authors and write code to express abstract thoughts and concepts, and good code should be read by other programmers without difficulties and misunderstandings, should a ...
0
votes
4answers
246 views
Is 'Protection' an acceptable Java class name
This comes from a closed thread at stack overflow, where there are already some useful answers, though a commenter suggested I post here. I hope this is ok!
I'm trying my best to write good ...
1
vote
6answers
516 views
Setters or constructor for many variables? [duplicate]
Possible Duplicate:
Are there guidelines on how many parameters a function should accept?
I have got class with 30 variables (it is application form), so I wonder what is the best practice ...
2
votes
4answers
278 views
Create new variable or make multiple chained calls?
What is the best way to get this attributes, thinking in performance and code quality?
Using chained calls:
name = this.product.getStock().getItems().get(index).getName();
id = ...