Tier 1
Series 5
5B: The List Launchpad
"A hangar needs to be flexible. Some days you have two drones; some days you have twenty. If you try to force a variable number of aircraft into a fixed-size Array, your system will crash when the twenty-first drone arrives. A skilled Engineer audits for List Flexibility, but watches the Memory Tax."
The Concept: The Dynamic List
A List is a dynamic container. Unlike an Array, it can grow or shrink at runtime as you add or remove items. This makes it the perfect "Launchpad" for mission objectives, active enemies, or inventory items.
Dynamic Content: Use Lists for collections where you don't know the final count in advance (e.g., picking up items).
The Reallocation Tax: When a List grows beyond its capacity, the computer has to create a new, larger "parking lot" and move everything over. This can cause tiny performance hitches.
Capacity Optimization: If you know you'll roughly have 100 items, tell the computer early: new List(100).
Dynamic Content: Use Lists for collections where you don't know the final count in advance (e.g., picking up items).
The Reallocation Tax: When a List grows beyond its capacity, the computer has to create a new, larger "parking lot" and move everything over. This can cause tiny performance hitches.
Capacity Optimization: If you know you'll roughly have 100 items, tell the computer early: new List
Red Flag Detected
The AI Trap: "The Rigid Overflower"
You ask the AI: "Keep track of every objective the player completes."
// AI-Generated Code: Dangerously Rigid
public string[] completedObjectives = new string[5];
void FinishTask(string name) {
// Audit Fail: If the player finishes 6 tasks,
// the system will throw an 'IndexOutOfRangeException' and crash!
completedObjectives[currentIndex] = name;
currentIndex++;
}
This is "Logic Fragility". Hardcoding a maximum limit on player progress is a recipe for a mission-ending crash. A professional pilot demands a List that can expand as the mission evolves.
Elite Telemetry
Research shows "Elite" teams achieve 15% faster lead times by keeping AI on a "very tight leash."
- Small Batches Solving one problem at a time prevents logic drift.
- Modular Design Localizing the "blast radius" of AI changes.
- Tight Loops Rapid iteration with constant code review.
The Mechanic's Correction
Corrective Protocol
// Corrected: Flexible and safe.
private List<string> completedObjectives = new List<string>();
void FinishTask(string name) {
// The List handles the 'parking space' management automatically.
completedObjectives.Add(name);
}
Your Pilot Command
> Use a Compute Shader for massive parallel vertex manipulation.