# Syntax Surprises

**URL:** <https://discourse.julialang.org/t/syntax-surprises/92369>\
**Category:** General Usage\
**Tags:** syntax, discussion, fun, gotchas\
**Created:** [December 31, 2022, 8:00pm UTC](https://discourse.julialang.org/t/syntax-surprises/92369 "2022-12-31T20:00:02Z")\
**Posts on this page:** 1\
**Showing post:** 57

<div class="post-metadata">

**Author:** ![uniment](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/uniment/32/24532_2.png) [@uniment](https://discourse.julialang.org/u/uniment)\
**Post date:** [January 5, 2023, 8:51pm UTC](https://discourse.julialang.org/t/syntax-surprises/92369/57 "2023-01-05T20:51:01Z")

</div>

> [@mikmoore](#):
>
> flag instances where the symbol exists and a numeric juxtaposition would otherwise be shadowed by a float literal

Ah, now _this_ is the best of all possible worlds!

> [@c42f](#):
>
> we should have good linting

It’d be awesome to have a linter built-in to the package manager, so e.g. I could generate a lint report prior to an upcoming package release by writing:

```julia
]
lint MyPackage
test MyPackage

```

and maybe get a [linter in the REPL](https://discourse.julialang.org/t/staticlint-without-vscode/92517). Then whenever someone is new to Julia and starts writing things like `myVar = 5`, they can immediately receive feedback that it’s unidiomatic to use camelCase and be chastised into snake\_case, or when they write `(2x + 4)/3*a` they can receive feedback that `*` after `/` should have whitespace.

I like the idea of a linter giving hints and generating reports, but not [on its own] forcing adherence. This causes convergence on standard practice by nagging (the same way my car pretty quickly gets me to buckle my seatbelt by beeping), but you’re still free to break guidelines if it proves useful—you just have to be willing to put up with the nagging and the extra sign-offs, and other people (such as peers and managers) get better visibility into which guidelines you’re violating and can compel you into compliance if there’s no good reason to violate.

It could also be interesting to allow for linter error severity to be reduced, if the line before an error is used for a comment on why breaking the linter rule is justified there.

---

_[View the full topic](https://discourse.julialang.org/t/syntax-surprises/92369)._
