Do you ever find yourself mixing up syntax from other languages?
Kwaku Eshun
・1 min read
As someone who started development with iOS i.e. Objective C and Swift, I am working full time as a web developer now and I find myself writing Swift in C# or C# in Javascript. Anyone ever do this?
Classic DEV Post from Oct 5 '18
How do you do random?
How would you generate an random 0 to 10 integer in your favorit language?
I am writing Ruby most of the time but sometimes also write small Javascript components for the frontend. The first few times I always end up writing the Javascript conditionals in the Ruby way. It's never the other way around, though.
Same 😄
If I've been writing more JS, I'll dip into Ruby and start filling my code with parentheses too.
I regularly work with Python, Java, and PHP. Mostly I get PHP + Python syntax confused, I spent a solid half hour a few days ago trying to figure out why I was getting an InvalidSyntax error in PyCharm when I had a semicolon at the end of every statement.
I regularly switch between JavaScript, Ruby and Elixir. I mix the syntax quite often. Sometimes I forget which of those requires me to put
()around the
ifcondition. Sometimes I write
def fn_name do endin Ruby. Sometimes I forget the
doin Elixir. And don't get me started on telling apart
RegExp(JavaScript) from
Regexp(Ruby) and
Regex(Elixir)...
happens with me too...
So often! I am switching between Elm and F# a lot. They are similar, but differ slightly. For instance, a list of strings in Elm is
List Stringbut in F# it is
string list. I'm also constantly trying to use
Someand
Nonein Elm whereas it is supposed to be
Justand
Nothingthere. In F# properties are capitalized by convention, but in Elm they are required to be lower case. When I pair with others on the team, I notice the same issues. So you are not alone.
All the time! Especially when I'm doing any tutoring work. One person will be writing something in Java, another in C++, and a third in JavaScript. The faster I switch gears, the funnier the mix-ups can be. :P
I primarily work with Scala in my personal projects right now but I am helping teach some students in my robotics club Java. Even though I actually have far, far more experience with Java, I keep attempting to write variable declarations in Scala syntax. It's the only part of Scala's syntax that seems to bleed over, for some reason.
Happens all the time when I switch between Ruby and Python codebases even multiple times during the day :D
Usually it's the end keyword in Python at the end of a function or the colons in Ruby. Sometimes even standard library function names
I keep writing javascript in my elixir app. "Why did this fail compiling?!" Oh the function doesnt need curlies 🤦♂️
every single time.
+i usually mix JavaScript and c#. eg.
[c-sharp-array].ForEach(function()), or try to declare a string variable in JavaScript with
string placeholder
All the time. Just did some code challenges this morning in JS after a couple weeks of Python. Kept trying to add arrays and 'print' stuff.
Switching between C++ and Python, I often either add or forget to add the semicolon at the end of the statement. That, or I flub the parenthesis on conditional statements.