Welcome to Incels.is - Involuntary Celibate Forum

Welcome! This is a forum for involuntary celibates: people who lack a significant other. Are you lonely and wish you had someone in your life? You're not alone! Join our forum and talk to people just like you.

Code Review my sig

42cel

42cel

Banned
-
Joined
Jan 16, 2018
Posts
835
I just got roasted on IT for my ugly code LOL. I don't code much in JS and am shit at writing clean code anyway, can someone give me feedback? Someone said it wasn't even proper c-structure (it's JS, why the fuck should it look like C?) and another one said you don't return empty arrays in JS. Why shouldn't you? It seems more readable and understandable that way instead of null or something. I obviously can't comment on IT so I'm hoping some codercels browse this board.

@FeminismsCancer IIRC you said you're good at coding
 
I actually am a C-coder and only casually use JS.
The pedant who told you it doesn't look like a proper c-struct seems totally ignorant of any code as no c-code would even use the keyword 'function' at all, thereby giving away that you didn't intend it to be C.
 
I mean, that’s just the beginning. The inequality evaluation is fucked in that idiotic second else statement as is the function call for their class

WTF is an inequality evaluation (the filter?) and where the fuck is my class?
 
42cel said:
WTF is an inequality evaluation (the filter?) and where the fuck is my class?

Maleorganism and femaleorganism are classes.
Your filter function gets called and I assume it returns a new femaleorganism after a filtering operation.
Nothing wrong with that though I don't get some of the js synctatic sugar.
As far as the second else, it doesn't test any other inequality and it shouldn't since it defaults to what failed the above ones. That guy is a moron.
 
FeminismsCancer said:
Maleorganism and femaleorganism are classes.
Your filter function gets called and I assume it returns a new femaleorganism after a filtering operation.
Nothing wrong with that though I don't get some of the js synctatic sugar.
As far as the second else, it doesn't test any other inequality and it shouldn't since it defaults to what failed the above ones. That guy is a moron.

Yeah but he said something about my function call for MY class... I never call any function of my own class, femaleOrganisms is an array. Actually the filter function is a built-in to return a filtered list of the array (femaleOrganisms) that it is called on. It basically iterates through every item in the list and adds it to another list if the evaluation yields true. That sublist is then returned as the potential partners.

But it's good to hear from a professional programmer that my code isn't complete shit, thanks LOL. Maybe someone fluent in JS will school me though.


@mylifeistrash Are you good at JS? Rate pls
 
42cel said:
Yeah but he said something about my function call for MY class... I never call any function of my own class, femaleOrganisms is an array. Actually the filter function is a built-in to return a filtered list of the array (femaleOrganisms) that it is called on. It basically iterates through every item in the list and adds it to another list if the evaluation yields true. That sublist is then returned as the potential partners.

But it's good to hear from a professional programmer that my code isn't complete shit, thanks LOL. Maybe someone fluent in JS will school me though.


@mylifeistrash Are you good at JS? Rate pls



To be fair, I mistook your array for a class too as I'm much more familiar with C++ than js or Java which I suspect might have methods on arrays too since everything is an object there.
I did a quick js refresher and found the array filter function you used.

var words = ['spray', 'limit', 'elite', 'exuberant', 'destruction', 'present'];

const result = words.filter(word => word.length > 6);

console.log(result);
// expected output: Array ["exuberant", "destruction", "present"]
 
FeminismsCancer said:
To be fair, I mistook your array for a class too as I'm much more familiar with C++ than js or Java which I suspect might have methods on arrays too since everything is an object there.
I did a quick js refresher and found the array filter function you used.

var words = ['spray', 'limit', 'elite', 'exuberant', 'destruction', 'present'];

const result = words.filter(word => word.length > 6);

console.log(result);
// expected output: Array ["exuberant", "destruction", "present"]

Yep. The code definitely works as expected (I checked it) but am wondering if it really is THAT ugly as these fuckers claim. I'm not professional and don't really care too much about conventions (because I don't have to) so I'm always getting anxious if someone criticises me LOL.

FFS JS pros GTFIH I want to know what's so horribly wrong with it.
 

Similar threads

E
Replies
9
Views
489
solblue
solblue
daydreamER
Replies
30
Views
2K
TOP_5_KANGA
TOP_5_KANGA
Eremetic
Replies
11
Views
1K
Diomedes_1112
Diomedes_1112
GeckoBus
Replies
306
Views
122K
Jud Pottah
Jud Pottah

Users who are viewing this thread

shape1
shape2
shape3
shape4
shape5
shape6
Back
Top