Update code_style_guideline.md for methods and arguments
Objective:
The goal of this pull request is to standardize Trendyol's coding style guide, improving code readability, consistency, and collaboration. Inspired by industry leaders like Airbnb and Apple's Swift Style Guide, and with Kodeco Style Guide as a starting point, we aim to create customized guidelines for Trendyol's unique needs. It's important to note that many selections closely align with Kodeco's template, serving as our initial framework. Some changes may not be immediately apparent, as our comparisons initially involved Airbnb and Swift Style Guide before incorporation into the template.
Comparison and Selection:
The proposed changes primarily focus on modifying the "Methods and Arguments" section of our coding style guide. These modifications have been carefully curated by considering best practices outlined in Airbnb and Apple's Swift Style Guide, while also incorporating elements that align specifically with Trendyol's development philosophy.
Methods and Arguments:
-
Omitting Unused Parameters:
- Aligns with both Airbnb and Kodeco, fostering brevity and clarity in function signatures.
-
Void Return Types:
- Both Airbnb and Kodeco advocate for omitting
Voidreturn types, contributing to cleaner function definitions.
- Both Airbnb and Kodeco advocate for omitting
-
Function Invocation Breaks:
- Shared agreement with Airbnb to break long function invocations for improved readability.
-
Parameter Naming:
- Adopts Apple's recommendation to name variables based on roles for enhanced clarity.
-
Method Naming:
- Combines Apple's preference for grammatical English phrases with Airbnb's emphasis on "make" for factory methods.
-
Defaulted Parameters:
- Merges Apple's suggestion to use defaulted parameters for common use cases with Kodeco's emphasis on locating them at the end of the parameter list.
-
Label Usage:
- Agrees with Airbnb and Kodeco on omitting labels when distinctions are unnecessary and using them for clarity in prepositional phrases.
File Organization:
To maintain a well-organized and easily navigable style guide, the document includes strategically placed spoiler areas. This intentional structuring ensures that each section is readily accessible, aligning seamlessly with Trendyol's coding environment.