Showing posts with label full stack developer. Show all posts
Showing posts with label full stack developer. Show all posts

Sunday, January 29, 2023

Deep, Shallow and Lazy Copy

 We can define Cloning as “create a copy of object”. Shallow, deep and lazy copy is related to cloning process. 

Shallow Copy 

  •  Whenever we use default implementation of clone method we get shallow copy of object means it creates new instance and copies all the field of object to that new instance and returns it as object type, we need to explicitly cast it back to our original object. This is shallow copy of the object.
  • clone() method of the object class support shallow copy of the object. If the object contains primitive as well as non primitive or reference type variable in shallow copy, the cloned object also refers to the same object to which the original object refers as only the object references gets copied and not the referred objects themselves.
  • That’s why the name shallow copy or shallow cloning in Java. If only primitive type fields or Immutable objects are there then there is no difference between shallow and deep copy in Java.



This can lead to unpleasant side effects if the elements of values are changed via some other reference.


Deep Copy 
 


  • Whenever we need own copy not to use default implementation we call it as deep copy, whenever we need deep copy of the object we need to implement according to our need.
  • So for deep copy we need to ensure all the member class also implement the Cloneable interface and override the clone() method of the object class.
  • A deep copy means actually creating a new array and copying over the values.




Changes to the array vals will not result in changes to the array data.
when to use what 
There is no hard and fast rule defined for selecting between shallow copy and deep copy but normally we should keep in mind that if an object has only primitive fields, then obviously we should go for shallow copy, but if the object has references to other objects, then based on the requirement, shallow copy or deep copy should be done. If the references are not updated then there is no point to initiate a deep copy.
Lazy Copy 
A lazy copy can be defined as a combination of both shallow copy and deep copy. The mechanism follows a simple approach – at the initial state, shallow copy approach is used. A counter is also used to keep a track on how many objects share the data. When the program wants to modify the original object, it checks whether the object is shared or not. If the object is shared, then the deep copy mechanism is initiated.
Summary 
In shallow copy, only fields of primitive data type are copied while the objects references are not copied. Deep copy involves the copy of primitive data type as well as object references. There is no hard and fast rule as to when to do shallow copy and when to do a deep copy. Lazy copy is a combination of both of these approaches



Saturday, January 28, 2023

What is Mental Masturbation

Mental Masturbation is human's favorite activity 

As we are taking so much of inputs from movies, Instagram, Facebook, news etc. We get inspired by many people, we admire other people's lifestyle, we get agitated with other political leaders actions, we get envy many people whose life is simply perfect.

So we get to talk with someone like our friends we want to sound perfect by talking about all these things you gonna do for getting your dream car, dream life, things you wish you had to make certain things better in your life, you would have done it differently if that person were you. 

That is okay. That's how group conversations made many life changing decisions for country. And also what else you got to talk with your friends? You cannot talk about productivity all the time. you got to judge few people for their bad behavior, you got to do hate talks for few people for the things that they have done for their petty desire. That way you can avoid those actions in your life and you are ensuring with your friends that they follow these moral behaviors.   

BUT 

One thing you got to do after that is you got to take steps to achieve what you said before.

Say you have to learn this skill to make your career better (Say Full stack Development)

Step 1: Just make up your mind that you will be a better full stack developer in next 3 months (say 90 days)

Step 2: Split the materials you gonna study into 3 parts. 

Step 3: Silently spend 1hour no matter what you got to finish that 1hour for sure to study it

Step 4: If you can keep going spend some more time. The more time you put the more valuable you gonna be.

Step 5: Keep going for everyday. Either you do this or don't its gonna be same like past 30 days(coz if you have done something earlier you wouldn't be reading this article to better yourself) So you got nothing to loose. 

Note: This is an advantage for you. because the people who see you doesn't gonna know about the things you are doing silently. You will get the urge to tell about this. But control yourself. If you cannot control yourself then you are beyond help. So forget about these things when you hangout with friends

Step 6: It will be hard for a week. But appreciate your self for doing it and believe yourself you are about to make a great impact.

Step 7: At the end of 90 days you will be a better Full Stack Developer 

Step 8: Then later if you have achieved something with your effort people will certainly notice you and ask about these efforts that you take. Then reveal it to your friends who you really care about it and who gives respect to you for your effort. If they don't value the effort that you took you should know that they envy you and certainly don't like the way you grow. So don't take these things to heart and feel bad about it. instead take another year challenge and become far better than before. Eventually the world will adapt to your actions. You will get like minded people sooner in your circle.

You are stronger than you know until you put yourself into action nobody will get to know it



  

Friday, January 27, 2023

Life of a Software Developer in D&B

Work Life Balance @ D&B


Working as D&B employee is awesome(i mean that's what i feel till now with 3 years of experience)

You get to work in many open tech stacks if you wish like angular React java .NET python automation AWS , Azure. 

If you are senior/proficient enough in Technology skills then you will get to choose the stack for the projects

Managers don't do Micromanagement but in return we gotta finish what we commit to complete on time(which is pretty much easy if you work properly without procrastinating) 

Sometimes i extended till late night and worked due to critical issue but as a reward they let you to take offs accordingly

Managers, colleagues are friendly. at the end they are also an employee like you. Give others what you expect from others. Say appreciation, helping when you are free, clearing doubts, etc. 

Great Hikes, Bonuses 

Matching product based company Market salary

Your work will be recognized and appreciated

As a Developer that's what i feel


Thursday, January 26, 2023

Scaler Full Stack Development Course Review

 Hi I'm a 6 years Front end developer

A Scaler Student

About myself I'm already having 6years of experience in Front end but less challenging projects to work

I don't think I'm capable enough to clear(MAANG) interviews with my Backend skills


So joined Scaler to strengthen my Backend and interview skills

Lets go for it in brief

This is good for anyone who has less problem solving skills and patience to learn it in a long committed time like 8 to 12 months by contributing 3 to 4hrs a day in class and doing assignments

If you really wanna make urself sharp you can already find those things in the outside open source but just not organized. you have to organize it and study

But with Scaler everything is organized and people are there to teach you everything 


Let me update about it slowly.

Keep watching this space for more inputs

 

Why String is Immutable or Final in Java

  Why String is Immutable or Final in Java In object-oriented programming, the  immutable string or objects  that cannot be modified once it...