How better to introduce users to custom types?
- Dominant language
- Bicep
- Stars
- 3.6k
- Forks
- 830
- Avg merge
- 1d 21m
- Merged PRs (30d)
- 79
Description
I've been finding custom types SUPER helpful for writing more modular code. However, there's nothing really pointing me towards using them - I'm just using them because I know they exist.
There are a lot of sample bicep files out there without usage, because they're a more recent feature. I suspect there are a lot of users who don't realize how much benefit they'd get from using them.
This issue is more intended for brain-storming rather than suggesting a specific solution.
Some patterns I see where custom types would help:
1. Untyped objects/arrays (this one is kinda obvious):
```bicep
param foo object
var usage1 = foo.bar
var usage2 = foo.baz
```
Could be better written as:
```bicep
param foo { bar: baz: }
var usage1 = foo.bar
var usage2 = foo.baz
```
2. A sea of logically grouped parameters:
```bicep
param imageName string
param imageTag string
param imageRegistry string
```
Could be better written as:
```bicep
param image { name: string, tag: string, registry: string }
```
3. ??? feel free to add others
Some ideas to raise visibility (feel free to add to this list):
```[tasklist]
### Ideas
- [ ] #14765
- [ ] #14767
- [ ] #14768
- [ ] https://github.com/Azure/bicep/issues/14775
- [ ] https://github.com/Azure/bicep/issues/14814
```
Contributor guide
Research direction
Start by reviewing the custom-type usage examples and the related issues listed in the task list, including #14765, #14767, #14768, #14775, and #14814. Done would require an agreed, concrete way to introduce users to custom types rather than further brainstorming.
Written by the indexing model from the issue text.
Assessment
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100