For My Soul

For My Soul

Sometimes it's really hard wanting to be a software engineer. It fell into my life from the sky in the course of last summer, dancing into autumn, this crazy desire. And it just wouldn't go away. 

I tried so hard to ignore it, but it just kept coming back. There were just more and more chance meetings, more and more signs, more and more coincidences. I tried to get people to dissuade me. I even tried to get an EM from my team to dissuade me, telling him that I thought that people were just trying to stereotype me due to my neurodiversity. 

I couldn't have been more wrong. This is what I'm meant to be doing. I have a passion for this, and I'm meant to be doing this. And sometimes it is really hard - and it's like at Uni, sometimes the working hours don't apply. 

Sometimes, whether I'm at a restaurant, or in bed, or waiting for the bus at the corner in my marine part of Brighton, I have to whip out my notebook and write down the next steps for me to become a software engineer. And it I don't care - because it works. And by doing so, I am keeping the quest alive. I AM KEEPING THE QUEST ALIVE.

I am keeping my quest alive, baby. I am keeping my quest alive.

For My Soul album artwork.

Today's blog post is named after the beautiful song, by Sublab and Azaleh.

Revision

And so, as per Friday's blog post, my next 3 steps were to revise. So here are my notes on that.

Thursday's Blog Post

This was my first thing to revise. 

But looking back over it, I can see that I did not need to go into as much detail when revising as originally thought. What HAVE been really amazing are Adam's comments on it. 

Adam's Thoughts

Adam says that there's something called a linter in programming which is like a spellcheck in a word document (or Grammarly, I suppose?). 

The two tools/linters (I think?!) that the JavaScript community has built are ESLint and Prettier. Some are apparently stricter and more opinionated than others - e.g. ESLint is more configurable than Prettier but as described below, Prettier does allow for some configurability e.g. around parentheses.

RunJS which I have been meaning to install for about 10 million years now (still keep on getting conflicting opinions from people on this) has Prettier built in it. 

You can update your preferences in the formatting settings, which is cool. 

Other Stuff from my Blog Post

Implicit Return

I'm happy to be revising this again, because, to be honest, I had completely forgotten this/maybe even not understood it in the first place.
  • Well the first thing to learn here is that they are optional, and so therefore they do not have to necessarily remembered/used.
    • But they could be worth knowing e.g. if you are in a team that uses them?
Let me go back to my Codecademy course again. 

It says here that: "A function body composed of a single-line block does not need curly braces."

It then says that: "Without the curly braces, whatever the line evaluates will be automatically returned."

So just to repeat once again: "A function body composed of a single-line block of code does not need curly braces. Without the curly braces, whatever the line evaluates will be automatically returned." 

So then, because that single-line block of code is automatically returned, we do not need the return keyword. So therefore, the next line in the Codecademy course is: "The contents of the block should immediately follow the arrow => and the return keyword can be removed.

So the example in the code would be:

const squareNum  = (num) => {
    return num * num;
};

Gets refactored into:

const squareNum = num => num * num;

So in this case the parameter also has no parantheses which is probably why I didn't understand it before.

Ternary Operators

Need to revise these. Because I have forgotten everything - I just remember that this : means 'or'.

*le sigh...

Adam's Notes on Parameters

On Thursday evening I reached out to the wonderful, wonderful Adam (EM from my team) about arguments vs. parameters. 

The first thing he said to me which was really helpful was this:

"Parameters define what arguments a function accepts". 

Parameters define what arguments a function accepts. 

Parameters define what arguments a function accepts. 

And so some examples of this are...

So Adam gave me the following code block:

const sum = (x, y) => {
    return x + y;
}

In this example, then x and y are the parameters. I repeat, x and y are the parameters. 

x and y are the parameters.

Okay so then we call the function.

sum(2, 4)

2 and 4 are the arguments.

2 and 4 are the arguments.

2 and 4 are the arguments.

In Adam's words: "We are passing two arguments 2 and 4" so we "can think of it along the lines of we pass an argument of 2 to the parameter x" - and - an arguments of "4 to" the parameter "y".

Adam gave me one more example: 

With the above function, if you were to call it like so:

sum(2, 4, 8)

Then it would just return the first 2 arguments because only 2 parameters have been defined. 

So it just returns 6

Rosana's Code Block

My wonderful, wonderful friend Rosana (Senior Engineer at work) wrote me an example of callbacks and of using functions as paramaters. But I have to admit that it is a little bit over my head right now 👽

The example they gave me was (can also be viewed on codepen):

//Function A
function whatDateIsIt(){
    console.log(new Date());
}

//Function B - Requires a callback function 
function sayHiAndExecute(functionToExecute){
    // 1. Say hi
    console.log('hi');
    // 2. Execute the callback
    functionToExecute();

So the first one makes sense to me. It is just a normal function.

The second one is the one we are interested in. It features a callback function and a function as a parameter. i.e. this is basically the same thing. 

I get two things
  1. The function calls back to a previous function, and it calls on it, in order to do something.
  2. The function passes another function as an argument within its parentheses, as one of its parameters.
But I don't get why or how it does this? I am so confused? Someone please help (or maybe I will reach out to Rosana 😂)

No Projects Today

I didn't get onto any of the projects for building things JavaScript functions but hey at least I did all of the revision. Steps 1-3 out of 5 completed, I guess? 😊😊😊😊

Neurodiversity and Detail

Neurodiversity can be challenging at the best of times, and sometimes, with it, it entails a lot of loneliness too.

I can memorise every opening time for every store that I want to or need to go to (in Brighton and beyond), memorise whole bus timetables if I need to, remember everything that a specific person has said to me, remember the lyrics to thousands and thousands of songs, remember phone numbers, birthdays, whole sequences of speech, and just about everything I read on Wikipedia about a certain thing if I'm interested in it. And all of this is with absolutely zero effort. Like absolute zero. For that reason I was well into my adult life before I understood that not everybody thought like this. How do you make small talk with people when you are thinking about AI on a very deep level and this is before 9 am on a Monday morning? 

But anyway. 

I go into a lot of detail. 

But this is how I learn. 

And I need someone to say to me: 

"It's okay, Susanna. It's okay. 

It's okay to go into a lot of detail. If that's how you learn, then it's okay. "

Because I am laying a solid foundation. And this is how I learn. And once I learn, then I will be UNSTOPPABLE.

Comments

Popular posts from this blog

Hello World

Yosemite

Two Lines of Thought, Makes Me Wonder What I'm Missing