|
Download code/code222.jsonl from winapiadmin/tinycodinglm: direct link, hf CLI and curl.
- Browser
- Download file 2.09 kB
-
https://huggingface.co/datasets/winapiadmin/tinycodinglm/resolve/1464c23364f23349d4bfdab40fcdf171491d7c20/code/code222.jsonl
- Command line
-
hf download hf://datasets/winapiadmin/tinycodinglm@1464c23364f23349d4bfdab40fcdf171491d7c20/code/code222.jsonl
-
curl -L -o code222.jsonl https://huggingface.co/datasets/winapiadmin/tinycodinglm/resolve/1464c23364f23349d4bfdab40fcdf171491d7c20/code/code222.jsonl
2.09 kB
| {"type": "session", "harness": "deepseek-harness", "id": "code222", "name": "Clean code principles"} | |
| {"type": "message", "message": {"role": "system", "content": "You are an expert software engineer and technical assistant. You provide accurate, detailed, and practical answers. When writing code, use best practices, proper error handling, and clear variable names. When analyzing code, identify bugs, security issues, and performance problems. You have deep knowledge of C/C++, Windows API, Python, and many other technologies."}} | |
| {"type": "message", "message": {"role": "user", "content": "What are the key principles of clean code?"}} | |
| {"type": "message", "message": {"role": "assistant", "content": "**Naming:**\n- Intention-revealing names\n- Avoid mental mapping\n- Class names: nouns (User, Account)\n- Method names: verbs (getUser, saveOrder)\n- Boolean: isValid, hasPermission\n- No abbreviations (userId not uid)\n\n**Functions:**\n- Small (5-20 lines)\n- Do one thing well\n- Few parameters (0-3 ideal)\n- No side effects\n- Descriptive names\n- DRY (Don't Repeat Yourself)\n\n**Comments:**\n- Code should explain itself\n- Comments for \"why\", not \"what\"\n- TODO comments with tickets\n- No commented-out code\n- Keep comments accurate\n\n**Formatting:**\n- Consistent style (use formatter)\n- Vertical density (related code together)\n- Horizontal alignment (don't overdo)\n- Team standards over personal preference\n\n**Error Handling:**\n- Use exceptions for exceptional cases\n- Provide context in errors\n- Don't swallow exceptions\n- Fail fast\n- Clean up resources (try/finally, context managers)\n\n**SOLID Principles:**\n- **S**ingle Responsibility\n- **O**pen/Closed\n- **L**iskov Substitution\n- **I**nterface Segregation\n- **D**ependency Inversion\n\n**Code Smells:**\n- Long functions/classes\n- Duplicate code\n- Primitive obsession\n- Data clumps\n- Feature envy\n- Inappropriate intimacy\n\n**Tips:**\n- Boy Scout Rule (leave better than found)\n- Refactor continuously\n- Code reviews\n- Automated formatting\n- Read \"Clean Code\" by Robert Martin"}} | |