Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.misc > #937 > unrolled thread
| Started by | "Rod Pemberton" <do_not_have@noavailemail.cmm> |
|---|---|
| First post | 2012-02-18 19:00 -0500 |
| Last post | 2012-02-19 11:27 +0000 |
| Articles | 8 on this page of 68 — 14 participants |
Back to article view | Back to comp.lang.misc
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: Learning to code by reading code (was: The way to read STL source code) "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2012-02-18 19:00 -0500
Re: Learning to code by reading code "MikeWhy" <boat042-nospam@yahoo.com> - 2012-02-18 22:34 -0600
Re: Learning to code by reading code "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2012-02-19 03:54 -0500
Re: Learning to code by reading code "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> - 2012-02-19 10:42 +0100
Re: Learning to code by reading code "BartC" <bc@freeuk.com> - 2012-02-19 22:34 +0000
Re: Learning to code by reading code "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> - 2012-02-20 12:22 +0100
Re: Learning to code by reading code "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2012-02-20 03:39 -0500
Re: Learning to code by reading code "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2012-02-19 03:54 -0500
Re: Learning to code by reading code Nick Keighley <nick_keighley_nospam@hotmail.com> - 2012-02-19 08:40 -0800
Re: Learning to code by reading code "MikeWhy" <boat042-nospam@yahoo.com> - 2012-02-19 13:17 -0600
Re: Learning to code by reading code Nick Keighley <nick_keighley_nospam@hotmail.com> - 2012-02-20 02:32 -0800
Re: Learning to code by reading code "io_x" <a@b.c.invalid> - 2012-02-20 13:02 +0100
Re: Learning to code by reading code Nick Keighley <nick_keighley_nospam@hotmail.com> - 2012-02-20 05:09 -0800
Re: Learning to code by reading code "io_x" <a@b.c.invalid> - 2012-02-20 15:11 +0100
Re: Learning to code by reading code Nick Keighley <nick_keighley_nospam@hotmail.com> - 2012-02-20 07:39 -0800
Re: Learning to code by reading code "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2012-02-20 04:14 -0500
Re: Learning to code by reading code "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> - 2012-02-20 11:14 +0100
Re: Learning to code by reading code Nick Keighley <nick_keighley_nospam@hotmail.com> - 2012-02-20 05:13 -0800
Re: Learning to code by reading code Nick Keighley <nick_keighley_nospam@hotmail.com> - 2012-02-20 02:49 -0800
Re: Learning to code by reading code "io_x" <a@b.c.invalid> - 2012-02-20 13:02 +0100
Re: Learning to code by reading code Nick Keighley <nick_keighley_nospam@hotmail.com> - 2012-02-20 05:18 -0800
Re: Learning to code by reading code "BartC" <bc@freeuk.com> - 2012-02-20 13:53 +0000
Re: Learning to code by reading code Nick Keighley <nick_keighley_nospam@hotmail.com> - 2012-02-21 01:32 -0800
Re: Learning to code by reading code "io_x" <a@b.c.invalid> - 2012-02-21 16:16 +0100
Re: Learning to code by reading code Nick Keighley <nick_keighley_nospam@hotmail.com> - 2012-02-21 08:40 -0800
Re: Learning to code by reading code "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2012-02-20 17:36 -0500
Re: Learning to code by reading code Dombo <dombo@disposable.invalid> - 2012-02-21 00:45 +0100
Re: Learning to code by reading code "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2012-02-21 04:35 -0500
Re: Learning to code by reading code Nick Keighley <nick_keighley_nospam@hotmail.com> - 2012-02-21 08:48 -0800
Re: Learning to code by reading code Nick Keighley <nick_keighley_nospam@hotmail.com> - 2012-02-22 00:12 -0800
Re: Learning to code by reading code "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2012-02-22 06:12 -0500
Re: Learning to code by reading code Nick Keighley <nick_keighley_nospam@hotmail.com> - 2012-02-22 04:30 -0800
Re: Learning to code by reading code Geoff <geoff@invalid.invalid> - 2012-02-22 10:45 -0800
Re: Learning to code by reading code Nick Keighley <nick_keighley_nospam@hotmail.com> - 2012-02-23 01:12 -0800
Re: Learning to code by reading code "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2012-02-23 07:34 -0500
Re: Learning to code by reading code Nick Keighley <nick_keighley_nospam@hotmail.com> - 2012-02-23 05:46 -0800
Re: Learning to code by reading code "io_x" <a@b.c.invalid> - 2012-02-24 08:38 +0100
Re: Learning to code by reading code "io_x" <a@b.c.invalid> - 2012-02-24 08:40 +0100
Re: Learning to code by reading code "io_x" <a@b.c.invalid> - 2012-02-24 09:38 +0100
Re: Learning to code by reading code "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2012-02-25 05:25 -0500
Re: Learning to code by reading code Dombo <dombo@disposable.invalid> - 2012-02-25 12:50 +0100
Re: Learning to code by reading code Nick Keighley <nick_keighley_nospam@hotmail.com> - 2012-02-25 06:13 -0800
Re: Learning to code by reading code Gareth Owen <gwowen@gmail.com> - 2012-02-26 07:20 +0000
Re: Learning to code by reading code Juha Nieminen <nospam@thanks.invalid> - 2012-02-21 08:23 +0000
Re: Learning to code by reading code Juha Nieminen <nospam@thanks.invalid> - 2012-02-21 08:43 +0000
Re: Learning to code by reading code "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2012-02-21 04:47 -0500
Re: Learning to code by reading code Juha Nieminen <nospam@thanks.invalid> - 2012-02-21 10:09 +0000
Re: Learning to code by reading code "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2012-02-22 05:38 -0500
Re: Learning to code by reading code "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2012-02-21 04:31 -0500
Re: Learning to code by reading code Juha Nieminen <nospam@thanks.invalid> - 2012-02-21 10:05 +0000
Re: Learning to code by reading code "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> - 2012-02-21 12:21 +0100
Re: Learning to code by reading code "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2012-02-22 06:04 -0500
Re: Learning to code by reading code "BartC" <bc@freeuk.com> - 2012-02-21 11:01 +0000
Re: Learning to code by reading code "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2012-02-22 05:59 -0500
Re: Learning to code by reading code "BartC" <bc@freeuk.com> - 2012-02-22 12:59 +0000
Re: Learning to code by reading code "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2012-02-23 07:03 -0500
Re: Learning to code by reading code "BartC" <bc@freeuk.com> - 2012-02-24 14:20 +0000
Re: Learning to code by reading code Nick Keighley <nick_keighley_nospam@hotmail.com> - 2012-02-21 01:27 -0800
Re: Learning to code by reading code Peter Remmers <p.remmers@expires-2011-04-30.arcornews.de> - 2012-02-20 22:25 +0100
Re: Learning to code by reading code Jorgen Grahn <grahn+nntp@snipabacken.se> - 2012-02-26 08:47 +0000
Re: Learning to code by reading code "BartC" <bc@freeuk.com> - 2012-02-26 10:55 +0000
Re: Learning to code by reading code Nomen Nescio <nobody@dizum.com> - 2012-02-22 08:59 +0100
Re: Learning to code by reading code "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2012-02-22 05:59 -0500
Re: Learning to code by reading code Nomen Nescio <nobody@dizum.com> - 2012-02-22 13:47 +0100
Re: Learning to code by reading code "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2012-02-23 06:21 -0500
Re: Learning to code by reading code Nick Keighley <nick_keighley_nospam@hotmail.com> - 2012-02-22 00:08 -0800
Re: Learning to code by reading code "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2012-02-19 03:54 -0500
Re: Learning to code by reading code Marco van de Voort <marcov@toad.stack.nl> - 2012-02-19 11:27 +0000
Page 4 of 4 — ← Prev page 1 2 3 [4]
| From | "BartC" <bc@freeuk.com> |
|---|---|
| Date | 2012-02-26 10:55 +0000 |
| Subject | Re: Learning to code by reading code |
| Message-ID | <jid35u$6hb$1@dont-email.me> |
| In reply to | #1031 |
"Jorgen Grahn" <grahn+nntp@snipabacken.se> wrote in message news:slrnjkjsc9.1ls.grahn+nntp@frailea.sa.invalid... > On Mon, 2012-02-20, Peter Remmers wrote: >> He had >> lots of fun porting lwIP to it as you can't just overlay a struct on >> some chunk of memory to parse the fields (like lwIP does)... > > You can't do that on mainstream CPUs either, unless you manage the > alignment. (I'm sure someone will now argue that C should ignore > SPARC, ARM etc and hardwire itself to x86). That actually wouldn't have been a bad idea, for a product such as 'C/86' to have been created in the early eighties (not to be confused with the C89 or C90 standards). It would have been streamlined for the x86 processors, so programs could well have been non-portable to other systems. However, applications would have been limited to the niche market for x86 systems, which would likely start drying up three or four decades later.. Of course we instead have C applications where the code itself is 99% portable, but they depend entirely on makefiles, compilers and compiler flags that are 100% non-portable, even on exactly the same hardware! -- Bartc
[toc] | [prev] | [next] | [standalone]
| From | Nomen Nescio <nobody@dizum.com> |
|---|---|
| Date | 2012-02-22 08:59 +0100 |
| Subject | Re: Learning to code by reading code |
| Message-ID | <6b1b5349ea595142c8ad34fe494793ba@dizum.com> |
| In reply to | #962 |
"Rod Pemberton" <do_not_have@noavailemail.cmm> wrote: > The first inherent problem with that argument is that microprocessors have > standardized on a basic computing architecture. Nearly all computing > platforms today use that architecture either because they are microprocessor > based or because they use the same hardware, e.g., memory. They > standardized way back around 1974. Mainframes followed suit slightly > later. No, mainframes had the architecture in place in 1964 with System 360. That basic platform still exists today obviously with many extensions as System Z. Why do you keep trying to rewrite history? IBM solved all the problems Intel has today back in good old 1964. > What that means is that almost no one today - or in the past two decades for > that matter - has access to obscure, obsoleted, perverse platforms - or > other platforms that *NEVER* shouldv'e have been used to create the ANSI C > standard in the first place - where "portability" of C or C++ is actually > needed. Have you ever had access to a non-emulated EBCDIC platform in your > entire lifetime? Sure, for most of my entire lifetime. > Have you ever had access to a 16-bit byte platform in your entire > lifetime? Yes and I'm pretty sure you have also > (No.) Have you ever had access to a 9-bit character platform in your > entire lifetime? Maybe, can't remember. Pretty sure the PDP-8 used a 12 bit word but that is way bigger than what you asked about ;-) > So, like it or not, it's entirely up to the users of obscure platforms to > fix the "non-portable" nature of C code for their platforms. Agreed but I solve the problem by not using C. YMMV ;-) > Then, I'd quess you won't get fired for producing faulty code either ... > So, that qualifies you as either a novice or hobbyist. Or an H1B
[toc] | [prev] | [next] | [standalone]
| From | "Rod Pemberton" <do_not_have@noavailemail.cmm> |
|---|---|
| Date | 2012-02-22 05:59 -0500 |
| Subject | Re: Learning to code by reading code |
| Message-ID | <ji2hrq$9h8$1@speranza.aioe.org> |
| In reply to | #1001 |
"Nomen Nescio" <nobody@dizum.com> wrote in message news:6b1b5349ea595142c8ad34fe494793ba@dizum.com... > "Rod Pemberton" <do_not_have@noavailemail.cmm> wrote: > > > The first inherent problem with that argument is that microprocessors > > have standardized on a basic computing architecture. Nearly all > > computing platforms today use that architecture either because > > they are microprocessor based or because they use the same > > hardware, e.g., memory. They standardized way back around > > 1974. Mainframes followed suit slightly later. > > No, mainframes had the architecture in place in 1964 with System 360. No, only *one* mainframe - singular - "had the architecture in place ..." Also, there apparently is no support that IBM's mainframe was the genesis for the use of the same architecture adopted by microprocessors. The development of standardized characters sets, e.g., ASCII and extended ASCII, had a strong impact on standardizing 8-bit bytes for characters. > That basic platform still exists today obviously with many extensions as > System Z. Why do you keep trying to rewrite history? I'm not. Mainframes (plural) didn't standardize on IBM's System 360 design. Microprocessors did circa 1974. Mainframes (plural) still hadn't done so by 1978. How is that rewriting history? > IBM solved all the problems Intel has today back in good old 1964. What problems? > > What that means is that almost no one today - or in the past two > > decades for that matter - has access to obscure, obsoleted, > > perverse platforms - or other platforms that *NEVER* shouldv'e > > have been used to create the ANSI C standard in the first place - > > where "portability" of C or C++ is actually needed. Have you > > ever had access to a non-emulated EBCDIC platform in your > > entire lifetime? > > Sure, for most of my entire lifetime. I'm aware of your personal hell. Or, everyone else would call it hell, but you've embraced it as heaven ... What do you think real Hell will be like for you? ;-) > > Have you ever had access to a 16-bit byte platform > > in your entire lifetime? > > Yes and I'm pretty sure you have also Well, too many systems, let me check ... I don't have info on all of them. I did mean char size, but if talking address unit size then, unfortunately that's a "yes" ... However, anyone a few years younger than me, can't answer that as a "yes". So, shut up, you're ruining my point! ;-) Rod Pemberton
[toc] | [prev] | [next] | [standalone]
| From | Nomen Nescio <nobody@dizum.com> |
|---|---|
| Date | 2012-02-22 13:47 +0100 |
| Subject | Re: Learning to code by reading code |
| Message-ID | <8750f65b785c5d91c52e26dd628986d1@dizum.com> |
| In reply to | #1010 |
"Rod Pemberton" <do_not_have@noavailemail.cmm> wrote: > "Nomen Nescio" <nobody@dizum.com> wrote in message > news:6b1b5349ea595142c8ad34fe494793ba@dizum.com... > > "Rod Pemberton" <do_not_have@noavailemail.cmm> wrote: > > > > > The first inherent problem with that argument is that microprocessors > > > have standardized on a basic computing architecture. Nearly all > > > computing platforms today use that architecture either because > > > they are microprocessor based or because they use the same > > > hardware, e.g., memory. They standardized way back around > > > 1974. Mainframes followed suit slightly later. > > > > No, mainframes had the architecture in place in 1964 with System 360. > > No, only *one* mainframe - singular - "had the architecture in place ..." That's kind of a tautology since mainframe is like Kleenex or Jeep. There is really only one... > Also, there apparently is no support that IBM's mainframe was the genesis > for the use of the same architecture adopted by microprocessors. I didn't mean to suggest that, only that IBM standardized things very well ten years early than your 1974 timeline for microprocessors....to the extent stuff written for OS/360 is still object code compatible 48 years later. Then 99% of the machines that came after it that were aimed at that class of machine were either partial or total clones of the S/360 370 etc. If that isn't standardization I don't know what is. There haven't been that many successful mainframe class machines but many many microprocessor designs have had their day in the sun. > The development of standardized characters sets, e.g., ASCII and extended > ASCII, had a strong impact on standardizing 8-bit bytes for characters. I would suggest EBCDIC had a strong effect on standardizing 8 bit bytes for characters. I don't know what the timeline was but IBM ruled the world and so did EBCDIC. Just depends where you are on the space time continuum. Now everything's UNICODE so I guess the argument mutens somewhat. > > > That basic platform still exists today obviously with many extensions as > > System Z. Why do you keep trying to rewrite history? > > I'm not. Mainframes (plural) didn't standardize on IBM's System 360 design. > Microprocessors did circa 1974. Mainframes (plural) still hadn't done so by > 1978. How is that rewriting history? > > > IBM solved all the problems Intel has today back in good old 1964. > > What problems? For you they might not be problems since Intel is what you know but when we (IBM guys) look at Intel we ask stuff like Do you really need to code a loop to move a string of characters or compare character strings longer than 4 or 8 or 16 bytes??? we haven't ever had to do that for strings less than 256 bytes and for 25 years or more not for strings of any length. To us that looks stupid. Do you really have only 8 "general purpose registers" and need 2 or 3 of those to reference the stack? We had 16 true honest to goodness gprs since the first series of machines. AMD fixed that with AMD64 but they didn't go far enough considering they had a chance. Given Intel's lack of storage to storage instructions we have in IBM you really need more registers to avoid playing hide and go seek on the stack all the time. Do you really have no register saving convention on Intel? Every OS and individual function defines what has to be on the stack and what registers have to be changed? We've had standard linkage for almost the whole history of the machine and OS and the implementations on Intel look broken. There's a bunch more but I don't remember it all now. > Well, too many systems, let me check ... I don't have info on all of them. > I did mean char size, but if talking address unit size then, unfortunately > that's a "yes" ... However, anyone a few years younger than me, can't > answer that as a "yes". So, shut up, you're ruining my point! ;-) Hehe I'm sure there are plenty of old guys around older than us. For one thing check out comp.lang.fortran. There are some guys that know how to code on vacuum tube computers... The "other" Rod Pemberton
[toc] | [prev] | [next] | [standalone]
| From | "Rod Pemberton" <do_not_have@noavailemail.cmm> |
|---|---|
| Date | 2012-02-23 06:21 -0500 |
| Subject | Re: Learning to code by reading code |
| Message-ID | <ji57gt$riq$1@speranza.aioe.org> |
| In reply to | #1016 |
"Nomen Nescio" <nobody@dizum.com> wrote in message news:8750f65b785c5d91c52e26dd628986d1@dizum.com... > "Rod Pemberton" <do_not_have@noavailemail.cmm> wrote: > > "Nomen Nescio" <nobody@dizum.com> wrote in message > > news:6b1b5349ea595142c8ad34fe494793ba@dizum.com... > > > "Rod Pemberton" <do_not_have@noavailemail.cmm> wrote: ... > > > > The first inherent problem with that argument is that > > > > microprocessors have standardized on a basic computing > > > > architecture. Nearly all computing platforms today use that > > > > architecture either because they are microprocessor based or > > > > because they use the same hardware, e.g., memory. They > > > > standardized way back around 1974. Mainframes followed > > > > suit slightly later. > > > > > > No, mainframes had the architecture in place in 1964 with System 360. > > > > No, only *one* mainframe - singular - "had the architecture in > > place ..." > > That's kind of a tautology since mainframe is like Kleenex or Jeep. > There is really only one... > So, you mean ... Crays? Oh, I see ... It seems our resident IBM pundit offered us another "IBM [still] rules the world" proclamation from some dystopian reality ... I wouldn't classify IBM's mainframes as an iconic brand. As history has shown, no one wanted IBM making their PCs either ... In reality - which you apparently haven't been exposed to since they locked you in a room in early 1960's - there are lots of mainframes, minicomputers, supercomputers, e.g., Cray, Stratus, Tandems, VAX, ... Wikipedia refers to "IBM and the Seven Dwarfs", so there are another seven ... etc. http://en.wikipedia.org/wiki/Mainframe_computer BTW... After they let you out of that room, did you still see the color of the walls? How many years did it take for the color burn-in to fade? Do you find it harsh on the eyes to read non-orange or non-green text? Are you converting everything in your house to pixie tubes for the flicker or vacuum tube glow? How many boxes of programming manuals and photo-copied terminal manuals do you have at home? Do you plan on using them for kindling? They aren't on acid free paper you know ... ;-) Well, you can recycle the jokes on your buddies at the next poker night, sporting event, or camping trip, etc. > > > IBM solved all the problems Intel has today back in good old 1964. > > > > What problems? > > For you they might not be problems since Intel is what you know I know gp x86 and knew 6502. Although I've not programmed them in assembly, I've been exposed to Z80, 68000, DEC VAX, PA-RISC, Transputer, etc. > [...] but when we > (IBM guys) look at Intel we ask stuff like > > Do you really need to code a loop to move a string > of characters or compare character strings longer > than 4 or 8 or 16 bytes??? That's not necessary with x86, but that is a fast way and the slowest way. There are three ways you can do that on x86: string instructions with a repeat prefix (fastest or slowest depending), loop using the loop instruction (slow), or loop using a conditional branch (fast). > [...] we haven't ever had to do that for strings less than 256 bytes > and for 25 years or more not for strings of any length. The original 8086 (1978) had the string instruction with repeat prefix. > To us that looks stupid. Ok. > Do you really have only 8 "general purpose registers" and > need 2 or 3 of those to reference the stack? The 64-bit instruction set has more registers. The 16-bit and 32-bit instruction set has 8 GP registers. You need one to reference a stack, if you use a stack. You need another one if you're using a certain style of creating the linked-list for stack frames. If you're using more than 2 or 3, you're doing something wrong anyway. The instructions are well distributed as to minimize need of them. > We had 16 true honest to goodness gprs since > the first series of machines. So? If "we" don't need or use that many registers, why is it important that you have more than "us"? ... > AMD fixed that with AMD64 but they didn't go > far enough considering they had a chance. They provided more of them, but register shortage wasn't and still isn't an issue with the Intel, IMO. It's only an issue with those from RISC backgrounds, post 8-bit microprocessor backgrounds, or university professors who continue to spread the myth of register starvation as if the problem wasn't solved ... > Given Intel's lack of storage to storage instructions [...] What do you mean by that? For x86 (general purpose instructions), only one instruction is needed for data moves from register-to-register, register-to-memory, stack-to-register, or stack-to-memory (and vice-versa). It's only memory-to-memory or stack-to-stack that requires multiple instructions on x86. Seriously, how often do you do the latter on your precious IBMs? > Given Intel's lack of storage to storage instructions > we have in IBM you really need more registers to > avoid playing hide and go seek on the stack all the time. (I'll take it there is an implied "versus what" between "instructions ... we have".) You don't understand CISC do you? http://en.wikipedia.org/wiki/Complex_instruction_set_computing Didn't you ever code on an 8-bit microprocessor a non-orthogonal instruction set? I.e., in the pre-RISC and define all non-RISC as CISC era ... CISC instruction sets aren't orthogonal. This increases code density. They are also optimized to minimize register need. It seems you also don't understand what a register reorder buffer (ROB) is either, apparently. A ROB allows renaming of a small number of registers onto a larger set. So, the P6 mapped those 8 registers to 96. The actual dependencies of register use between instructions is limited. So, having only a few named registers, isn't really much of an issue. > Do you really have no register saving convention on Intel? There is MS' cdecl, which is fairly standard for non-GNU, non-FOSS software. But, other compilers define their own also, e.g., GNU compilers use a different combination. OpenWatcom's C compiler can produce quite a few combinations, including register only. (Why am I hearing mental projections of "... but the x86 is register starved ... "?) http://en.wikipedia.org/wiki/X86_calling_conventions There are also standardized object formats, e.g., TIS and OMF: http://en.wikipedia.org/wiki/Relocatable_Object_Module_Format http://en.wikipedia.org/wiki/Executable_and_Linkable_Format > Every OS and individual function defines what has to be on > the stack and what registers have to be changed? We've had > standard linkage for almost the whole history of the machine > and OS and the implementations on Intel look > broken. ... > The "other" Rod Pemberton > Ok, could you please stop that? I asked you before. From using Google and Yahoo, I know what a few "other" Rod Pemberton's do for a living. One is a golfer. One is a banker. etc. It'd be quite rare if another was a programmer. Of the more common names that begin with "Rod" whose last name is Pemberton, there are supposedly these people living in the US: 4 Rod 2 Roderick 7 Rodgers 1 Rodman Rod Pemberton
[toc] | [prev] | [next] | [standalone]
| From | Nick Keighley <nick_keighley_nospam@hotmail.com> |
|---|---|
| Date | 2012-02-22 00:08 -0800 |
| Subject | Re: Learning to code by reading code |
| Message-ID | <7182ae2b-cd5c-4bf6-9eb3-30969b3e8a70@hk10g2000vbb.googlegroups.com> |
| In reply to | #962 |
On Feb 20, 9:14 am, "Rod Pemberton" <do_not_h...@noavailemail.cmm> wrote: > "Nick Keighley" <nick_keighley_nos...@hotmail.com> wrote in message > > news:d3b454ac-ae8e-4bd6-b67e-2e8e4050f849@w4g2000vbc.googlegroups.com...> On Feb 19, 8:54 am, "Rod Pemberton" <do_not_h...@noavailemail.cmm> > > wrote: > > ... > > > But I use an imaginary machine [...] let's have some context:- *** > > >learning how that language is converted to assembly [is important] I don't think so. When I come across a novel language feature I like to think how it would be implemented. But I use an imaginary machine (or these days, C!). Long ago I knew Z80 assembler (actually much of Z80 machine code) but I can't see the utility in converting chunks of C ++ (or scheme or Haskell)into Z80 assembler. *** in other words I was talking about implementaion of novel language features. Say virtual functions or closures in languages that support them > How do you confirm correctness of both high-level and low-level code with an > imaginary machine? Is your confirmation of correctness imaginary also? ... for HLLs code walkthrus, code inspection, unit test, system test, use of asserts. I don't confirm correctness at the machine code level, but in principle the same techniques apply. <snip>
[toc] | [prev] | [next] | [standalone]
| From | "Rod Pemberton" <do_not_have@noavailemail.cmm> |
|---|---|
| Date | 2012-02-19 03:54 -0500 |
| Subject | Re: Learning to code by reading code |
| Message-ID | <jhqden$gsc$1@speranza.aioe.org> |
| In reply to | #937 |
"Stefan Ram" <ram@zedat.fu-berlin.de> wrote in message news:maintenance-20120219010917@ram.dialup.fu-berlin.de... > "Rod Pemberton" <do_not_have@noavailemail.cmm> writes: > >The way to improve your code is not by reading others' code > > But we should not forget that there are more man-hours in > maintenance programming than in programming a new program > from scratch. True. > That means the typical work day of a > programmer is not writing his own code (as you wrote »your > code« above), but maintaining code written by someone else. True. > And the first step to do this properly is to read and to > understand that code that is to be modified. No. Again, you're biasing a novice's understanding with code they don't understand which may be horrid. The first step is for the person to become proficient in the language. They don't have to be a master, but they should be strong in the language. Once proficient, reading the code of others is no longer a challenge and they can recognize the worth of the code they've read. If they're able to recognize that it's worthless, they can correct it. If they can't, they'll propagate that garbage forever via cut-n-paste. > So, training to > read code also is just a preparation for the very activity > that will most often be exercised when being a programmer. No. Rod Pemberton
[toc] | [prev] | [next] | [standalone]
| From | Marco van de Voort <marcov@toad.stack.nl> |
|---|---|
| Date | 2012-02-19 11:27 +0000 |
| Subject | Re: Learning to code by reading code |
| Message-ID | <slrnjk1n51.1fgu.marcov@toad.stack.nl> |
| In reply to | #937 |
["Followup-To:" header set to comp.lang.misc.] On 2012-02-19, Stefan Ram <ram@zedat.fu-berlin.de> wrote: > "Rod Pemberton" <do_not_have@noavailemail.cmm> writes: >>The way to improve your code is not by reading others' code > > But we should not forget that there are more man-hours in > maintenance programming than in programming a new program > from scratch. That means the typical work day of a > programmer is not writing his own code (as you wrote ?your > code? above), but maintaining code written by someone else. > And the first step to do this properly is to read and to > understand that code that is to be modified. So, training to > read code also is just a preparation for the very activity > that will most often be exercised when being a programmer. Following that logic, you shouldn't look at "master's" code either, since the code you will be maintaining most likely won't be done by a "master". Finding tricks to analyse dodgy code won't be learned by looking at perfect oode.
[toc] | [prev] | [standalone]
Page 4 of 4 — ← Prev page 1 2 3 [4]
Back to top | Article view | comp.lang.misc
csiph-web