Tag Info

New answers tagged

0

What if you auto-generate the file which contains the table declaration? Since it is auto-generated, you never need to diff that legible file itself. Diffing the input file will show only truly changed lines, since you will never reformat the input file to make it more legible. Q.E.D :-)


2

If you look at the version control diff, it's nearly impossible to see what was added as whole table has been rewritten Then don't look at the version control diff. For instance WinMerge, which is free & runs on both Windows & Linux has an option " Line differences with Whitespace: Ignoring all". Couldn't you use that? It won't show those ...


2

One possible kludge which would allow you to keep you change history but align your code correctly would be to comment out the entire existing table. And add a new correctly aligned table after it. This would/should be recorded as just two changes in the source code. After the new table been saved in the repository you can delete the commented out section ...


0

This is what I generally stick to. The main purpose, in my opinion, of having a separate css file is that it may be shared among multiple pages, which may use the styles in different ways. By using css classes instead of IDs, it is less restrictive, letting you not worry about duplicate IDs, while the lower specificity allows easier customisation of the ...


0

One way to handle these is to have factory functions: expected<Missile> Missile::Create(Params...) expected<unique_ptr<Missile>> Missile::Create(Params...) class Missile { private: Missile() = default; int Initialize(int power) // second phase constructor { // other operations (besides out_of_memory) that may fail // can ...


3

Default c++ constructors should be avoided if that means leaving object in a partially constructed place. This is obvious a good advice but things get complicated when you also disallow exceptions (as it does) Not necessarily. Consider these rules: a constructor should receive already validated arguments, and perform no operations outside of ...


7

Mandatory disclaimers (1) Because people who have seen the code can't say anything about it, and people who can freely comment on it have never seen the actual code, all we can do here is to speculate, speculate, and to speculate. Therefore, here is not an answer, just a speculation. (2) This is not the typical way I write C++ because most of the projects ...



Top 50 recent answers are included