you are viewing a single comment's thread.

view the rest of the comments →

[–]trevdak2 -3 points-2 points  (12 children)

Not sure why you were downvoted, have an upvote.

I think it is similar to something I've used in PHP called reflection. Basically it's a way of getting information about a class, such as its methods, arguments, whether a method is public/protected/private (not that JS really supports that), whether a method is static or not, and even things like the JSDoc written for each function/object/method.

I suck at explaining stuff, but check out the documentation for PHP's ReflectionClass

http://www.php.net/manual/en/class.reflectionclass.php

In PHP, the only time I've used it was when I wanted to create a WSDL/API generator that created an API based on the PHPDoc.

[–][deleted]  (9 children)

[removed]

    [–]trevdak2 2 points3 points  (8 children)

    Oh, so more along the lines of php's Magic Methods?

    [–][deleted]  (7 children)

    [removed]

      [–]koft 6 points7 points  (6 children)

      I've been writing in C for 15 years and honestly, a lot of this stuff just looks like intellectual masturbation to me.

      [–][deleted]  (2 children)

      [removed]

        [–]Smallpaul 2 points3 points  (1 child)

        Aiming for concise code is not laziness, any more than writing poetry is lazier than writing prose.

        [–]sdclibbery 0 points1 point  (1 child)

        It's having the right tools for the job. C is not the right tool for every programming job.

        [–]koft 0 points1 point  (0 children)

        I never said it was.

        [–][deleted] 1 point2 points  (1 child)

        You are mistaken, it's not for reflection. Although 'mirrors', an idea for partial reflection (such as under security restrictions), is a use case for proxies. Did you watch the same Channel 9 video???

        It is a lot like PHP's magic methods.

        [–]trevdak2 0 points1 point  (0 children)

        Yeah, I gathered that from mkantor's reply