# CamelCase vs snake\_case

When working with SQL queries in Telemetry, it's crucial to choose a naming convention that enhances the readability, maintainability, and interoperability of your code. Two common naming conventions are **CamelCase** (e.g., `myFieldName`) and **snake\_case** (e.g., `my_field_name`). This document outlines the differences between these conventions and explains why **snake\_case** is the preferred choice when using Telemetry.

#### Understanding CamelCase and Snake\_case

* **CamelCase**: This convention capitalizes the first letter of each word, except the first one. For example, `myFieldName`, `totalCost`, and `userName`.
* **Snake\_case**: This convention uses underscores to separate words, and all letters are typically lowercase. For example, `my_field_name`, `total_cost`, and `user_name`.

#### Why Opt for Snake\_case in Telemetry?

**1. Simplifying SQL Queries**

Telemetry, a versatile data analysis tool, enables you to ingest and analyze a wide range of data. When writing SQL queries to interact with this data, **snake\_case** simplifies your workflow. Unlike CamelCase, snake\_case does not require you to wrap field names in quotes, which can streamline your queries and reduce potential errors.

For instance, in Telemetry:

* **CamelCase**:

  ```sql
  SELECT "myFieldName" FROM my_table;
  ```
* **Snake\_case**:

  ```sql
  SELECT my_field_name FROM my_table;
  ```

With snake\_case, you can avoid the extra step of quoting, making your queries cleaner and easier to write.

**2. Easy Integration with Other Data Systems**

Telemetry uses DataFusion under the hood, and when you query data from Telemetry, you often need to pipe this data into other data systems or tools for further analysis or reporting. Using **snake\_case** ensures that your field names are compatible and easily transferable to other systems, which often expect lowercase, underscore-separated identifiers.

By sticking to snake\_case, you minimize the risk of encountering compatibility issues when moving data between systems, making it easier to integrate and process your data across different platforms.

**3. Enhanced Readability**

Telemetry is designed to handle complex data, including nested structures. When writing queries that involve multiple fields or complex joins, **snake\_case** enhances readability. The use of underscores to separate words makes it easier to quickly understand what each field represents, improving both development speed and code maintainability.

#### Conclusion

In the context of Telemetry, opting for **snake\_case** over **CamelCase** offers clear advantages. It simplifies your SQL queries, ensures easier integration with other data systems, and enhances the readability of your code. These benefits make snake\_case the optimal choice for writing SQL queries in Telemetry, allowing you to fully leverage the platform's powerful data analysis capabilities.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.telemetry.sh/discussion-topics/camelcase-vs-snake_case.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
