Reputation
Next privilege 200 Rep.
See reduced ads
Badges
3
Impact
~672 people reached

  • 0 posts edited
  • 0 helpful flags
  • 7 votes cast
Mar
19
comment Should <= and >= be avoided when using integers, such as in a For loop?
Disagree. There can be reliability issues with integer types: in C, consider: for (unsigned int i = n; i >= 0; i--) or for (unsigned int i = x; i <= y; i++) if y happens to be UINT_MAX. Oops, those loop forever.
Jan
17
answered Why do python generators and functions share the “def” keyword?
Jan
17
comment Why do python generators and functions share the “def” keyword?
@Giorgio I never disputed that a new keyword would make the code more readable. My original point is simply that language designers try to avoid adding keywords so that they avoid breaking existing programs. You claimed that a new keyword would be necessary. It is not. It would simply be nice to have.
Jan
17
comment Why do python generators and functions share the “def” keyword?
@Giorgio Huh? Clearly a new keyword was not necessary since Python does use the same keyword for both functions and generators.
Aug
20
awarded  Autobiographer
Jul
21
comment Should I initialize C structs via parameter, or by return value?
Downvoter, care to explain? Is something I said factually incorrect?
Jul
21
awarded  Teacher
Jul
21
answered Should I initialize C structs via parameter, or by return value?
Jul
21
comment Should I initialize C structs via parameter, or by return value?
How would the first approach lead to a "half-initialized" Foo struct? The first approach also performs all initialization in one place. (Or are you considering an uninitialized Foo struct to be "half-initialized"?)
Jan
28
comment Why do python generators and functions share the “def” keyword?
In general, language designers usually try to avoid adding unnecessary keywords. Every keyword they add is an identifier that programs aren't allowed to use for other purposes.
Jan
28
comment Why do python generators and functions share the “def” keyword?
@StevenBurnap Derek's suggestion of using something like gen instead of def wouldn't make that transformation significantly more onerous.
Aug
23
comment Why does void in C mean not void?
Regarding why they reused void: an obvious reason would be to avoid introducing a new keyword (and potentially breaking existing programs). Had they introduced a special keyword (e.g. unknown), then void* would be a meaningless (and possibly illegal) construct, and unknown would be legal only in the form of unknown*.
Feb
26
awarded  Supporter
May
14
answered Best permissive license for a utility library?