Skip to content

[RFC]: add string/base/slice-code-points #34

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
kgryte opened this issue Feb 14, 2025 · 3 comments · Fixed by stdlib-js/stdlib#5414
Closed

[RFC]: add string/base/slice-code-points #34

kgryte opened this issue Feb 14, 2025 · 3 comments · Fixed by stdlib-js/stdlib#5414
Assignees
Labels
difficulty: 2 May require some initial design or R&D, but should be straightforward to resolve and/or implement. estimate: 2-4hrs Task which should take between 2 to 4 hours. Feature Task to add a new feature.

Comments

@kgryte
Copy link
Member

kgryte commented Feb 14, 2025

This task should implement a functional API for slicing a string based on Unicode code points.

The behavior should not match the built-in String.prototype.slice, as the function should properly handle surrogate pairs. All arguments should be required:

sliceCodePoints( str, start, end )

Related: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/string/base/for-each-code-point

Time estimate without AI: 4hrs
Time estimate with AI: 2-3hrs

@kgryte kgryte added difficulty: 2 May require some initial design or R&D, but should be straightforward to resolve and/or implement. estimate: 2-4hrs Task which should take between 2 to 4 hours. Feature Task to add a new feature. labels Feb 14, 2025
@naterush naterush added the 🤖 AI Allowed to use AI. label Feb 17, 2025
@headlessNode
Copy link
Member

headlessNode commented Feb 24, 2025

PR: stdlib-js/stdlib#5414
Time till opening PR: 1hr 44 mins
AI Model: Claude 3.5 sonnet
Loom Recording: Link

@headlessNode
Copy link
Member

headlessNode commented Feb 24, 2025

Notes:

  • Cursor performed exceptionally well on this task. The main function implementation was completed in about 40-45mins. Rest of the time spent was on writing appropriate tests, benchmarks and documentation.

  • The reason for Cursor's performance on this task, in my opinion, was because:

    1. I used a detailed prompt explaining the functions' behavior.
    2. For codebase context various functions with similar logic were also available.
    3. The function signature was simple, due to which there were no issues with typescript declarations unlike other functions with complex signatures.

@naterush naterush added ❌ No AI Not allowed to use AI. and removed 🤖 AI Allowed to use AI. ❌ No AI Not allowed to use AI. labels Feb 26, 2025
@headlessNode
Copy link
Member

Post PR Review Notes:

  • A couple of refactors were made based on code review. Nothing major.

  • Additional time spent: 4 mins.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty: 2 May require some initial design or R&D, but should be straightforward to resolve and/or implement. estimate: 2-4hrs Task which should take between 2 to 4 hours. Feature Task to add a new feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants