News for hackers. Stuff that matters.
Re:Bash 5.0 released by palunon on Tuesday January 08, 2019 @07:49AM (#18855156)
Yeah, but C-style "for" loops are nice, right ? Still, they really are a syntactic sugar for a "while".

The problem is more with a language having fady bits and people using them when they don't make the code clearer, than with syntactic sugar.

Re:Bash 5.0 released by yesenadam on Wednesday January 09, 2019 @08:29AM (#18864509)
C-style "for" loops are nice, right

Well... I know macros are supposed to be bad, but.. I've been programming in C for a long time, but only recently tried 'sugaring' my loops with

  #define _(x,y) for (x=0;x<(y);x++)
..which has worked soo well, I'm sticking with it. It makes programming in C much more pleasurable. (My programs mostly have a lot of nested loops over multidimensional arrays, mostly from 0, inc'ed by 1)

So now instead of e.g.

  for (i=0;i<WID;i++) 
    for (j=0;j<HEI;j++) {
it's just

  _(i,WID) _(j,HEI) {
which makes me smile every time.
Re:Bash 5.0 released by hkt on Tuesday January 08, 2019 @07:59AM (#18855208)
Sure, I agree actually - if you are going to have a language that has lots of nice syntax, _let it be built in from the start_. Or only released at major increments, etc etc.
Re:Bash 5.0 released by loa-in-backup on Tuesday January 08, 2019 @08:52AM (#18855470)
Hopefully Bash 6.0 then