Re: Re: What do you think about a C# 6 like nameof() expression for

2019-06-14 Thread Stas Berkov
guest271314, what is you point against `nameof` feature? If you don't like it - don't use it. Why prohibit this feature for those who find it beneficial? I see `nameof` beneficial in following cases Case 1. Function guard. ``` function func1(options) { ... if (options.userName == undefined)

Re: Re: What do you think about a C# 6 like nameof() expression for

2019-06-14 Thread Stas Berkov
14, 2019 at 9:48 PM Stas Berkov wrote: > Less fragile. Less mess. You can rename field/property without fear you > break something (using IDE refactoring tools). > With high probablity you will break something when you refactor and have > fields hardcoded as strings. > Someone can obj

Re: Re: What do you think about a C# 6 like nameof() expression for

2019-06-14 Thread Stas Berkov
You get more robust code. > > How is "robust" objectively determined? > > > > > On Fri, Jun 14, 2019 at 5:21 PM Stas Berkov wrote: > >> ES can befit from `nameof` feature the same way as TS. There is no TS >> specific in it. >> It was ask

Re: Re: What do you think about a C# 6 like nameof() expression for

2019-06-14 Thread Stas Berkov
anguages, most of the use cases don't apply to dynamic > Javascript > The only legit use case I can think of is helping refactor tools to > rename properties (but even mismatch errors between strings and > properties names can be caught in compile time using modern > Typescript) >

Re: Re: What do you think about a C# 6 like nameof() expression for

2019-06-14 Thread Stas Berkov
Can we revisit this issue? In C# there is `nameof`, in Swift you can do the same by calling ``` let keyPath = \Person.mother.firstName NSPredicate(format: "%K == %@", keyPath, "Andrew") ``` Let's introduce `nameof` in ES, please. Devs from TypeScript don't want to introduce this feature

[AngularJS] Re: [angular.js] Re: Save Angular View as HTML file

2014-03-24 Thread Stas Berkov
And how to save computed CSS styles? document.html() will give you just html, computed CSS styles will be lost. On Wednesday, April 25, 2012 8:50:54 AM UTC+4, Misko Hevery wrote: We have not done this, but if you feel up to it here is what you can try 1. get node.js running 2.

[protobuf] repeated field naming style: singular or plural

2013-07-02 Thread Stas Berkov
Hi, when I use 'repeated' keyword in protobuf messages what form should I use: plural or singular? E.g. I have message message RealTimeMarketData { // client side subscription identifier required int32 Id = 1; // contract ID assigned by server required int32 contractId = 2; // new contract