[GO] Even a new graduate engineer can do it! The trick to make a difference in synchronization by commenting out

June has arrived

It's been two months since I joined the company for new graduates. Is it time to get used to the company? Depending on the company, the training period may be over and some people may be doing on-site development.

Comment out with JavaScript

The basic grammar is as follows.

//1-line comment
/*
Multi-line comment
Multi-line comment
*/

Comment out tricks not in the book

Then, it is an explanation about the trick.

This is a trick that I learned from "T-senpai" who changed jobs from a SONY game company when I was just starting out in the first year.

At that time, I was enthusiastic about learning how to work and saying, "I will learn anything I can learn from my seniors!"

I would like to explain how to do the tricks at once, but there are two tricks in "Basic" and "Advanced".

First of all, I will explain from the "basic edition".

Basic edition

The following code uses the multi-line comment "/ * * /" to comment out the three-line process at once.

/*/
console.log("aaa");
console.log("bbb");
console.log("ccc");
//*/

Just add a "/" to the beginning of this code and you'll be uncommented!

//*/
console.log("aaa");
console.log("bbb");
console.log("ccc");
//*/

Yes! I think that the appearance of Qiita has also changed from the comment gray to black and red text colors.

Advanced version

Next is the advanced version. This is a code that is based on the basic version and is further applied.

This is an advanced version, but it can be used when you want to switch something between the "development environment" and the "production environment".

To give a concrete example, there are "API URL" and "DB connection destination".

That's the way to do it, but it's the same as the basic version.

That's right. Just add a "/" at the beginning.

Until now, "Debug" was effective,

/*  
console.log("Release");
/*/ 
console.log("Debug");
//*/

Add "/" to enable "Release".

//*  
console.log("Release");
/*/ 
console.log("Debug");
//*/

No, it's convenient (^ _ ^;

Can it be used for anything other than JavaScript?

You can use it. One-line comment with "//" Multi-line comment with "/ * * /" If it is the language, other languages are fine.

I did a rough search, but "C" "C ++" "C #" "Java" "PHP" "Go" seems to be the same.

You can try it quickly on paiza.io, so you can check it out. https://paiza.io/

By all means, let's wear this trick and make a difference to the rivals of the same period!

Which language should I study in the future?

Recently, a number of web-based programming schools have appeared. And in many cases, we recommend "Ruby" because it is easy to learn.

However, when I try to get a job, many of the companies that use Ruby are start-up companies, and I run into the reality that I have a hard time finding a job. (Because I like Ruby, it's painful ...)

SES sales staff may know it from the skin, Looking at the projects in the world, it seems that "Java" and "PHP" projects account for 50% of the total.

・ Thorough comparison of 10 popular program languages in 2017! Up to the annual income, job offers, and learning difficulty https://toiroha.jp/article/detail/32380

・ Select from Free Engineer Navi Language (DB) https://www.freeengineer-navi.tokyo/search/index/4

・ Looking for a freelance job! I checked the number of development projects by programming language. After all the first place is !? http://notsleeeping.com/archives/2238

・ Search for projects by language https://careerups.jp/slan

It may be better to master either "Java" or "PHP" as a future survival strategy.

And ** You can use this trick with "Java" and "PHP"! ** **

I repeat. ** You can use this trick with "Java" and "PHP"! ** ** (I said it twice because it's important.)

Summary

This time it was a story using comment out.

Speaking of commenting out, it's a browser from a long time ago. Assuming a case where the \ <script > tag is invalid, there was a time when it was surrounded by "<!-->" Or "<![CDATA []]>" (^_^) ;

I feel that the engineer's code continues to evolve as the browsers in the world evolve.

It's been over 10 years since I entered the industry. Is Senior T, who was indebted at that time, doing well?

If my wish comes true, I would like to work with him again. Senior.

Recommended Posts

Even a new graduate engineer can do it! The trick to make a difference in synchronization by commenting out
You can do it in 3 minutes! How to make a moving QR code (GIF)!
I tried to find out the difference between A + = B and A = A + B in Python, so make a note
If you guys in the scope kitchen can do it with a margin ~ ♪
Try to make a blackjack strategy by reinforcement learning (② Register the environment in gym)
Let's make a leap in the manufacturing industry by utilizing the Web in addition to Python
Even beginners can do it! An easy way to write a Sankey Diagram on Plotly
Make a note of what you want to do in the future with Raspberry Pi
I want to see the graph in 3D! I can make such a dream come true.
Put the lists together in pandas to make a DataFrame
Create a new list by combining duplicate elements in the list
[Python / Jupyter] Translate the comment of the program copied to the clipboard and insert it in a new cell
I tried to make a system to automatically acquire the program guide → register it in the calendar in one day
[Python] How to save the installed package and install it in a new environment at once Mac environment