New answers tagged

1

Demonstrate in your programming environment that you can read the result of the function call without a variable exactly as easy without the temporary variable. I'm using what I think is quite a good coding environment, and I can't. So demonstrate it. If you can, your colleague has learnt something. If you can't, you learned something.


-2

In case if you have further use of the particular result then you can store it into the variable. According to me, just for debugging purpose you should not use the extra variable. As according to coding standard it is not good practice to declare a variable which will not going to be useful in the future. In case, if you can remove that variable by your ...


1

The main purpose of standards and patterns is to improve the efficiency with which developers create and interact with code. They write code in a particular way, and expect to read code expressed in a particular way, and by doing this they reduce the amount of time spent evaluating how best to write code, and reduce the amount of time spent interpreting ...


4

This is where encapsulation pays off. If you have functionality that's encapsulated in a method or class, that's written in the old MFC style, and you instantiate or call it using new-style code, it will still work, won't it? You don't ever have to look at that old code unless you need to maintain it. Treat your old code like the black box that it's ...


0

You should use is or has keyword in prefix to show that it is a Boolean variable. So, according to me first and second variable names are preferable instead of other variables as it clearly shows the meaning of the variable. Some of the built-in boolean variable name are as follows: isalnum() isalpha() isdecimal() isdigit() isidentifier() islower() ...


0

Whether your limit is 80 or 100 or 120 characters, you will have cases exceeding it. But in most languages it is possible to split string literals over many lines. In C quite trivial: "This " "is " "a " "single " "string " "literal." If your editor does its own formatting, figure out how to write the code so its nicely formatted even after the editor tries ...


Top 50 recent answers are included