Skip to content

Improve variable and function name descriptiveness across backend and frontend#59

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/suggest-more-descriptive-names
Draft

Improve variable and function name descriptiveness across backend and frontend#59
Copilot wants to merge 2 commits intomainfrom
copilot/suggest-more-descriptive-names

Conversation

Copy link
Contributor

Copilot AI commented Mar 16, 2026

Generic and abbreviated names (result, e, el, submitBtn) throughout controllers, middleware, and JS event handlers reduce readability and make intent unclear at a glance.

Backend (C#)

  • Controllers — replaced generic result with type-intent names:
    • pagedStudents, pagedCourses, pagedRegistrations for paged query returns
    • isStudentDeleted, isCourseDeleted, isRegistrationCancelled for boolean returns
  • Repository.csresultaddedEntityEntry (EF EntityEntry<T>)
  • AdminAccessChecker.csresultadminValidationResult
  • ExceptionHandlingMiddleware.csresponsehttpResponse, errorResponseapiErrorResponse, jsonOptionscamelCaseJsonOptions

Frontend (JavaScript)

  • submitBtnsubmitButton
  • Single-letter event params e → context-specific names: inputEvent, keyboardEvent, clickEvent, submitEvent
  • el in forEach callbacks → errorElement / inputElement
// Before
document.addEventListener('keydown', function(e) {
    if (e.key === 'Escape') { ... }
});
errorElements.forEach(el => el.textContent = '');

// After
document.addEventListener('keydown', function(keyboardEvent) {
    if (keyboardEvent.key === 'Escape') { ... }
});
errorElements.forEach(errorElement => errorElement.textContent = '');

💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.

…dability

Co-authored-by: Hemavathi15sg <224925058+Hemavathi15sg@users.noreply.github.com>
Copilot AI changed the title [WIP] Refactor variable and function names for clarity Improve variable and function name descriptiveness across backend and frontend Mar 16, 2026
Copilot AI requested a review from Hemavathi15sg March 16, 2026 05:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants