4 ms·
You are grossly over-simplifying what this is doing. Nowhere does it say anything as simple as setting x to y. In nearly each case it takes the context of the v
by daveguy 4y ago
You are grossly over-simplifying what this is doing. Nowhere does it say anything as simple as setting x to y. In nearly each case it takes the context of the variables into account and states the meaning of the function calls, not the meaning of the syntax.
- hn_throwaway_99 4y agoYes, the examples I gave are gross over-simplifications. But look at the attached video. It literally just gives a 1-1 mapping of each code line to an English sentence, and that code is pretty trivial to understand in any case. I mean $data = file_get_contents(filename: 'php://input'); to "We're getting the raw request body" I still argue that developers should be able to read the raw code like that faster than turning it into an English sentence. I'm not saying the text generation isn't extremely impressive, I just don't think it's that useful.
- nextaccountic 4y ago> I just don't think it's that useful. Even for experienced developers, it is useful when navigating a new codebase (where you don't know what each API call does) or even a new programming language (where a particular construct may be unfamiliar like Rust's if let). Well supposing the tool is accurate (incorrect results may make the tool useless or harmful) But if you're discounting the usefulness for beginners I think this is a mistake. The experienced devs of tomorrow are the beginners of today.
- wingerlang 4y agoIronically your example would be a pretty great case for someone like me, who occasionally use PHP for fun but don't really use-use it. $data = file_get_contents(filename: 'php://input'); I would definitely have to google what this means, like why is it opening a file and how is 'php://input' a file? "We're getting the raw request body" Is actually a good explanation. So, someone new to a project, and maybe unfamiliar with the tech, might find this useful.