Computing desk | ||
---|---|---|
< October 22 | << Sep | October | Nov >> | October 24 > |
Welcome to the Wikipedia Computing Reference Desk Archives |
---|
The page you are currently viewing is an archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages. |
OP merging unifont with code200x series, got curious Mahfuzur rahman shourov ( talk) 14:33, 23 October 2015 (UTC)
How often do concrete programs need to use some reflection ( Reflection (computer programming))? When do programmers get stuck with an issue if they are programming in a language without reflection? -- Scicurious ( talk) 18:25, 23 October 2015 (UTC)
/* 'key' and 'value' are a key/value pair just read from the whatever */
if(key == "name")
rec.name = value;
else if(key == "address")
rec.address = value;
else if(key == "phone_number")
rec.phone_number = value;
That's obviously tedious, and if you ever add a new field you have to remember to update this code (and the inverse code over in the record-writing routine), and if there's one thing good programmers hate, it's a program where if they make one change they have to make it in two or three places, in synchrony. But this is obviously the kind of problem reflection is made for. — Steve Summit ( talk) 11:44, 24 October 2015 (UTC)
Is it possible, with simple/inexpensive hardware addition/modification if necessary, to make a Raspberry Pi function as a USB device rather than a host? -- 134.242.92.2 ( talk) 21:28, 23 October 2015 (UTC)
Computing desk | ||
---|---|---|
< October 22 | << Sep | October | Nov >> | October 24 > |
Welcome to the Wikipedia Computing Reference Desk Archives |
---|
The page you are currently viewing is an archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages. |
OP merging unifont with code200x series, got curious Mahfuzur rahman shourov ( talk) 14:33, 23 October 2015 (UTC)
How often do concrete programs need to use some reflection ( Reflection (computer programming))? When do programmers get stuck with an issue if they are programming in a language without reflection? -- Scicurious ( talk) 18:25, 23 October 2015 (UTC)
/* 'key' and 'value' are a key/value pair just read from the whatever */
if(key == "name")
rec.name = value;
else if(key == "address")
rec.address = value;
else if(key == "phone_number")
rec.phone_number = value;
That's obviously tedious, and if you ever add a new field you have to remember to update this code (and the inverse code over in the record-writing routine), and if there's one thing good programmers hate, it's a program where if they make one change they have to make it in two or three places, in synchrony. But this is obviously the kind of problem reflection is made for. — Steve Summit ( talk) 11:44, 24 October 2015 (UTC)
Is it possible, with simple/inexpensive hardware addition/modification if necessary, to make a Raspberry Pi function as a USB device rather than a host? -- 134.242.92.2 ( talk) 21:28, 23 October 2015 (UTC)