mathworks / mathworks/MATLAB-Coding-Guidelines
Naming rules for struct/class/bus
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- Không có dữ liệu ngôn ngữ
- Star
- 139
- Fork
- 11
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
I noticed there isn’t yet an explicit guideline for struct names and, in particular, for struct field names. The only related reference I found, “Defining structs”, includes an example where the struct members use UpperCamelCase. Should these be UpperCamelCase? And if so, should the same convention apply to Simulink.Bus elements?
I’m asking because this can create a mismatch with some Model Advisor naming guidelines. For example, suppose I have a Simulink Inport of type Bus, with elements Signal1 and Signal2, which has been created from a MATLAB struct or class. If I use a Bus Selector to extract Signal1 and feed it into a MATLAB Function block, where the corresponding function parameter is named signal1 (lowerCamelCase, following MATLAB function parameter conventions), Model Advisor will trigger a violation because the bus element name (UpperCamelCase) doesn’t match the block input name (lowerCamelCase).
Is there any recommendations on how to harmonize these conventions?
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu bằng việc đọc hướng dẫn “Defining structs” hiện có và các quy tắc đặt tên của Model Advisor được tham chiếu trong issue. So sánh các quy ước cho trường struct và class trong MATLAB với các phần tử của Simulink.Bus, rồi ghi lại một khuyến nghị nhất quán để giải quyết sự không nhất quán về tên được mô tả giữa bus và MATLAB Function.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- matlab
- Lĩnh vực
- documentation
- Loại issue
- Tài liệu
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 35/100