Proposal improve variable naming
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 30/100
- Issue 类型
- 功能
- 描述清晰度
- 需要澄清
- 活跃度
- 停滞
- 技术栈
- c
调研方向
首先审查 cJSON 结构以及 issue 中提议的名称。确定弃用现有字段并引入替代字段所涉及的完整公共 API 和兼容性范围。在确定实现范围之前,需要先达成一致的命名和迁移计划,才算完成。
由索引模型根据 Issue 内容生成。
描述
I used to be a big fan of short variable names, especially in the "short naming family," until I switched my IDE from legacy Turbo C/DOS to modern VSCode on Windows 7. Short, mixed-style naming is friendly to some auto-complete CLI tool or util, but it's terrible for spell checkers.
Proposal: Improve Variable Naming
Keep the original names but mark them as DEPRECATED in version 2.x.x. Introduce new, clearer names and promote them as the standard going forward. Here’s a pseudocode example:
/* The cJSON structure: */
typedef struct cJSON
{
/* next/prev allow you to walk array/object chains. Alternatively, use GetArraySize/GetArrayItem/GetObjectItem */
struct cJSON *next;
struct cJSON *prev;
/* An array or object item will have a child pointer pointing to a chain of the items in the array/object. */
struct cJSON *child;
/* The type of the item, as above. */
int type;
/* The item's string, if type == cJSON_String or type == cJSON_Raw */
/* Deprecated: use value_string instead. */
char *valuestring;
/* The value of value_string is the same as valuestring. */
char *value_string;
/* Writing to valueint is DEPRECATED. Use cJSON_SetNumberValue instead. */
int valueint;
/* The item's number, if type == cJSON_Number */
/* Deprecated: use value_double instead. */
double valuedouble;
double *value_double;
/* The item's name string, if this item is the child of, or is in the list of subitems of an object. */
char *string;
} cJSON;
- 主要语言
- C
- 星标
- 13k
- 派生
- 3.5k
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
DaveGamble/cJSON 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 86/100
DaveGamble/cJSON#1094 · 1 个 reaction ·
-
难度 2/5 1-3 小时 新手友好度 68/100
DaveGamble/cJSON#1093 ·
-
Use-after-free in cJSONUtils_ApplyPatches when a patch removes the patch array可能已有人在做 @iliasabk 于 20 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 82/100
DaveGamble/cJSON#1082 ·
-
Use-after-free in cJSON_ReplaceItemInObject when the key is the item's own name可能已有人在做 @iliasabk 于 22 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 82/100
DaveGamble/cJSON#1081 ·
-
buffer_skip_whitespace accepts every byte below 0x21 as whitespace可能已有人在做 @AetherAI3 于 33 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
DaveGamble/cJSON#1074 ·
相似的 Issue
-
IO.get_env on Node truncates names at embedded NUL可能已有人在做 @Yi-111-a 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 82/100
HigherOrderCO/Bend#1449 · 1 条评论 ·
-
难度 1/5 1 小时以内 新手友好度 88/100
FujiNetWIFI/fujinet-firmware#1872 ·
维护者通常 1 天内回复
-
bug C/C++ code
难度 2/5 1-3 小时 新手友好度 70/100
webarkit/WebARKitLib#84 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
OpenPrinting/cups#1751 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
obsproject/obs-studio#14013 ·
维护者通常 1 天内回复