Hacker Newsnew | past | comments | ask | show | jobs | submit | drk4's commentslogin

Mostly a frontend web developer, but with some backend and mobile experience as well. Looking for an interesting development position where I can do some cool stuff.

    Location: Portugal/Europe
    Remote: Yes
    Willing to relocate: Yes (within EU)
    Technologies: Typescript, javascript, react, swift, iOS, python, django
    Resume: via email
    Email: plferreira4@gmail.com
    Website/portfolio: https://nbpt.eu/ | https://bitbucket.org/drk4/


Also adding new APIs quickly means people end up using the browser just to play with them.


That looks like a lot of work to make a movie, all hand drawn.


It's an enormous amount of work.


This is the tragedy of it. They are trying so hard to only get the "best of the best" that the only way you can possibly be interested in that position and quality for it is by lying.


It tells what type of commit it is (a bug fix, a test related change, etc). Its not automated.


The string enums don't seem to work the same way as the number enums, there's no 2 way access.

For example.

enum Test { a } let a = Test.a; let b = Test[ 0 ]; // isn't available on the string ones

I wonder why its like that.


If there were a reverse map like for numeric enums, there'd be no way to (at runtime) distinguish a Name from a Value. With a numeric enum you can use typeof Test[x] to figure out if x was a valid Name or valid Value, but this doesn't work for string enums because they're both typeof == 'string'.


That seems like a much minor situation compared to not being able to reverse map.

You could have a situation where you have a string as a code, and then the display name for example, and you can't really do that as is now. This seems more useful than checking for the type (which in a numeric enum is either a number or string, so you would still need to do some work to properly validate it).


If you want to have the reverse map, you can trivially build it yourself. But if the reverse map did exist (rather, if the map started off as bidirectional, which is the only option on the table), it'd be impossible to properly construct the one-way map.


You mean because of using the same string for a key/value? I guess I see the potential problem. Anyway just think that it might be a bit confusing to have the enum work slightly different depending on whether its using numbers or strings. It can caught some people off guard.


Interestingly, 2.3 will spit out what you want (but error on the invalid syntax).

  var Test;
  (function (Test) {
      Test[Test["a"] = "RED"] = "a";
  })(Test || (Test = {}));
While 2.4 doesn't error out, but omits the inner assignment, thus not allowing the lookup.

  var Test;
  (function (Test) {
      Test["a"] = "RED";
  })(Test || (Test = {}));


What would be the use-case?


Its always a tough decision, either you make no changes but then have to live with a less than ideal situation, or make changes but forces everyone to update their code.

Personally I think its ok to make incompatible changes once and then, as long as its not too many changes in one go (like python3), its preferable than later on ending up with inconsistent or overly complex languages.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: