Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Proposal improve variable naming

未关闭
#970 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 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.

Image

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 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

DaveGamble/cJSON 的其他 Issue

查看 DaveGamble/cJSON 的全部 Issue

相似的 Issue

更多 C Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。