Yazılımcılar için Prompt Mühendisliği: Kod Üretimi ve Debug Rehberi
ChatGPT, Claude ve GitHub Copilot ile kod yazma, debugging ve refactoring için profesyonel prompt teknikleri. AI destekli geliştirme sürecinizi 10x hızlandırın.
İçindekiler
Kod Üretimi Promptları
AI ile etkili kod üretimi için promptunuzda şu bilgileri mutlaka belirtin:
Prompt Formülü:
[Programlama Dili] + [Framework/Library] + [Görev Detayı] + [Kısıtlamalar] + [Çıktı Formatı]
Örnek: React Component
// Kötü Prompt "Write a React component" // İyi Prompt "Create a TypeScript React component for a responsive navigation bar with the following requirements: - Use Tailwind CSS for styling - Include mobile hamburger menu - Support dark/light theme toggle - Include dropdown menus for nested items - Add smooth animations for menu transitions - Ensure accessibility (ARIA labels, keyboard navigation) - Export named component with proper TypeScript interfaces"
Örnek: API Endpoint
"Write a Node.js Express API endpoint for user registration: - POST /api/auth/register - Validate email format and password strength - Hash password using bcrypt with salt rounds of 12 - Check for existing user before creation - Use Prisma ORM for database operations - Return JWT token on successful registration - Include proper error handling with status codes - Add rate limiting comments for production"
Debugging ve Hata Ayıklama
AI'dan debugging yardımı alırken, hata bağlamını tam olarak vermeniz kritik önem taşır.
Debug Prompt Şablonu:
1. Hata mesajı: [Tam hata mesajını yapıştır]
2. İlgili kod: [Hata veren kod bloğu]
3. Beklenen davranış: [Ne olmasını bekliyordun]
4. Gerçekleşen: [Ne oluyor]
5. Denediğin çözümler: [Neyi denedin]
"I'm getting an infinite re-render loop in my React component.
Error: Maximum update depth exceeded
Code:
```jsx
const [data, setData] = useState([]);
useEffect(() => {
fetchData().then(setData);
}, [data]);
```
Expected: Fetch data once on mount
Actual: Component re-renders infinitely
What's causing this and how do I fix it?"Kod Refactoring
Refactoring için iyi prompt:
"Refactor this function to use async/await instead of .then() chains. Also apply early returns to reduce nesting and add TypeScript types."
Kötü prompt:
"Make this code better"
"Refactor this JavaScript code following these requirements: 1. Convert to TypeScript with strict mode 2. Replace callbacks with async/await 3. Extract repeated logic into helper functions 4. Add proper error handling with try/catch 5. Use destructuring where appropriate 6. Replace var with const/let 7. Add JSDoc comments for public functions Here's the code: [paste your code]"
Dokümantasyon Yazımı
"Generate comprehensive documentation for this function: - JSDoc comments with @param, @returns, @throws, @example - README section explaining usage - Include edge cases and error scenarios - Add TypeScript type definitions - Provide 3 usage examples from simple to complex Function: [paste your function]"
Test Yazımı
"Write unit tests for this function using Jest: - Test all happy paths - Test edge cases (empty input, null, undefined) - Test error scenarios - Use describe/it blocks with clear descriptions - Include setup/teardown if needed - Aim for 100% code coverage - Add integration test suggestions as comments Function to test: [paste your function]"
En İyi Pratikler
1. Bağlam Verin
- • Proje türünü belirtin
- • Tech stack'i açıklayın
- • Kod stilinizi belirtin
2. İteratif Olun
- • Küçük parçalar halinde isteyin
- • Sonuçları inceleyin ve rafine edin
- • Follow-up sorular sorun
3. Güvenlik Önceliği
- • Güvenlik gereksinimlerini belirtin
- • Input validation isteyin
- • Hassas veri paylaşmayın
4. Kodu İnceleyin
- • AI kodunu körü körüne kopyalamayın
- • Her satırı anlayın
- • Test edin ve doğrulayın
İlgili Yazılar
ChatGPT vs Claude vs Gemini: Hangisini Seçmelisiniz?
2026'nın en popüler AI modellerinin kapsamlı karşılaştırması.
50+ ChatGPT Prompt Şablonu - Hazır Kullanılabilir
İş, eğitim, yaratıcı yazarlık için hazır prompt şablonları.
Midjourney ve DALL-E Prompt Yazma Rehberi
Görsel AI'lar için profesyonel prompt yazma teknikleri.
Hemen Prompt Oluşturmaya Başla!
Öğrendiklerini ProPromptGen ile hemen uygula. Ücretsiz, kayıt gerektirmez!
Prompt Oluştur