Wednesday, January 30, 2019

Visual Studio resources editing support

When you copy-paste .resx resources between projects, mind VS features. Rename copied .resx file to let VS properly fill internals.


VS generates namespace according to folders structure. For case above, it will be TOMEs.Database.Migrations.Migrations._20190128144800.Resources

Don't worry that resource satellite assembly will go to, e.g. TOMEs.Database.Migrations\bin\Debug\cs-CZ\TOMEs.Database.Migrations.resources.dll

Use matching full type name as single constructor parameter for System.Resources.ResourceManager and it will work. Don't try to fool VS by manually editing Designer.cs and substituting some "logically matching" namespaces similar to project from you copied resources.

Saturday, January 12, 2019

Guys upper in development hierarchy may don't hear you. Especially if you say nothing.

After some project kinda failed, I decided to save some impressions that I consider important about problems I consider evident:
- Fuck unit tests. It's bullshit on most applied projects, especially if same "high quality coding standards" are applied to tests as for app code. If you deal with science,calculations or at least accounting - create tests, use TDD or whatever. It's obvious for amounts of data or operations unsuitable for manual testing. Otherwise, spending time on manual functional testing is much more useful. And of course, autotests and integration tests are much more useful at least for smoke testing when you don't need 1.5x+ amount of code to cover by smoke and 20x for kinda functional unit testing that looks like documenting. If someone has documented reason for change, he'll just change broken tests too.
- Fuck perfectionism. Remember that while you are trying to make code beautiful, others compete with you having working production nevertheless it's pile of sticks and shit. Actually, inspite of all time-consuming efforts in some time you'll understand that your codebase is same pile of sticks and shit. Is it really possible that customer will order codebase audit? You will never got to this phase if major UI bugs are not fixed for months - customer sees UI 1st.
- Heavily enforce standard approaches, knowledge sharing, commenting and responsibility areas. The less are exceptions from rules the easier are they to follow. Collective code ownership is another bullshit. People are rarely hit by buses, and vacations are short.
- Test on approximately real data. Test early. If there is paging on UI, test it immediately and don't wait when someone manually submit enough data for 2nd+ page to appear. You should not refactor or reimplement after separate perfomance testing on project mature stage. Do things right way initially.
- Remember about probabilities. Many arguments for "better" design starts with "if". Refactor if this "if" happens. Mind schedule and don't do things in advance.