3 ms·
I agree, it wouldn't be the best to handle all json edge cases, but it would be a super easy way to quickly get data from a big chunk of simple json and you cou
by jjeaff 3y ago
I agree, it wouldn't be the best to handle all json edge cases, but it would be a super easy way to quickly get data from a big chunk of simple json and you could just use subqueries or query chaining for nested results.
For anyone who hasn't used powershell, this is the difference I'm talking about. I would not be able to write either of these without looking up the syntax. But knowing very little about powershell, I can tell exactly what that command means while the bash command, not so much.
```powershell
$json | ConvertFrom-Json | Select-Object -ExpandProperty x
```
```bash
echo $json | jq '.x'
```
- deredede 3y agoOn the other hand, I find the bash one clear and concise. That PowerShell example is so verbose, it'd drive me crazy to do any sort of complex manipulation this way! To each their own, I guess.
- jjeaff 3y agoIf all I was doing is writing code, I agree. But like most developers, I think I read a lot more code than I write.