Readability problems

2021-11-15 Thread Araq
Too many harsh words, I'm closing this thread.

Readability problems

2021-11-14 Thread haxscramper
Well, it is a domain-specific language for parsing text, so if you are _not_ familiar with the subject it will look unreadable, but at the same time it is still much easier to write and maintain compared to dozens of handwritten loops, checks and conditions like `if str[idx] == '='`.

Readability problems

2021-11-14 Thread carterza
I don't even know how to reply to this honestly... Your JSON fetish isn't shared by everyone. Yes I have maintained code I wrote years ago - I do it all the time at work. I also maintain code other people wrote years ago. I see little point to your argument. I think you have a very narrow

Readability problems

2021-11-14 Thread carterza
This is a pretty ridiculous claim and I think the only place where this even comes close to being true is in the web development world. Nim is a systems programming language, or at least it's supposed to be. It is not supposed to be NodeJS or whatever your favorite web framework is. I don't

Readability problems

2021-11-14 Thread SolitudeSF
le industry experience has arrived

Readability problems

2021-11-14 Thread xigoi
Macros make code much easier to read. Consider this example from npeg: let parser = peg("pairs", d: Dict): pairs <- pair * *(',' * pair) * !1 word <- +Alpha number <- +Digit pair <- >word * '=' * >number: d[$1] = parseInt($2) Run Imagine

Readability problems

2021-11-13 Thread auxym
Eh, python did it for urllib. Though python I'd probably a bad model to follow for version transitions.

Readability problems

2021-11-13 Thread jackhftang
Strictly speaking, the `proc` that convert any type to `JsonNode` is named `%`, not `%*`. `%*` is a macro that let you write inline json in a nature way. Alternatively, you can write like this. import json let j1 = {"j": %10,"s": %20,"o": %100,"n": %5000} echo %j1

Readability problems

2021-11-12 Thread xigoi
Templates are literally C `#define`, but without all the pitfalls and consistent with the rest of the language.

Readability problems

2021-11-12 Thread bpr
> But it is VERY useful to have JSON in stdlib, Yeah, the **std** namespace is precious, and no one wants to see `json2`, `json3`, etc. You can't make an omelette without breaking a few eggs.

Readability problems

2021-11-12 Thread juancarlospaco
But it is VERY useful to have JSON in stdlib, I would rater deprecate less used stuff like `std/logic` or `std/inotify`...

Readability problems

2021-11-12 Thread Araq
> Then its time to Fix it, even if it means breaking changes... No need to break anything, deprecate the module and link to an alternative, recommended package.

Readability problems

2021-11-12 Thread juancarlospaco
> Almost nothing in json.nim aged too well. :-) Then its time to Fix it, even if it means breaking changes...

Readability problems

2021-11-12 Thread Niminem
Templates are IMO the simplest form of metaprogramming in Nim as it's just code substitution. If you're concerned with debugging you can add an extra piece of complile-time logic into the templates that only executes / gets put into the resulting binary when you define something like

Readability problems

2021-11-12 Thread PMunch
> Which is obviously unreadable and very easy to forget what it means. Not really, once you know what it means it's quite readable, but it requires that you familiarize yourself with the tools you're using. Besides, when you see something that looks suspiciously much like json with some

Readability problems

2021-11-12 Thread SolitudeSF
yes. `template json*(t): JsonNode = %* t` badabing, crisis averted.

Readability problems

2021-11-12 Thread Araq
Almost nothing in `json.nim` aged too well. :-) The idea back then was "toJson is more common than modulo, so I'd rather use % for that operation". But `%` only worked on simple values (integers, values), so in order to turn "anything" you would use `%*` which read like "%/toJson but