DEV Community

Kwaku Eshun
Kwaku Eshun

Posted on

Do you ever find yourself mixing up syntax from other languages?

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?

Top comments (14)

Collapse
 
phil-hansch profile image
Philipp Hansch

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.

Collapse
 
ben profile image
Ben Halpern

Same πŸ˜„

If I've been writing more JS, I'll dip into Ruby and start filling my code with parentheses too.

Collapse
 
jake profile image
Jake Casto • Edited

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.

Collapse
 
atyborska93 profile image
Angelika Cathor • Edited

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 if condition. Sometimes I write def fn_name do end in Ruby. Sometimes I forget the do in Elixir. And don't get me started on telling apart RegExp (JavaScript) from Regexp (Ruby) and Regex (Elixir)...

Collapse
 
priomahabub profile image
Mahabub Islam Prio

happens with me too...

Collapse
 
kspeakman profile image
Kasey Speakman

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 String but in F# it is string list. I'm also constantly trying to use Some and None in Elm whereas it is supposed to be Just and Nothing there. 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.

Collapse
 
foresthoffman profile image
Forest Hoffman

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

Collapse
 
tgiddings profile image
Trevor Giddings

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.

Collapse
 
rhymes profile image
rhymes • Edited

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

Collapse
 
mckabue profile image
Kabue Charles

+i usually mix JavaScript and c#. eg. [c-sharp-array].ForEach(function()), or try to declare a string variable in JavaScript with string placeholder

Collapse
 
alexparker profile image
Alex Parker

I keep writing javascript in my elixir app. "Why did this fail compiling?!" Oh the function doesnt need curlies πŸ€¦β€β™‚οΈ

Collapse
 
samxeshun profile image
Kwaku Eshun

every single time.

Collapse
 
abandonedfridge profile image
Daniel Nielson

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.