Press "Enter" to skip to content

Is Big O relevant to you? – Q&A Part 1 – FunFunFunction #37


good Monday morning I am mpj and you are

watching fun fun functional normally I

have a specific subject on this show but

today as you’re watching this I’m on

vacation so I’m mixing the orbit up flop

it

IES ask straight out of Twitter ask me

questions and I shall respond to them in

the next episode oh that’s what I’m

doing now let’s get right into it have

you tried Swift what do you think about

this language

I’ve only briefly tried Swift but I

think a lot of it feels really good it

feels like Apple is taking a lot of cues

from language developments that have

happened in the last few years and it

feels like they have done really nice

pragmatic programming language that’s

modern and nice and a lot of my

colleagues around me speak highly of it

I also like the swift playground

announcement at WWDC where you have

basically a scratch like environment for

the iPad where kids can learn

programming using Swift where you move a

little character around that’s that’s

really nice now that Apple has

open-source it it allows the language to

move outside the boundaries of iOS I

have a lot of people using it that once

you start using it on the server-side

for instance I definitely think that

it’s a language that is here to stay

what is your complete workflow machine

Iran on keyboard top five tools used for

coding organizing your life I don’t

really have a static workflow I used to

but I no longer do that I try to be more

focused on exactly what it is I need to

get done and do that and not try to set

up these elaborate tool chains or or

to-do list systems in order to I might

make me more productive in the future I

used to do that a lot and I eventually

started found that I was doing that way

more than actually working or at least I

spent the time I spent off spent on it

didn’t pay off so I

basically stop doing that I don’t do

much to-do lists and stuff like that in

the same way I don’t spend a lot of time

customizing my my tools I just use a

plain Adam I don’t install any plugins

or stuff like that maybe one or two but

really that’s it and I absolutely don’t

use tools to manage tools like human and

stuff like that I think that stuff is

just crazy I elaborate a bit more on

this in the what editor do you use

Episode II what is your opinion on es7

what are the best and worst features I

have to Google this is salmon feature I

don’t pay a ton of attention towards es7

until it has been ratified but there are

some things I like that I’d learned yes

now you but it’s gonna have like this

includes function on array so you just

call array includes value in order to

check if a value is in the array because

right now if you want to do this

natively in JavaScript you just called

index ohm the value and check that is

not -1 and that yes doesn’t look as good

and it doesn’t this is a lot more

readable because it expresses the intent

a lot clearer I like this improvement it

just feels objectively better I also

like that they are expanding

destructuring into objects as well so

that you can if you haven’t seen my

episode on destructuring can you can

fight and find it there but either way

you can like instead of using object

design there’s a dot or dot operator

that you can use to mix objects together

Redux uses it a lot if you are not

familiar with redox yet are you living

your life wrong you should check out

west pass tutorial here a lot of people

are excited about the sinc wave

functions it allows you to write some a

synchronous code at-least simple a

synchronous code as as if it was

synchro’s and I’m not too excited about

it because I feel like

promises you have to use promises in

order for this to work and if you know

promises the the cases where this can be

used or pretty simple to follow anyway

so I don’t know I’m I don’t care too

much other people excited about

decorators not super keen on decorators

because I they are a class feature and I

don’t like classes and I don’t think

that we should propagate classes that

much in JavaScript especially not like

these Java features it’s my first small

view I am other people will disagree I

don’t like them have you tried using Elm

I’m super interesting but I don’t pay

too much mind

partly because it doesn’t feel like it

has a strong corporate backing or I can

be going incision backing it and pushing

it and funding it and I feel that it’s

necessary for me to even care the

ecosystem of a language is way more

important than the language itself so in

order for me to care about a language it

needs to have a like a sizable ecosystem

or at least the potential of having a

sizable ecosystem and I feel like L

missed struggling there at the moment I

pay more attention to languages like

Swift and engrossed because they have

like they are both pretty interesting in

good languages and they have a very

strong backing from the corporate

community when you encounter a bug in a

tool or framework that you use it blocks

your workflow what’s your reaction do

you try to fix it for me that’s a very

context sensitive question I if I’m very

focused on getting something done like

delivering a product at that moment and

getting that outdoor getting something

shipped then I will probably just create

a workaround it’s extremely rare that a

bargainer in a tool actually genuinely

blocks you you generally can just wrap

something around it and work around it

only other hand if I’m in a situation

where people are a bit more calm there’s

not a imminent deadline looming and you

know there’s space

and if the library is something that we

use a lot and also anticipate using a

lot for the foreseeable future then it

might be a good idea to create a pull

request into that repository and and try

to get that in it’s often pretty fun as

well to do that it gets you out of your

rut and your own products and it’s

interacting with other programmers but

it’s rare it’s it’s a lot more time to

get a fix into somebody else’s code base

than it is to get into your own code

base so you know it’s it’s a trade-off

I’d love to hear thoughts on algorithms

and Big O notation and the relevancy

that it plays with in modern day web

development Big O for you that don’t

know what Big O notation is it’s

basically a way to write I like in a

standard way how how fast a function is

or how many operations it performs

related to the stuff that it gets in so

for instance let’s say that we but it

always does the same thing no matter

what what it is that you put in for

instance something that gets in an array

and it checks the length of the array

and some other thing about the array and

returns something that means that it has

a constant time complexity and that is

how you you you express like this Oh

what it’s constant on the other hand if

your function goes through the array and

does some operation on every item that

means that it would have an in time

complexity NS the length of the array so

this is a fancy way of saying that the

the longer the array is the more

computer time it will take but let’s say

that we have a function that goes

through an array and for in every

iteration it also goes through the array

again so it’s a let’s say–let’s it’s a

for loop inside a for loop

that means that it will have n raised to

the N in time complexity in some cases

this can be really important in when

dealing with when performance good let’s

say that this first case where we just

do a simple where there’s just a for

loop inside of in a function and say if

we plot this like the more so this line

is gonna represent how much juice it

requires from your server form so if you

get in a one I to zero items it does

nothing it you get in one item it does

some some stuff and then as you get in

more more data it’s going to do more

more operations this is linear

performance this is linear performance

because it plots like this this however

the the example that has a for loop

within the for loop so the time

complexity is n raised to the N this

performance is exponential and this is

very dangerous because when you get in

your items come at nothing but when you

get in one item it’s going to like only

do one but then it’s going to do like

two and then four and then eight and

then it’s going to like it’s going to

rake go more like this instead of this

this curve is its exponential one this

is linear if you have a server form that

looks like this this is no problem at

all because when you get more users you

can just throw more machine side it’s

gonna be a troublesome amount of

machines at some point but it’s pretty

manageable in this case however you will

not be able to throw more machines at

your problem because since this grows at

like your performance problems grows at

a much much faster pace

the more you items you put into it there

is no chance in hell that you’re going

to be able to solve this problem by

throwing more machines

so this is very important in some cases

ah but there is a big hairy butt here

this is important for scalability and

scalability is not it’s not the same

thing as performance it is just a field

of performance so if you’re hiring a

developer that needs to deal with

scalability and like such a back-end

developer for your new startup which you

think will get an enormous load over

time then you need to have a person that

knows these things in and out however if

you’re employing a front-end engineer

like somebody is that is going to write

your your interface like scalability is

not performance and a performance on the

front end is a very different beast I

don’t think it’s advisable to ask a

front-end engineer about Big O notation

because they might not have run into it

because that is not the kind of

performance consideration you run into

in in front end development

normally when you do in front-end

development you often deal with like

tens of thousands of items but you very

rarely deal with billions of items yet

but you might do on on the back end on

the front end it’s more important to ask

for questions like do they know what a

flame graph is do they do probing

questions that see if they know how to

use the profiler and if they’re

experienced with the profiler ask them

to talk about a performance problem that

they had in some application and and how

they solve it is of like good one that I

use basically when you’re hiring a

person and you think about performance

you need to have a person that knows how

to reason about the performance of their

field so that they are able to solve

performance problems as they occur when

working on huge amounts of data such as

you do when you do back-end development

then Big O is is very useful but I don’t

think I’ve ever used it on the front end

in those cases it’s much more important

that the person knows how to

take any empirical approach and is the

Probot that’s it for part one of these

questions and answers vacation addition

you have us watch an episode of fun fun

function I release these every Monday

morning this exercise will be different

but it’s kind of like this you should

check out this channel below and some of

the other videos I am mpj until next Monday morning thank you

Please follow and like us: