Asking the same question to SWE-1 by Windsurf, Claude 3.7 Sonnet thinking, openAI and Gemini 2.5, I’d like o assess and compare these three LLMs.
The question is generic and simple “if i want to build up a codebase for garage parking system, please sketch our blueprint md file first, then write out codes”
SWE just sketched the blue print md file. system overview, core components including parking lot management, vehicle management, user management, billing and payments, reporting and analytics, then technical stack include backend, frontend and infrastructure, then database schema has tables for users, vehicles, parking spots, bookings, transactions and rates, then API end point. Implementation plan include phase 1 to come up with core functionality, phase 2 is user interface, phase 3 is advanced features, security considerations include JWT for authentication, password hashing, input validation, rate limiting and CORS configuration. Lastly testing and deployment.
OpenAI LLM sketching a blueprint for your Garage Parking System in a README.md or blueprint.md style file. The structure is relatively more straightforward with advanced features left for further actions. It also provides two options CLI and Web GUI. I opted for CLI and then it went ahead to write codes:
garage-parking-system/
│
├── app/
│ ├── main.py # Entry point
│ ├── parking_lot.py # Core logic: slots, status
│ ├── gate_entry.py # Handles vehicle entry
│ ├── gate_exit.py # Handles vehicle exit
│ ├── billing.py # Payment calculation
│ ├── models.py # Data models (Vehicle, Ticket)
│ └── utils.py # Helper functions
│
├── tests/ # Unit tests
│ └── test_parking_lot.py
│
├── db/
│ └── database.json # JSON/SQLite DB for state (temporary)
│
├── README.md
└── blueprint.md # This file
the CLI main py is
# garage-parking-system/app/main.py
from gate_entry import handle_vehicle_entry
from gate_exit import handle_vehicle_exit
from parking_lot import ParkingLot
def main():
parking_lot = ParkingLot(capacity=10)
while True:
print("\n=== Garage Parking System ===")
print("1. Vehicle Entry")
print("2. Vehicle Exit")
print("3. Show Parking Status")
print("4. Exit Program")
choice = input("Select an option: ")
if choice == '1':
handle_vehicle_entry(parking_lot)
elif choice == '2':
handle_vehicle_exit(parking_lot)
elif choice == '3':
parking_lot.display_status()
elif choice == '4':
print("Exiting system...")
break
else:
print("Invalid choice. Try again.")
if __name__ == "__main__":
main()
Then simple codes for models.py handles veehicle and ticket, parking_lot.py handles slots, billing.py and gate_entry.py.
Gemini seems provides the best version, Core Modules
2.1. ParkingLot Module
- Description: Manages the overall parking lot, including its layout, total spaces, and current availability.
- Key Responsibilities:
- Initialize parking spaces (e.g., small, medium, large).
- Track occupied and available spots.
- Assign parking spots to arriving vehicles.
- Release parking spots when vehicles depart.
- Calculate parking fees.
- Key Data Structures:
- List/Dictionary of
ParkingSpaceobjects. - Occupancy map.
- List/Dictionary of
2.2. Vehicle Module
- Description: Represents different types of vehicles that will use the parking system.
- Key Responsibilities:
- Store vehicle attributes (e.g., license plate, type – car, motorcycle, truck).
- Track entry and exit times.
- Key Data Structures:
- Vehicle object with properties.
2.3. ParkingSpace Module
- Description: Represents individual parking spots within the lot.
- Key Responsibilities:
- Define space attributes (e.g., size, ID, occupied status).
- Key Data Structures:
- Parking space object with properties.
2.4. Ticket Module
- Description: Generates and manages parking tickets.
- Key Responsibilities:
- Issue new tickets upon entry.
- Store entry time, vehicle ID, and assigned space.
- Retrieve ticket information for payment and exit.
- Key Data Structures:
- Ticket object with relevant details.
2.5. Payment Module
Rate configuration.
Description: Handles fee calculation and payment processing.
Key Responsibilities:
Calculate duration based on entry/exit times.
Apply parking rates.
Process various payment methods (e.g., credit card, cash – for future extension).
Key Data Structures:
3. Key Functionalities
3.1. Vehicle Entry
- Detect vehicle arrival.
- Assign suitable parking space.
- Generate and issue a parking ticket.
- Update parking lot occupancy.
3.2. Vehicle Exit
- Scan/Input ticket details.
- Calculate parking duration and fee.
- Process payment.
- Release parking space.
- Update parking lot occupancy.
3.3. Parking Lot Management
- Display available spaces.
- View occupied spaces.
- Manage parking rates.
4. Technology Stack (Initial Thoughts)
- Language: Python
- Database (Optional for initial sketch): SQLite for persistent data storage
- User Interface (Future): Command-line interface initially, potentially a web-based UI later.
5. Future Enhancements
- Integration with external payment gateways.
- Real-time occupancy display.
- Pre-booking parking spaces.
- Automatic license plate recognition (ALPR).
- Analytics and reporting.
Initial Code Sketches
Here are some basic Python classes representing the core components outlined in the blueprint.
import datetime
# --- 1. ParkingSpace Module ---
class ParkingSpace:
def __init__(self, space_id: str, size: str):
"""
Initializes a parking space.
Args:
space_id (str): Unique identifier for the parking space (e.g., "A01", "B-small-05").
size (str): The size of the parking space (e.g., "small", "medium", "large").
"""
self.space_id = space_id
self.size = size
self.is_occupied = False
self.vehicle_parked = None # Stores the Vehicle object if occupied
def occupy(self, vehicle):
"""Occupies the parking space with a vehicle."""
if not self.is_occupied:
self.is_occupied = True
self.vehicle_parked = vehicle
print(f"Space {self.space_id} ({self.size}) occupied by {vehicle.license_plate}.")
return True
else:
print(f"Space {self.space_id} is already occupied.")
return False
def release(self):
"""Releases the parking space."""
if self.is_occupied:
vehicle_license = self.vehicle_parked.license_plate if self.vehicle_parked else "unknown"
self.is_occupied = False
self.vehicle_parked = None
print(f"Space {self.space_id} ({self.size}) released (previously by {vehicle_license}).")
return True
else:
print(f"Space {self.space_id} is already empty.")
return False
def __str__(self):
status = "Occupied" if self.is_occupied else "Available"
vehicle_info = f" ({self.vehicle_parked.license_plate})" if self.vehicle_parked else ""
return f"Space ID: {self.space_id}, Size: {self.size}, Status: {status}{vehicle_info}"
# --- 2. Vehicle Module ---
class Vehicle:
def __init__(self, license_plate: str, vehicle_type: str):
"""
Initializes a vehicle.
Args:
license_plate (str): The vehicle's unique license plate number.
vehicle_type (str): The type of vehicle (e.g., "car", "motorcycle", "truck").
"""
self.license_plate = license_plate
self.vehicle_type = vehicle_type
self.entry_time = None
self.exit_time = None
def set_entry_time(self):
"""Sets the entry time for the vehicle."""
self.entry_time = datetime.datetime.now()
def set_exit_time(self):
"""Sets the exit time for the vehicle."""
self.exit_time = datetime.datetime.now()
def __str__(self):
return f"License: {self.license_plate}, Type: {self.vehicle_type}"
# --- 3. Ticket Module ---
class ParkingTicket:
def __init__(self, ticket_id: str, vehicle: Vehicle, assigned_space: ParkingSpace):
"""
Initializes a parking ticket.
Args:
ticket_id (str): Unique ID for the ticket.
vehicle (Vehicle): The vehicle associated with this ticket.
assigned_space (ParkingSpace): The parking space assigned to the vehicle.
"""
self.ticket_id = ticket_id
self.vehicle = vehicle
self.assigned_space = assigned_space
self.entry_time = vehicle.entry_time
self.exit_time = None
self.is_paid = False
self.fee = 0.0
def set_exit_details(self, exit_time: datetime.datetime, fee: float):
"""Sets exit time and calculated fee for the ticket."""
self.exit_time = exit_time
self.fee = fee
def mark_as_paid(self):
"""Marks the ticket as paid."""
self.is_paid = True
print(f"Ticket {self.ticket_id} for {self.vehicle.license_plate} marked as paid.")
def __str__(self):
status = "Paid" if self.is_paid else "Unpaid"
entry = self.entry_time.strftime("%Y-%m-%d %H:%M:%S") if self.entry_time else "N/A"
exit_t = self.exit_time.strftime("%Y-%m-%d %H:%M:%S") if self.exit_time else "N/A"
return (f"Ticket ID: {self.ticket_id}, Vehicle: {self.vehicle.license_plate}, "
f"Space: {self.assigned_space.space_id}, Entry: {entry}, Exit: {exit_t}, "
f"Fee: ${self.fee:.2f}, Status: {status}")
# --- 4. ParkingLot Module ---
class ParkingLot:
def __init__(self, name: str, total_spaces: dict):
"""
Initializes the parking lot.
Args:
name (str): Name of the parking lot.
total_spaces (dict): A dictionary specifying the count of each space size
e.g., {"small": 10, "medium": 20, "large": 5}.
"""
self.name = name
self.spaces = {} # {space_id: ParkingSpace object}
self.occupied_spaces_count = {"small": 0, "medium": 0, "large": 0}
self.available_spaces_count = {}
self.current_tickets = {} # {ticket_id: ParkingTicket object}
self.ticket_counter = 0
self._initialize_spaces(total_spaces)
self._update_available_counts()
# Define hourly rates (example)
self.hourly_rates = {"small": 2.00, "medium": 3.00, "large": 5.00}
def _initialize_spaces(self, total_spaces):
"""Initializes parking spaces based on the provided counts."""
for size, count in total_spaces.items():
for i in range(1, count + 1):
space_id = f"{size[0].upper()}{i:02d}" # e.g., S01, M05
space = ParkingSpace(space_id, size)
self.spaces[space_id] = space
def _update_available_counts(self):
"""Updates the count of available spaces for each size."""
self.available_spaces_count = {"small": 0, "medium": 0, "large": 0}
self.occupied_spaces_count = {"small": 0, "medium": 0, "large": 0}
for space in self.spaces.values():
if not space.is_occupied:
self.available_spaces_count[space.size] += 1
else:
self.occupied_spaces_count[space.size] += 1
def find_available_space(self, vehicle_type: str) -> ParkingSpace | None:
"""
Finds an available parking space suitable for the vehicle type.
Prioritizes exact match, then larger sizes if exact is not available.
"""
# Mapping vehicle types to suitable space sizes
size_preference = {
"motorcycle": ["small", "medium", "large"],
"car": ["medium", "large"],
"truck": ["large"]
}
preferred_sizes = size_preference.get(vehicle_type.lower(), ["medium", "large"])
for size in preferred_sizes:
for space_id, space in self.spaces.items():
if space.size == size and not space.is_occupied:
return space
return None
def vehicle_entry(self, vehicle: Vehicle) -> ParkingTicket | None:
"""
Handles a vehicle entering the parking lot.
Args:
vehicle (Vehicle): The vehicle entering.
Returns:
ParkingTicket: The generated parking ticket, or None if no space is available.
"""
available_space = self.find_available_space(vehicle.vehicle_type)
if available_space:
vehicle.set_entry_time()
available_space.occupy(vehicle)
self._update_available_counts()
self.ticket_counter += 1
ticket_id = f"T{self.ticket_counter:05d}"
ticket = ParkingTicket(ticket_id, vehicle, available_space)
self.current_tickets[ticket_id] = ticket
print(f"\nVehicle {vehicle.license_plate} entered. Assigned to space {available_space.space_id}.")
return ticket
else:
print(f"\nNo available space for {vehicle.license_plate} ({vehicle.vehicle_type}). Parking full.")
return None
def calculate_fee(self, ticket: ParkingTicket) -> float:
"""
Calculates the parking fee based on duration and space size.
"""
if not ticket.entry_time:
return 0.0 # Should not happen with proper flow
# Ensure exit time is set for calculation
if not ticket.exit_time:
ticket.vehicle.set_exit_time()
ticket.exit_time = ticket.vehicle.exit_time
duration = ticket.exit_time - ticket.entry_time
hours = duration.total_seconds() / 3600.0
# Minimum charge of 1 hour if parking duration is less than 1 hour
if hours < 1:
hours = 1.0
rate = self.hourly_rates.get(ticket.assigned_space.size, 0.0)
fee = hours * rate
return round(fee, 2)
def vehicle_exit(self, ticket_id: str) -> bool:
"""
Handles a vehicle exiting the parking lot.
Args:
ticket_id (str): The ID of the parking ticket.
Returns:
bool: True if exit was successful, False otherwise.
"""
ticket = self.current_tickets.get(ticket_id)
if not ticket:
print(f"Error: Ticket {ticket_id} not found.")
return False
if ticket.is_paid:
print(f"Vehicle {ticket.vehicle.license_plate} has already exited and paid.")
return False
fee = self.calculate_fee(ticket)
ticket.set_exit_details(datetime.datetime.now(), fee)
print(f"\n--- Payment Required for Ticket {ticket.ticket_id} ---")
print(f"Vehicle: {ticket.vehicle.license_plate}, Space: {ticket.assigned_space.space_id}")
print(f"Duration: {(ticket.exit_time - ticket.entry_time).total_seconds()/60:.2f} minutes")
print(f"Your fee is: ${ticket.fee:.2f}")
# Simulate payment process
payment_successful = input("Proceed with payment? (yes/no): ").lower()
if payment_successful == 'yes':
ticket.mark_as_paid()
ticket.assigned_space.release()
self._update_available_counts()
print(f"Vehicle {ticket.vehicle.license_plate} successfully exited.")
# Optionally remove ticket from current_tickets if it's no longer needed in active management
# del self.current_tickets[ticket_id]
return True
else:
print("Payment cancelled. Vehicle remains in the lot.")
return False
def display_status(self):
"""Displays the current status of the parking lot."""
print(f"\n--- {self.name} Parking Lot Status ---")
print(f"Total Spaces: {sum(self.available_spaces_count.values()) + sum(self.occupied_spaces_count.values())}")
print("Available Spaces:")
for size, count in self.available_spaces_count.items():
print(f" {size.capitalize()}: {count}")
print("Occupied Spaces:")
for size, count in self.occupied_spaces_count.items():
print(f" {size.capitalize()}: {count}")
print("\nOccupied Space Details:")
for space in self.spaces.values():
if space.is_occupied:
print(f" {space}")
print("-----------------------------------")
# --- Example Usage ---
if __name__ == "__main__":
parking_lot_config = {
"small": 2,
"medium": 3,
"large": 1
}
my_garage = ParkingLot("City Central Garage", parking_lot_config)
my_garage.display_status()
# Vehicle Entry
car1 = Vehicle("ABC-123", "car")
ticket1 = my_garage.vehicle_entry(car1)
moto1 = Vehicle("MOTO-789", "motorcycle")
ticket2 = my_garage.vehicle_entry(moto1)
car2 = Vehicle("XYZ-456", "car")
ticket3 = my_garage.vehicle_entry(car2)
truck1 = Vehicle("TRUCK-001", "truck")
ticket4 = my_garage.vehicle_entry(truck1) # This should take the last large spot
# Attempt to park another car (should show no medium/large spots)
car3 = Vehicle("PQR-999", "car")
ticket5 = my_garage.vehicle_entry(car3)
my_garage.display_status()
# Simulate some time passing (for fee calculation)
import time
time.sleep(5) # Wait 5 seconds to simulate parking duration for exit
# Vehicle Exit
if ticket1:
my_garage.vehicle_exit(ticket1.ticket_id)
my_garage.display_status()
if ticket4:
my_garage.vehicle_exit(ticket4.ticket_id)
my_garage.display_status()
# Try to park car3 again after spots are freed
car3_re_entry = Vehicle("PQR-999", "car")
ticket6 = my_garage.vehicle_entry(car3_re_entry)
my_garage.display_status()
Lastly using Claude 3.7 sonnet thinking model proceed to write the app codes

AI is very useful for creating a codebase quickly, like this garage parking system, in just minutes or seconds. However, using it in real life brings its own challenges. Large Language Models can complicate things, making solutions less practical and harder to use in real-world situations.