|
Download code/bad004.jsonl from winapiadmin/tinycodinglm: direct link, hf CLI and curl.
- Browser
- Download file 2.09 kB
-
https://huggingface.co/datasets/winapiadmin/tinycodinglm/resolve/d517dc97f4cfcf6f6f9b7fafc368554f077178b3/code/bad004.jsonl
- Command line
-
hf download hf://datasets/winapiadmin/tinycodinglm@d517dc97f4cfcf6f6f9b7fafc368554f077178b3/code/bad004.jsonl
-
curl -L -o bad004.jsonl https://huggingface.co/datasets/winapiadmin/tinycodinglm/resolve/d517dc97f4cfcf6f6f9b7fafc368554f077178b3/code/bad004.jsonl
2.09 kB
| {"type": "session", "harness": "deepseek-harness", "id": "bad004", "name": "Bad code organization"} | |
| {"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 bad code organization habits?"}} | |
| {"type": "message", "message": {"role": "assistant", "content": "**Bad Habits:**\n\n1. **God Files (1000+ lines):**\n```python\n# Bad: everything in one file\n# utils.py: 3000 lines of unrelated functions\n\n# Good: separate by concern\n# auth.py, database.py, api.py, models.py\n```\n\n2. **Circular Imports:**\n```python\n# Bad\n# a.py\nfrom b import something\n# b.py\nfrom a import something_else\n```\n\n3. **Deeply Nested Files:**\n```\nsrc/utils/helpers/validators/email/checkers/format.py\n```\nShould be: `src/validators/email_format.py`\n\n4. **No Module Structure:**\n```\n# Bad\nproject/\n stuff.py\n more_stuff.py\n test_stuff.py\n\n# Good\nproject/\n src/\n __init__.py\n models.py\n services.py\n tests/\n test_models.py\n requirements.txt\n```\n\n5. **Hardcoded Configuration:**\n```python\n# Bad\ndb = connect(\"localhost\", 5432, \"user\", \"password123\")\n\n# Good\nimport os\ndb = connect(\n os.getenv(\"DB_HOST\"),\n int(os.getenv(\"DB_PORT\", 5432)),\n os.getenv(\"DB_USER\"),\n os.getenv(\"DB_PASS\")\n)\n```\n\n6. **Mixing Levels of Abstraction:**\n```python\n# Bad\ndef process():\n raw = read_file()\n lines = raw.split('\n')\n data = [json.loads(l) for l in lines if l]\n for item in data:\n db.insert(item) # mixes I/O, parsing, and storage\n\n# Good: separate concerns\ndef process():\n raw = read_file()\n data = parse_lines(raw)\n store_data(data)\n```"}} | |