Whats the difference between [ ] and ( )?

I probably learned in school, but have forgotten. I see them used quite arbitrarily. I never use [ since i dont know when to use it.

From here:

Do not confuse brackets [ ] with parentheses ( ). Parentheses are used to enclose additional information in your own writing; brackets are editorial marks used to insert comments into someone else’s words that you are quoting, or to insert material into a passage already in parentheses.

Aha! Explained. Can anyone give examples on both?

The above is an example of an editorial comment made to clarify a quote (I’m not sure how that fits with the SDMB rules on modifying quotes though).

Well done

The uses of parentheses are limited enough that if you don’t know whether you should be using them or not, the answer is almost certainly “no”.

I prefer the square brackets - the change came when I had different keyboards for work desktop, work laptop and home laptop. You could never get into a good typing groove as they all had slightly different spacings, and shift keys (for parentheses) was one of the usual things that turned into typos when typing fast.

Changing to brackets avoided the need to do two completely unnecessary shifts. All the time I save on these and on fixing parentheses-based typos can be invested in self-improvement, not that perfection needs too much polish.

I feel like I’ve had autoparse code ruin brackets here.

Parentheses are the internal monologue. Brackets are the narrator.

The first response (by @GuanoLad) is probably the answer to what the OP was asking about. But I’ll add that, in math, the difference depends on the context (what you’re using them for). Either can be used as grouping symbols, in which context they’re essentially interchangeable. But in other situations, only one is commonly used (e.g. round parentheses for ordered pairs that designnate (x, y) coordinates), or they mean different things (e.g. round parentheses on open intervals that do not include endpoints vs. square brackets on closed intervals that do include endpoints).

And of course, in computer programming/coding they are often used differently depending on what language you’re programming in.

And then there are {curly braces}. Those are used quite frequently in math and computer coding, but I’m not even sure what they’d be used for at all, outside of those contexts.

And notably, in this context, they can be and often are mismatched: An opening mark must still be paired with a closing mark, but it can be either kind of opening or closing mark. So, for instance, you could have an interval of [0,10), meaning all numbers that are greater than or equal to zero, but strictly less than ten.

In Wikipedia, double brackets [[ text ]] are used to link to a different wikipedia article, while double braces {{ template }} inserts a template.

I always use square brackets to indicate that I have left something out in a quotation: like this […]. It is important to show that you have left something out, but it is also important that what you leave out does not change the meaning of the quote. So turning the OP statement:

I never use [ since i dont know when to use it.

into

I […] use [ since i […] know when to use it.

would be wrong, even if technically correctly executed.

Which is consistent with the SDMB rules.

Apropos of not very much, they’re all called ‘brackets’ in UK speech :- (brackets) [square brackets] {curly brackets}

I’m sure there are formal contexts in which people call them parentheses, brackets and braces here, but in general speech () are brackets. I mention this because it trips a few people up.

In writing, I use brackets if I need to put a set of parentheses inside another set of parentheses.

(Like if I have a side note [or comment], for example.)

However, I’m not sure if this is standard usage or something I made up.

From what I remember from high school math, square brackets enclose parentheses, and curly brackets enclose square brackets. So you’d write:

{a[(b+c)(d+e)+f]-g}/h

That’s the most common, but you might also use other arrangements sometimes, in some contexts (especially if you’re also using some of the other meanings of those symbols). Or you might just use parentheses of different sizes, which I think is becoming more common now that typography can easily accommodate it.

Not sure if it’s worth mentioning, but other ways exist - paired dashes, for example - to set apart a a parenthetical clause in a sentence.

But hyphens – like you used – are not a good substitute for dashes (use a double -- as an alternative).