5 ms·
I find the `for` example really bad. Mainly because 99% of the apps (I totally made up that number) are NOTHING like that. You usually are using DI, so you'll
by luisrudge 11y ago
I find the `for` example really bad. Mainly because 99% of the apps (I totally made up that number) are NOTHING like that.
You usually are using DI, so you'll have an interface that you need to resolve and do stuff.
How is alive going to deal with that?
- Permit 11y agoThe examples shown are deliberately simple and meant to show off the concept. Alive isn't performing static analysis and guessing what your code is doing, it's compiling and running it while showing you the results. So as long as you have unit tests covering a piece of code, we can run those tests and show you what that piece of code does.
- ohitsdom 11y agoIt shows what the piece of code does in the unit tests? Or will it pull in the mock values used in the unit tests and show you their values on the actual code? And if there are multiple unit tests with different mock values, how does Alive pick which value to use?
- Permit 11y agoHere's an example on Newtonsoft.Json: https://www.youtube.com/watch?v=9AR1m3llrvg&feature=youtu.be https://www.youtube.com/watch?v=9AR1m3llrvg&feature=youtu.be And here's another on using tests with Alive: https://www.youtube.com/watch?v=qJgMqTTKPBg&feature=youtu.be https://www.youtube.com/watch?v=qJgMqTTKPBg&feature=youtu.be
- mattmanser 11y agoDo a lot of people use DI? I thought that was all a bit of a fad like factories. Lots of extra code for little benefit. Especially in a statically typed language like C# where it gets rid of so many of the benefits of using it as a language.
- jenscow 11y agoYep. You can't see the Emperor's clothes, either?
- wdmeldon 11y agoIn the .NET/Enterprise world, absolutely.
- briHass 11y agoHow does it remove anything beneficial? I look at DI, or really the dependency inversion pattern, as a guard that encourages better/more maintainable code. Can you write good code without it, sure, and you can write bad code with it, but it's much more likely that code written with it is easier to trace and maintain. Not to mention much easier to test. The configuration based, hot-swapping of dependencies...that I've never seen much need for even in larger projects.
- deleted 11y ago[deleted]
- briHass 11y agoSince this is a C# thread, there are a number of ways to navigate through the interface to the implementation in Visual Studio: 1. Right-click, Go To Implementation (Ctrl-F12) 2. Right-click, Find All References (shows the interface and impl) 3. (Resharper) Navigate, Dervived Symbols (Alt-End) Even the new method info in Visual Studio 2015 (2013 Enterprise) is able count and show you the usages as a tip through the interface. I don't experience any issues with this pattern; the tooling is built around it.
- rjbwork 11y ago4. There's a plugin for ReSharper called Agent Mulder that examines your AutoFac configuration and knows when something is registered and can take you right to it.
- yareally 11y ago
- JamesUtah07 11y agoI agree if it had examples and support for the IEnumerable 'where', 'Select', etc and foreach loops I'd easily through down the $100 for myself but I just don't write many 'for' loops anymore
- amadeusw 11y agoThanks! That's a good point. We will use IEnumerable and LINQ in the next example that we'll make