4

Functions Programmers are lazy. So much so that most of what makes a modern language is all about doing more with less effort. The important concept to understand is the use of functions. Functions let you break complex problems into smaller manageable parts. Functions are reusable within the current project, and in future projects. Functions are simple and ...


4

Some suggestions on coding style: Your choice in variables is somewhat confusing i, j? For an algorithm operating on a 2D image, the names x and y would be better. And dx, dy for the offsets in the inner loop. You defined the width of your kernel as SQUARE, yet you hardcode 2 in the expression image[i][j+2]. Your boundary checks can be more efficient. Why ...


3

Keep it simple Your code is overly complex as you are doing too many conversions C <=> F, C <=> Ra, and Ra <=> F can all be avoided. When doing any type of unit conversion select a base unit and then only convert between the base unit and other units. By using a base unit you can do all the conversions with only 6 formulas, rather than the ...


2

The use of non-ASCII character º in variable names is surprising to me There is a lot of repeated * 1 that is presumably used to convert string to number. parseFloat or parseInt will make intention more clear There is a lot of repetition in formulas. I would get the new user-inputted value and convert to a standard format (for example, ºC). I would then ...


2

Let me say first that I haven't actually tried the code or proposed changes, mostly because I don't have the imported files ThreeColumnContainer and TextControl. I begin with what I think is the main challenge. There are some interdependent values, and whenever one of them is changed by the user, all others should be updated instantaneously. This doesn't ...


2

It is equivalent to: const renderPriceChange = (price) => { return ( <Text style={price > 0 ? styles.rise : styles.drop}> <AntDesign name={price > 0 ? 'caretup' : 'caretdown'} color={price > 0 ? '#03AE9D' : '#fb2c33'} size={10} />{' '} {percentageFormat(item.price_change_percentage_24h)}%...


1

The code in general is pretty good, so I don't have a lot to suggest, just a handful of pointers. As already mentioned, variable naming could be a little better. For example, I'm not sure why your two most inner loops use the variables "k" and "y". "SQUARE" would probably be better named as "SQUARE_SIZE". outerArr and ...


1

This code can be simplified a lot. Don't use non alpha numeric characters for naming id's, variables, functions, etc. You should consider changing the way you implemented the decimals. For example if you choose to have one decimal on a number like 2.19 you will get 2.1. I would expect that to be rounded to the nearest integer and that would be 2.2. Apart ...


Only top voted, non community-wiki answers of a minimum length are eligible