skybert,
@skybert@emacs.ch avatar

I know I'll get more geek points if I write Java code like:

pConf.getProfiles().forEach(<br></br>    p -> mProfileURIMap.put(p.getId(), p.getURI()));<br></br>

But I still think nothing beats a good old loop:

for (ProfileConf profileConf : pConf.getProfiles()) {<br></br>  mProfileURIMap.put(profileConf.getId(), profileConf.getURI());<br></br>}<br></br>

ctietze,
@ctietze@mastodon.social avatar

@skybert I can really get behind the Swift community's convention to use for loops for side effects you want to highlight, and .forEach for less invasive things.

That's not a useful hard and fast rule (because forEach is a dead-end, so everything's a side effect!) but bringing this to the world of programmer taste and deliberation isn't the worst recommendation in my book

  • All
  • Subscribed
  • Moderated
  • Favorites
  • Java
  • rosin
  • thenastyranch
  • anitta
  • normalnudes
  • GTA5RPClips
  • DreamBathrooms
  • mdbf
  • magazineikmin
  • Youngstown
  • ngwrru68w68
  • slotface
  • InstantRegret
  • kavyap
  • cubers
  • tester
  • cisconetworking
  • provamag3
  • modclub
  • everett
  • osvaldo12
  • khanakhh
  • Durango
  • Leos
  • megavids
  • ethstaker
  • tacticalgear
  • JUstTest
  • lostlight
  • All magazines