This is an excerpt from my dialogue with my language partner. For some context, I basically asked her about the difference in について and は, since both can be translated to "Concerning X".
The sentence in question: 「ついて」の使い方ですが、後ろに名詞が来るか、動詞が来るかで少し違います。
My attempt at translation: "About the usage of 「ついて」, it varies a bit based on wether a noun or a verb comes at the rear."
Here, I basically interpreted で as a marker for a "means" or better a "cause", like in 事故 で 電車が止まりました。 However, I also learned in my textbook that to express something like "depending on X, it is A or B", a construction with によって is used, like this: 好きな食べ物は人によって違います。
That's why I wanted to ask wether my interpretation of で in the sentence above is legit or not.