Thoughts on C# 7.0 Local Functions. Potential Features - Local Functions Frankly, when I first tried this, I thought that it's just a nice and compact way of defining local helpers. In fact, it's much more interesting and useful feature. Today I'm going to explore and explain it in more details. Let's start with a brief overview of the current situation. Before Local Functions Private methods The first option that existed in C# 1 is having a private method. That’s a clean and simple solution. It has few issues, though. PrintMe might have no sense outside of ThatTime method, but it’s accessible for every other method inside the class. It will be taken into account by IntelliSense. Func and Action We can try to hide our helper inside the scope of ThatTime method by converting it to Func<int, string>: Any disadvantages ?? Yep, a lot. The call is unnecessary expensive: it will produce more ...
Having worked on and with AngularJS for short period thou , here are some of the time-saving tips at the top of my mind , Just go ahead and comment out if you find it wrong or if you have any : At a high / architecture level: 1) Write your tests ! - Stop, right now.I mean it !!!. ;) Don't Ever go by this Saying !!! You can never be 100% right Always write your unit tests. In Javascript, you don't have the compiler to hand hold you and tell you did something wrong. And you will want to pull your hair out the next time your app is broken because of a missing letter.And the larger your application gets, having the comfort of making large scale changes and refactorings without worrying about broken functionality is amazing! And writing your unit tests is the only way to get there! 2) Don't put too many things on the scope . The scope is expensive, as it is the one that undergoes dirty checks. Just put exactly what will be di...
Must Read before Reading this Post : Some of the time-saving tips every AngularJS user should know !! - Part 1 . As Discussed in Earlier post ,It was all about High/Architecture level Tips . Let's go through some Low-Level thoughts. At a Low-Level Thoughts/Tips/Gotchas: 1) Learn and love your console logs - Sometimes, especially with the digest cycles and angular lifecycle, it's sometimes easier to print your debugs to a console.logs instead of adding breakpoints. It's faster! 2) Get Batarang , the chrome extension - That is by far the best way to get into the bowels of AngularJS, and some of the details it provides (performance, dependencies) will make your life super simple and easy 3) Start running your unit tests on every save - It will do the work of the compiler, and next time you break any functionality, you can fix it with a simple Undo in your IDE 4) Use the [] notation for listing your dependencies -...
Comments
Post a Comment