boostorg / boostorg/json

Rename `json::parser::write` to `read`

Open
#1,103 8 comments 7 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
479
Forks
110
Avg merge
10d 3h
Merged PRs (30d)
5

Description

Naming `a::b` usually implies "a does b", e.g. `std::vector::push_back` means "vector pushes back". By definition, parser never writes, it only reads data so this method should be named `json::parser::read/consume/etc`.

`json::serializer::read` has the same problem, `obj.read(data, size)` means object reads data of given size, `serializer::read` actually *writes* some data into the given buffer. Don't know if there are other components with this problem.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.