Pattern docs can be improved
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 25/100
- issue の種類
- ドキュメント
- 明瞭さ
- 説明が足りない
- 活発さ
- 停滞
- 技術スタック
- csharp
調査の方向性
issue に記載された samples\csharp\tutorials\patterns 配下のパス、特に start\toll-calculator.csproj、finished\toll_calculator.csproj、ExternalSystems.cs を確認します。まず start と finished のプロジェクトをビルドして、報告されたプロジェクトおよびコンパイルの問題を再現します。提案されたドキュメントとサンプルコードの変更について合意したサブセットが完了し、影響を受けるプロジェクトが正常にビルドできれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Pattern docs at samples\csharp\tutorials\patterns can be improved ...
- the samples\csharp\tutorials\patterns\start\toll-calculator.csproj does not compile without TollCalculator implementation
- attempting to add samples\csharp\tutorials\patterns\finished\toll_calculator.csproj as shared project fails with duplicate project names
- changing project names [e.g. to Toll-start.csproj, Toll-finished.csproj] complains due to conflicting ExternalSystems
- classes in ExternalSystems.cs should have default properties or marked required [e.g. otherwise new DeliveryTruck() inits GrossWeightClass=0 !]
although better to have explicit ctors with initializer for all props [maybe derive from external source to enforce] - should be simplified to "public static class TollCalculator{..}" so don't need concrete tollCalc instance
- CalculateToll parameter should be nullable [i.e. public decimal CalculateToll(object? vehicle) => ...], and change calls from null! to null.
- perhaps fullVan and fullVanPool should be fullCar and fullTaxi respectively ("full van" a peculiarly American phrase)
also "GrossWeightClass" -> "GrossWeight" since unit is lbs as int - code is littered with magic numbers (e.g. variously as 2.00m or 2.0m) when should instead be defined in ONE place (e.g. as const decimal CarFare=2.00m)
- "The null pattern can be last because the other patterns match only a non-null object of the correct type." is non-optimal
in switch expression the null check should happen once [first] otherwise each "is" typecast would have to perform its own null guard compare - inefficient switch arms in CalculateToll for Bus, DeliveryTruck [repeated typecast executions]
- final (catch-all) arm [discard pattern] can be simplified to _ => [e.g. not (_, _, _)]
- IsWeekDay can be simplified
- PeakTimePremiumIfElse compares hour < 20 whereas GetTimeBand uses > 19 [needs more brain cycles to verify equivalence]
- need more vehicle types and/or catch-all [can't just declare unknown!]. e.g. see NYC CRZ at https://congestionreliefzone.mta.info/tolling
practical to accurately assess GrossWeightClass without an actual weighbridge stop ? - unnecessary subfolder hierarchy [e.g. simplify start/toll-calculator/* to start-calculator/*]
- should update TFM [i.e. "net6.0" to "net8.0"] on all projects
I am in process of crafting a PR to suggest how I think docs and sample code should look.
- 主要言語
- C#
- スター
- 3.7k
- フォーク
- 5.1k
- 平均マージ
- 19時間 47分
- マージ済み PR(30日)
- 2
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
dotnet/samples のほかの issue
-
dotnet-target-version
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
-
dotnet-target-version
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
-
dotnet-target-version
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
Race condition in orleans/ShoppingCart/Grains/InventoryGrain.cs#L48対応中かも @TimonPasslick が 160 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
dotnet-target-version
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
似ている issue
-
Audit by ear: boss warnings, other not-enough messages, ailments and barriers in a chapter 1 battleオープンenhancement needs-game ready-for-agent
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
Sour-Dev-Home/metaphor-accessibility#1273 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
joinrpg/joinrpg-net#6336 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
muxinc/mux-csharp#88 ·
-
In-car displays show 0 km/h and P while the AV drives対応中かも @bazilinskyy が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
bazilinskyy/coupled-sim#366 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 3 日以内に返信