People that use for loops instead of foreach when they want to iterate a list

>people that use for loops instead of foreach when they want to iterate a list
Why are there people that do this?

Because it's still faster?

Because foreach doesn't exist in C-masterrace-pro-official-Free-Software-language.

>foreach fgt in op
>fgt.getDick().cum()
>error: null pointer: getdick()

There, happy?

Error: op is of type 'object' not 'array'

>there are still people that don't use Parallel.ForEach

Sysadmin here, all I do is ForEach the fuck out of everything. (With PowerShell)

Hey faggot I was in the last portions of my degree and found out a lot of people couldn't even write for loops. How did they get through the program?

>fag asks for help
>needs to iterate a certain amount of times
>Tell him to try a for loop
>doesn't know how to write it, asks for help
>verbally tell him
>he begins with a single line declaring a counter variable
>next time for blah blah
>mfw


And for that matter, are they writing code for companies now?

foreach is good until you need to do stuff with the iterator, which is why for is still master race.

Is for each not a kind of loop?

>not using std::transform
Top fucking pleb.

stl is slow as fuck.

Top fucking retard.

I seen people manually construct enumerable of the iterator and call .next() on it instead of using foreach..

OP = {fgt, fgt, fgt}
Think gang rape, but OP is too much a fag to not enjoy it

foreach is just syntactic sugar for for loops, using it doesn't make you a better programmer

>not using map

This

>not ipairs()

top zozzle

>For is just syntactic sugar for while loops, using it doesn't make you a better programmer

Kekimus Prime

Yes but using it when you don't makes the code verbose and harder to read.

usually because I need the index counters to do shit with

Use a better language scrub

Because they are

1. Using a language without a foreach loop, such as C
2. Wanting to iterate in a special way, such as on every other element, or in reverse
3. Wanting both the index and the element of the array for something else.

>while is just syntactic sugar for goto, using it doesn't make you a better programmer

Because I don't need to make a copy of an instance to loop it

What if none of those things are true?

Then they're a beginner programmer who is not aware of the foreach loop.

>syntactic sugar
Professor Murray, is that you?

>not spinning up a threadpool to operate over the list using a mutex-protected index

I think it does make you a better programmer. It shows your intent, which is important when reading code. This opinion that abstraction is bad, is itself bad.

>People that write manual memory management code when they want to be able to control how and when memory is allocated
Why are there people that do this?

What when i have a data vector and i want to use a virtual function call on each data member, both Base and derived?

Theres an answer for using foreach, i just want to get the reasoning behind it.

>function call every iteration

>for loops
just use a while loop you pleb

What exactly am I looking at?

You have to in Java for older libraries, since Java didn't have a for-each loop until Java 5 in 2005.

Unreal engine

>he doesn't use map liberally

Nope. I have no clue what half my graduating class is going to do, because a significant portion.

I shit you not, the company I am working for now had issues finding suitable candidates. The preliminary questions were to define JOINs and how youd use them, what the static keyword means in C#, and to explain overriding vs overloading.

They said most people literally copy and pasted the wikipedia definitions.

Whats the efficiency of that? Wouldnt a for loop generally be quicker?

>its faster
until the very first fucking line of every goddamn loop is run which is list.get(i)

map is generally for transformations, where you would expect to get something back
foreach usually just performs an operation with each element

in functional languages where immutability is a big thing, map would generate and return a new object as a result of it's operations, whereas foreach would be applying some kind of immutable operation against the object, maybe just printing it out.

I have met professional developers who adhere religiously to SOLID principles and reliance on abstraction

I have also met people who got lucky and yet are also professional developers (without degrees) who say SOLID is bumpkiss

who is right?!?!?!?

>retards who use loops and foreach instead of recursion

Fucking brainlets on Cred Forums when will you dumb shits start learning haskell?

I think they never learned what a foreach loop was and didn't know how to for over non indexed enumerables so they googled the first thing and reinvented the wheel..

Same thing with foreach. We'd all be using gotos and if syntax doesn't matter.

java.lang.outofmem error
The object {OP} has sucked too many dicks

I would point out that pre optimization is a meme. but foreach is slower in pretty much every language, and for loops arnt really any harder in dynamic languages.

It's like 10ns slower but much more readable at a glance

depends on how often you are going to be running the loop. most of the time irl you are right, its negligible