Télécharger dans l’App Store

Exemples de code erronés pour l'enseignement

Remplir ce prompt

Génère des exemples de code réalistes avec une seule erreur pour un sujet et un niveau de compétence choisis, avec des explications détaillées et des solutions corrigées.

Modèle de prompt

You are an experienced developer and university instructor.

Create {{Example Count:5}} erroneous code examples on the topic {{Topic: e.g. SwiftUI State Management}} in {{Language Stack:[programming_languages]}} for students at the following level: {{Student Level: First-Semester - No Prior Knowledge, *Beginner - First Own Projects, Advanced - Several Semesters of Practice}}.

Requirements for each example:
- Compilable realistic code. No pseudocode and no artificially constructed miniatures.
- Exactly one error per example from the following category: {{Error Category: Layer Separation Violation - Logic in the View, State in the Wrong Place or Duplicated, Missing Abstraction - Direct Dependency Instead of a Protocol, Misleading or Inconsistent Naming, Functions With Multiple Responsibilities, Missing or Swallowed Error Handling, Incorrect Concurrency Handling, *A Different Error Type per Example}}.
- The error must be typical for this level and not exotic.
- No comments no hints and no marking of the error location.
- Variable type and UI element names consistently in English.

Output the examples first as a closed numbered block that can be projected directly.

Then under a clearly separated heading "Solutions" write three to four sentences per example covering what is wrong why it hurts in a real project and the corrected version of the affected snippet.

Guide du prompt

Idéal pour

  • Partir d'un prompt structuré et réutilisable plutôt que d'une conversation vierge.
  • Adapter le prompt à vos propres données tout en conservant l'intention d'origine.
  • Les workflows liés à Education & Academic.

Comment l'utiliser

  1. Copiez le modèle de prompt complet.
  2. Remplacez chaque variable par votre propre contexte ou choisissez l'une des options suggérées.
  3. Collez le prompt complété dans ChatGPT, Claude, Gemini ou un autre assistant IA.

Variables de ce prompt

Example Count

5

Topic

e.g. SwiftUI State Management

Language Stack Liste prédéfinie

[programming_languages]

Student Level

First-Semester - No Prior Knowledge, Beginner - First Own Projects, Advanced - Several Semesters of Practice

Error Category

Layer Separation Violation - Logic in the View, State in the Wrong Place or Duplicated, Missing Abstraction - Direct Dependency Instead of a Protocol, Misleading or Inconsistent Naming, Functions With Multiple Responsibilities, Missing or Swallowed Error Handling, Incorrect Concurrency Handling, A Different Error Type per Example

Exemple de départ

You are an experienced developer and university instructor.

Create 5 erroneous code examples on the topic e.g. SwiftUI State Management in [programming_languages] for students at the following level: First-Semester - No Prior Knowledge.

Requirements for each example:
- Compilable realistic code. No pseudocode and no artificially constructed miniatures.
- Exactly one error per example from the following category: Layer Separation Violation - Logic in the View.
- The error must be typical for this level and not exotic.
- No comments no hints and no marking of the error location.
- Variable type and UI element names consistently in English.

Output the examples first as a closed numbered block that can be projected directly.

Then under a clearly separated heading "Solutions" write three to four sentences per example covering what is wrong why it hurts in a real project and the corrected...

Comment fonctionnent les variables

Syntaxe des variables

Les variables sont entourées de {{ et }} et suivent ce modèle :

{{variable name: option1, option2, option3 }}

Variables prédéfinies

Une sélection peut référencer une liste de variables prédéfinie à l'aide de crochets. Elles apparaissent en [orange] et fournissent des valeurs courantes comme des couleurs, des tons ou des langues.

{{Tone: [tones] }}

Listes de choix personnalisées

Vous pouvez aussi fournir une liste de choix en ligne, séparés par des virgules.

{{Format: bullet points, paragraphs, numbered list }}
💡

Astuce : vous n'avez pas besoin de l'application PUCO pour utiliser ces prompts ! Copiez simplement le modèle et remplacez chaque section {{…}} par votre propre texte directement dans ChatGPT, Claude, Gemini ou tout autre assistant IA.