c89-style data/executable code segregation policy

Open
#6,971 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Refactor
Clarity
Needs clarification
Activity status
Stale
Tech stack
c
Domain
backend

Research direction

Start by reviewing the C declaration pattern shown in src/fread.c around line 2241 and compare it with the project's stated C language target. Before changing code, resolve whether the project wants a broad migration from c89-style segregation to c99 declarations; done would be an agreed policy followed consistently across the affected source.

Written by the indexing model from the issue text.

Description

code-quality

c89 requires data and executable code to be segregated, similar to assemblers like MASM.

It appears that a lot of code still uses similar patterns (albeit not at the beginning of the function), likely an artifact of an earlier language target before this project was updated to c99.

for example: https://github.com/Rdatatable/data.table/blob/master/src/fread.c#L2241

This can hamper readability, because objects are declared miles away from where they're actually used.

I know some people prefer this older style, so I wanted to get a vote of confidence before I started migrating to c99 syntax.

Dominant language
R
Stars
3.9k
Forks
1.1k
Avg merge
14h 4m
Merged PRs (30d)
4

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Rdatatable/data.table

All issues in Rdatatable/data.table

Similar issues

More R issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.