DEV Community

Screaming Snakes in Javascript

Cole Diffin on May 02, 2017

SCREAMING_SNAKES case has no place in modern day javascript. It's ugly, it's vulgar, and it makes any code less desirable to read. I feel like ...
Collapse
 
caseyreeddev profile image
Casey Reed

"Eye-raped" has no place in modern day article writing. It's ugly, it's vulgar, and it makes any article less desirable to read.

Collapse
 
patricktingen profile image
Patrick Tingen

I like the term "eye-raped"; what has been seen cannot be unseen. Furthermore, I really appreciate that someone finally took the effort of doing a poll about the usage of screaming snakes :)

Collapse
 
caseyreeddev profile image
Casey Reed

"The use of sexualized language or imagery" is literally the first unacceptable behavior listed in this website's Code of Conduct.

Collapse
 
patricktingen profile image
Patrick Tingen

Yeah, actually, you're right! But since you started out with an opinion, I joined in. And to be honest, I still like it ....

Thread Thread
 
arcticshadow profile image
Cole Diffin

I'd like to thank you for reading my first article, and providing some constructive feedback.

My intention was never to use an overly sexualized term, to extend the reach of my work. I found it to be an exact representation of the feelings that I had on a regular basis when a constant in code was represented by SCREAMING_SNAKE case.

It would appear that my understanding of the term is not as common as I initially thought. I have even spent the morning researching other sites and blogs in a futile attempt to find supporting evidence, and have turned up empty handed. I am happy though, that there is at least one person that does appear to have interpreted the term in the same way I initially have.

I shall edit my article with hopefully another punchy description, that does not offend the masses.

Thread Thread
 
caseyreeddev profile image
Casey Reed

Hey, man. Just wanted to say that I really appreciate your level-headed response to my comments. I thought you wrote a really great, thought-provoking article and I'm glad that you could understand my criticism in your use of a term often reserved for describing sexual assault to describe how a variable typed in all-caps makes developers feel. I'm certain you didn't intend any harm in choosing that phrase, but I didn't believe its inclusion helped to further the mission statements or code of conduct of this site.

Once again, thanks for accepting my criticism and having an open dialogue about this.

Thread Thread
 
arcticshadow profile image
Cole Diffin

But of course! Without an open dialogue, one cannot learn and grow.

Collapse
 
arcticshadow profile image
Cole Diffin

You have raised a couple of good points here. It's been a long while since I wrote any PHP - back in the days of 4x transition to 5x. If I recall back then It was a similar story to what you describe.

So there will naturally be slight differences between meanings in different languages, however, this appears to be more of a developer habit than a language convention, so it does make sense that the patterns are common.

In the situation that config is presented as a SCREAMING_SNAKE I would suggest the need to carefully examine if it is in the correct place. Typically, config would be better located elsewhere. Especially if it is sensitive, or shared. There are instances of course, where in-file does make sense - but again if that's true, is it used multiple times in the file? If not, why not just inline it and save yourself time and overall code.

My comments regarding Developers using SCREAMING_SNAKE case to represent immutability, is more targeted towards Javascript, where IDE's are a luxury (that usually don't work well) Typical setups would involve a modified/customized editor like Atom or VSCode, but still, leaves the language nuances to you. In particular, in the past, immutability has been a distant thought, i.e. you can edit anything, at any time, so best to make it obvious things that you shouldn't edit accidentally.

Collapse
 
jbwebtech profile image
jbwebtech

It's a great day for JavaScript that we have immutables and don't have to rely on the developers to "not change the thing." Thanks for the perspective!

Collapse
 
ptkdev profile image
Patryk Rzucidło • Edited

I love 🐍 {snake_case}