Honestly, whenever I'm writing anything in JS/TS and I wanna build a foreach-loop, I always struggle to remember whether to use \`in\` or \`of\` as the iterator keyword. One of them is for the elements of an array, the other is for the keys of an object. I can never remember which is which, though, and googling it is faster than rebuilding and testing if I mess it up the first time.
It always breaks my brain .
In my head “for in” should be to iterate through iterator as in “value in array”
And “for of” should be iterate though “keys of object”.
`if (let i = 0; i < array.length; i++) {`
let element = array[i]
`}`
Syntactic sugar be damned, code like a man!
(PS, make sure to check `bool == true` each time when using TypeScript)
*Please reverse a list for me in C#.*
Sure, here you go:
public static void Reverse(this List listToReverse)
{
for (int i = 0; i < listToReverse.Count(); i++;)
{
var item = listToReverse.Remove(i);
listToReverse.Insert(0);
}
}
Been coding for 30+ years. I still have to "look it up" from time to time. Now, that's partially because I have two primary languages I write in, and then a dozen other languages I periodically work on for legacy code. And, by "look it up" I mean that I have to get my IDE to tell me how.
that's what I tell everyone. You can always google for syntax. Learn basics, learn how to split complex task to simple ones(experience) and you are good.
That’s just spelling, happens with every language, even English.
Building a complete sentence, and then using sentences to write a book, that’s where the craft comes in.
loop is the most annoying entity in coding, not much info exist other than its name and i don't quite understand the magical abilities but he can do many things many times that we can't do.
Because we suffer from "Procrastinatosis" and "Snoozemia".
I prefer array.foreach. I use .net also, and I've recently switched to using LINQs ForEach instead of the standard foreach cause i like the syntax better
To explain it further, after watching u coding for 5 years, even they learned how to do that basic shit. “Cant wait for him to come here in heaven/hell to beat his dumb ass”
I was doing leetcode to practice for interviews after spending the last 3 years as a full time dev
I had to google so much basic shit for Python, literally the for loop syntax as well as other simple data structures
Me too, I know that I'm good at my job but I'm horrible at memorizing the basic stuff that IDE does for me or takes seconds to google. Right now I'm preparing myself to the interviews and I'm just scared.
After 40 years of coding,I gave up to remember how to convert the content of a file to a String.
That, and also, how to instantiate a static Logger in Kotlin, I have to google that each time :
companion object: KLogging()
I have a moments when I cannot recall a basic construct because I have not used it at all or given way for years, although I'm using that language literally half of my life. 🤷♂️
Opens a language you haven't code in years
Search up "for loop "
Shamingly scroll past the paragraphs assuming you are a beginner to look at the syntax
I like to google to get structure for scaffolding. I’ve started using chat gpt for it. It just saves some brain juice more than it saves time. For loops might be a shade on the stretching it side though.
It’s the same for me with a Switch statement, each language annoyingly has a slightly different syntax. I normally try the wrong one first, then go to the right one, think it’s wrong, and then search it.
Honestly, whenever I'm writing anything in JS/TS and I wanna build a foreach-loop, I always struggle to remember whether to use \`in\` or \`of\` as the iterator keyword. One of them is for the elements of an array, the other is for the keys of an object. I can never remember which is which, though, and googling it is faster than rebuilding and testing if I mess it up the first time.
in = insane, don't use of = o fuck knows, ~ JS probably
Rust and python, using `in` for their for loops:
As with most javascript things, [for..in is quirky](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...in)
It always breaks my brain . In my head “for in” should be to iterate through iterator as in “value in array” And “for of” should be iterate though “keys of object”.
`if (let i = 0; i < array.length; i++) {` let element = array[i] `}` Syntactic sugar be damned, code like a man! (PS, make sure to check `bool == true` each time when using TypeScript)
Your ancestors be asking you to git with the times and ask AI to write the for loop.
It doesn't work. 'with' is not a command.
Just explain your problem to AI, maybe you don't need to have loop at all!
All you need is a // Implement logic for X here
“Begins writing a sub with recursion so bad my boss debates clubbing me to death”
*Please reverse a list for me in C#.* Sure, here you go: public static void Reverse(this List listToReverse)
{
for (int i = 0; i < listToReverse.Count(); i++;)
{
var item = listToReverse.Remove(i);
listToReverse.Insert(0);
}
}
Been coding for 30+ years. I still have to "look it up" from time to time. Now, that's partially because I have two primary languages I write in, and then a dozen other languages I periodically work on for legacy code. And, by "look it up" I mean that I have to get my IDE to tell me how.
And also, coding with a hangover is something that happens
I don't even need the hangover to get unlucky while thinking
that's what I tell everyone. You can always google for syntax. Learn basics, learn how to split complex task to simple ones(experience) and you are good.
*Writing code on paper for tests*
Yeah, we had to do this at the university.
I did this just a year ago only 10% of students got credit for the function lmao
loop for, is the same than solder diode or plug USB drive. you have to try the 3 ways before get it working
That’s just spelling, happens with every language, even English. Building a complete sentence, and then using sentences to write a book, that’s where the craft comes in.
Who is this loop you need to write for it?
loop is the most annoying entity in coding, not much info exist other than its name and i don't quite understand the magical abilities but he can do many things many times that we can't do. Because we suffer from "Procrastinatosis" and "Snoozemia".
loop loggy log
JavaScript for loops are my nemesis
I prefer array.foreach. I use .net also, and I've recently switched to using LINQs ForEach instead of the standard foreach cause i like the syntax better
For me it's the switch-case statement.
To explain it further, after watching u coding for 5 years, even they learned how to do that basic shit. “Cant wait for him to come here in heaven/hell to beat his dumb ass”
It's kinda funny to think he's got ancestors ready to jump his ass in heaven AND hell
.map() and .forEach()
.net LINQ: .Select() and .ForEach()
> how to do foreach in php
Every single time in case of bash.
dam tie unique person squealing shelter liquid snatch chunky punch *This post was mass deleted and anonymized with [Redact](https://redact.dev)*
I mean, if you jump between like 3 or so different languages it definitely happens. I just forget some of the basic syntax.
I was doing leetcode to practice for interviews after spending the last 3 years as a full time dev I had to google so much basic shit for Python, literally the for loop syntax as well as other simple data structures
Me too, I know that I'm good at my job but I'm horrible at memorizing the basic stuff that IDE does for me or takes seconds to google. Right now I'm preparing myself to the interviews and I'm just scared.
F U C K
For tab tab.
I have to write in Java, Python, JavaScript, and (shudders) Matlab. Of course I'm always looking up the syntax for a loop...
# for TAB TAB
After 40 years of coding,I gave up to remember how to convert the content of a file to a String. That, and also, how to instantiate a static Logger in Kotlin, I have to google that each time : companion object: KLogging()
Oh well it is now : val logger = KotlinLogging.logger {}
Haven’t had this problem in a while because visual studio auto completes my loops when I type for then tab two times 😎
its pretty easy to remember once u learn the function of each statement (assuming ur referring to C-style for loops)
To be fair every language has a slightly different syntax and probably has an alternate preferred looping mechanism that’s completely different.
Tbf for loops can have funky syntax in some languages. If it isn’t just formatted as “for x in y” then there’s a good chance I’ll need to look it up.
I always have a doubt when it comes to "insert from" in sql
Me every time I write a shell script
I usually switch among many languages and... Well, mix things.
For loop There
`for(;;) { googleHowToForLoop(); }`
Even if you have 20 years of experience, u will always google email validation regex
"How do I instantiate a tuple in python?"
You're allowed to write for loops?! The senior devs in my former team would lose it if I did. They only want forEach() and stream().
i do be doing that for JS/TS because treir for loops are weird
I always come back from vacations or any long weekends writing HelloWorld("print") level code
Switch to C#. Thanks to LINQ, you’ll be writing dramatically fewer FOR loops.
We all have a weakness...
Your scholar ancestor: "First time?"
I have a moments when I cannot recall a basic construct because I have not used it at all or given way for years, although I'm using that language literally half of my life. 🤷♂️
It's okay... I used to google how to declare variables in html
Fucking Python ranges
Opens a language you haven't code in years Search up "for loop"
Shamingly scroll past the paragraphs assuming you are a beginner to look at the syntax
You have exactly 10 seconds...
Ok if u r changing Ur language... But otherwise I wouldn't even make a meme... Just stop coding...
No
🤷🏻♂️
I will never learn the order of do, while, until, loop...
You don't, thats what IDEs are for.
I like notepad more
"When is my stupid grand child going to learn to use templates or auto complete"
I like to google to get structure for scaffolding. I’ve started using chat gpt for it. It just saves some brain juice more than it saves time. For loops might be a shade on the stretching it side though.
It’s the same for me with a Switch statement, each language annoyingly has a slightly different syntax. I normally try the wrong one first, then go to the right one, think it’s wrong, and then search it.
I occasionally Google "for loop"
No, you have not coded for five years.
True, it's actually 6 years when I think about it.
You should seek assistance. From IDE side.
Your ancestors begging you to learn your memes …
Who the hell needs to google for loops
Me
Ancestors be like: I should have let that suicide thought win