Should Devs know how maths works?
-
They should also know how a computer works, and how the VM or runtime they are targeting works.
cheers, Chris Maunder The Code Project | Co-founder Microsoft C++ MVP
Chris Maunder wrote:
They should also know how a computer works, and how the VM or runtime they are targeting works.
...and the quaulity and quantity and specific type of mud to use in the pies.
Michael Martin Australia "I controlled my laughter and simple said "No,I am very busy,so I can't write any code for you". The moment they heard this all the smiling face turned into a sad looking face and one of them farted. So I had to leave the place as soon as possible." - Mr.Prakash One Fine Saturday. 24/04/2004
-
Chris Maunder wrote:
They should also know how a computer works, and how the VM or runtime they are targeting works.
...and the quaulity and quantity and specific type of mud to use in the pies.
Michael Martin Australia "I controlled my laughter and simple said "No,I am very busy,so I can't write any code for you". The moment they heard this all the smiling face turned into a sad looking face and one of them farted. So I had to leave the place as soon as possible." - Mr.Prakash One Fine Saturday. 24/04/2004
Well, obviously.
cheers, Chris Maunder The Code Project | Co-founder Microsoft C++ MVP
-
Well, obviously.
cheers, Chris Maunder The Code Project | Co-founder Microsoft C++ MVP
Might end up getting a job down here in Canberra with the customer I'm currently working on site with. If it looks more certain (and it is looking more than promising at the moment) I will need to have a chat with you about the areas (if any) to avoid living and any other Canberra advise you may have.
Michael Martin Australia "I controlled my laughter and simple said "No,I am very busy,so I can't write any code for you". The moment they heard this all the smiling face turned into a sad looking face and one of them farted. So I had to leave the place as soon as possible." - Mr.Prakash One Fine Saturday. 24/04/2004
-
Hi Guys, I am doing a bit of research and was just wondering... How many programmers know how a computer does math? We take it for granted that those beige boxes (or white, shiny ones in my case :o) know that 2 + 2 = 4, but how many devs know how they work it out? How many care? Should we know? If you know, how did you find out, and when / under what circumstances etc. I learned Boolean Logic in the nineties while working with 68k assembler, and it was a real eye opener. What are the teams thoughts? Danny
Danny, I see two circumstances when programmers need to be aware of the inner workings of computer arithmetic: - when they face the limitations of the finite representation (know about overflow and inaccuracies resulting from trunction issues), - when they need to use optimization "tricks" related to the specifics of the representation (such as trading a shift for a division by a power of 2). Besides that, being cultured never harms, does it ? For the brave ones: http://www.validlab.com/goldberg/paper.pdf
-
What I'm saying here, and is being echoed by others, is that you don't need to know that a computer uses AND / XOR to do addition in order to write a function which adds two numbers. I believe there are many devs out there that don't know, don't need to know and quite frankly could care less. You don't need to know how to write a for next loop in assembler in order to write one in another, higher level language, but if you 'do' know how it works at the machine level I think it gives you a greater insight into how those higher level languages do their thing. it certainly helped me to understand what was going on under the hood. Danny
You may not need that low level stuff in 99% of your working life but it is the most fundamental thing that our business is based on. So, just to be a good professional you need to know it and understand it well (besides it's not that complex). It is just a matter of being capable, well educated about your profession and reduce the (high) level of ignorance in our society today.
-
What I'm saying here, and is being echoed by others, is that you don't need to know that a computer uses AND / XOR to do addition in order to write a function which adds two numbers. I believe there are many devs out there that don't know, don't need to know and quite frankly could care less. You don't need to know how to write a for next loop in assembler in order to write one in another, higher level language, but if you 'do' know how it works at the machine level I think it gives you a greater insight into how those higher level languages do their thing. it certainly helped me to understand what was going on under the hood. Danny
Danny Martin wrote:
computer uses AND / XOR
I think that on x86 it would be few stack operation (push and pops instructions), one call, one add and one ret :)
In soviet Russia code debugs You!
-
Danny Martin wrote:
but how many devs know how they work it out?
Ideally a dev would learn to do additions in a different representation than decimal.
Danny Martin wrote:
How many care? Should we know?
It's not required knowledge for the average LOB-app. One can work with dates for years without knowing what an epoch is, or the difference between a directory and a folder.
Danny Martin wrote:
If you know, how did you find out
The Library :)
Bastard Programmer from Hell :suss:
Eddy Vluggen wrote:
Ideally a dev would learn to do additions in a different representation than decimal.
I think it's not really dev work. I learned this in high school (with electronics specialization) on microprocessors classes. And again on university on classes about assembler x86 and 51 miprocessors. So this is really another job. Unless you are developing mP, mC apps in assebly :)
In soviet Russia code debugs You!
-
I learned it in one of my Freshman/Sophomore level CS classes. My lecturer for the class didn't know that 0.1 (decimal) was a repeating decimal in binary. :doh: After the lecture I had to demonstrate it by working the division longhand through 2 or 3 repeats and then by converting the repeating decimal back into a fraction.
3x12=36 2x12=24 1x12=12 0x12=18
:| on what university you graduated?
In soviet Russia code debugs You!
-
Danny Martin wrote:
We take it for granted that those beige boxes (or white, shiny ones in my case :O ) know that 2 + 2 = 4
Trouble is that they don't. They might know that 010 + 010 = 100, but not the 2 + 2 = 4.
I wanna be a eunuchs developer! Pass me a bread knife!
Mark Wallace wrote:
010 + 010 = 100
No. 010 + 010 = 20 010b + 010b = 100 ;P
In soviet Russia code debugs You!
-
Hi Guys, I am doing a bit of research and was just wondering... How many programmers know how a computer does math? We take it for granted that those beige boxes (or white, shiny ones in my case :o) know that 2 + 2 = 4, but how many devs know how they work it out? How many care? Should we know? If you know, how did you find out, and when / under what circumstances etc. I learned Boolean Logic in the nineties while working with 68k assembler, and it was a real eye opener. What are the teams thoughts? Danny
Kind of in response to the php string vs. int earlier... We had a QA team member the other day that was extracting 2 values from a screen. It should be the same value. One value was retrieved as a string that was formatted to decimal places (1.00). The other was a floating point value that their testing tool displayed with only a single decimal place (1.0). Their comparison was saying that the two values were different. I do not use the testing tool myself but it could have been failing due to string vs. float or even string vs. string where the decimal places were different. I am not sure what they did to solve it, but this seemed like a really basic problem that they should have hit years ago. Of course since it is a float, the actual value may have been .999999999999. Who knows? P.S. I hate floats.
-
Danny Martin wrote:
nineties while working with 68k assembler
Whippersnapper! Early 80s, z80 & 6502. Ah, the days of knowing 1's and 2's complement, and hexadecimal... Iain.
I am one of "those foreigners coming over here and stealing our jobs". Yay me!
the ancient one, he who speaks of floppy disks I first used the PDP-7
-
Eddy Vluggen wrote:
Ideally a dev would learn to do additions in a different representation than decimal.
I think it's not really dev work. I learned this in high school (with electronics specialization) on microprocessors classes. And again on university on classes about assembler x86 and 51 miprocessors. So this is really another job. Unless you are developing mP, mC apps in assebly :)
In soviet Russia code debugs You!
n.podbielski wrote:
I think it's not really dev work
Math is not your work, it's knowledge that makes you better at your work. It's not required for drawing forms or manipulating Xml, but it helps a lot when you need to implement/understand an algorithm. Try writing your own
BigInt
in .NET 2, or Google for 'encryption' in VB6 - the latter will most likely give examples that perform a calculation on a string. It helps in understanding that a Guid is merely a large number, why there's a difference in text-encodings, and why theor
is used in C# to "add" enums together (BindingFlags.Public | BindingFlags.Instance)Bastard Programmer from Hell :suss:
-
Nemanja Trifunovic wrote:
What Every Computer Scientist Should Know About Floating-Point Arithmetic
:omg: I am SO glad I'm not a Computer Scientist... My knowledge of this is totally binary - I only know a 'bit'. ;) Danny
Danny Martin wrote:
I am SO glad I'm not a Computer Scientist...
Me too!! And actually every person I've ever met that calls him/herself a Computer Scientist (with a BS in CS) has been a complete and pretentious twat! :-D
The environment that nurtures creative programmers kills management and marketing types - and vice versa. - Orson Scott Card
-
:| on what university you graduated?
In soviet Russia code debugs You!
Does it really matter. Y2K cash flinging had gutted the dept and most of the entry level courses were being taught by moonlighters. This one was confused because his calculator
idiot box
had rounded the last displayed digit from 0 to 1, making him think it wasn't repeating. :doh:3x12=36 2x12=24 1x12=12 0x12=18
-
Hi Guys, I am doing a bit of research and was just wondering... How many programmers know how a computer does math? We take it for granted that those beige boxes (or white, shiny ones in my case :o) know that 2 + 2 = 4, but how many devs know how they work it out? How many care? Should we know? If you know, how did you find out, and when / under what circumstances etc. I learned Boolean Logic in the nineties while working with 68k assembler, and it was a real eye opener. What are the teams thoughts? Danny
Anyone who write software need to know a little to be able to deal correctly with float. Too many supposed devs tell me "How come my number is not 0?!?!?" :rolleyes: I might be biased though, since I work mostly on embedded system...
-
What I'm saying here, and is being echoed by others, is that you don't need to know that a computer uses AND / XOR to do addition in order to write a function which adds two numbers. I believe there are many devs out there that don't know, don't need to know and quite frankly could care less. You don't need to know how to write a for next loop in assembler in order to write one in another, higher level language, but if you 'do' know how it works at the machine level I think it gives you a greater insight into how those higher level languages do their thing. it certainly helped me to understand what was going on under the hood. Danny
I agree with the don't know and don't need to know parts, but I think a developer who could "care less" about how his code is actually being executed on the machine is not going to be a very good developer. In my experience good developers ALWAYS care about how things work because that's the only way to make things work better. And isn't that what development is really about, building things to make the world work better? Don't get me wrong, a developer who prioritizes getting his work done over figuring out how it works is a responsible developer. There are many things that I don't understand, wish I had time to investigate more fully, but probably never will. This isn't because I "care less" it's because I prioritize my activities and knowing how some particular thing works may be a lower priorty item in my queue. Personally, I am a 10+ year developer who's had quite a bit of success. I stopped taking math classes in High School with Pre-Calculus. I major'd in communications with only a minor in Computer Science that required no mathematics training. My years learning the in's and out's of the TV news business has served me better than if I spent those years learning how maths work as I now write software for the TV news business. My understanding of the business is much more important in creating useful products than understanding how a computer adds two numbers under the covers. BUT, when I have to dig deeper I do so willingly...when it came time to understand a hex dump I reprioritized my queue and learned how to do it etc. So my answer to the original question is devs should know how maths work if they've ever needed to know how maths work. Sean
-
Hi Guys, I am doing a bit of research and was just wondering... How many programmers know how a computer does math? We take it for granted that those beige boxes (or white, shiny ones in my case :o) know that 2 + 2 = 4, but how many devs know how they work it out? How many care? Should we know? If you know, how did you find out, and when / under what circumstances etc. I learned Boolean Logic in the nineties while working with 68k assembler, and it was a real eye opener. What are the teams thoughts? Danny
Programmers SHOULD know how a computer does math. That's why this is covered in college courses. A few examples: 1. Overflow and underflow. If a clueless, self-taught "programmer" assumes an int is an "integer", they're oblivious to the possibility of overflow, and their code is a time bomb, waiting for a case that goes over the 32-bit limit. 2. Floating-point arithmetic. I've met programmers that think (floatNum / 7) * 7 == floatNum. They're oblivious to the fact that floating-point numbers are an approximation of real numbers that aren't a power of 2. 3. Efficiency. Programmers that have a clue how a computer does math know things, such as floating-point multiplication is faster than division, and integer math is faster than floating-point math. 4. Round-off error. The limited precision of computer math causes the order of operations to be significant, even when mathematically the order doesn't matter.
-
By my experience that also accounts for a few new posts in the coding horrors section, usually committed by somebody who is totally unaware of what's so horrible about it. And, my personal favorite, experienced developers quickly looking the other way and leaving the dirty work to that rambling idiot who keeps ranting about how important that stuff is.
"I just exchanged opinions with my boss. I went in with mine and came out with his." - me, 2011 ---
I am endeavoring, Madam, to construct a mnemonic memory circuit using stone knives and bearskins - Mr. Spock 1935 and me 2011I might fit into the above category. I code and I take it very seriously. I did not start my working like as a coder, in fact far from it. I have no formal education as a coder but I have taught myself enough to get where I am. I constantly strive to improve my code and expand what I know. On those very rare occassions when I have free time I read as many tech articles and/or books on coding and theory as I can. But my math skills are still pretty poor. I know this and I accept that I will have to do crunchtime research every time a hex issue or binary issue pops up. No, it's not the best approach but it can work. I am at my job six years now and am writing some pretty important software for my client. FWIW, I am also thankful that there are folks smarter than I am willing to share what they know about these topics. Please remember that not everyone who doesn't do well at math is a script-kiddy slacker parasite just waiting to have you do their work for them. I realize that is NOT what you said, but I have to admit to frequently getting that feeling from many of the posts here on different topics. Maybe you math folks are just smarter than us none-too-good at math folks? I am willing to concede that point. But I would wager that many of us DO know that a clear understanding of the basics of computer math is important and that we DO try. We don't always succeed, but we try. Kurt
-
the ancient one, he who speaks of floppy disks I first used the PDP-7
Data General 1401 as best I can recall. Had to toggle in a JPUN to kickstart the KSR terminal.
-
Iain Clarke, Warrior Programmer wrote:
Whippersnapper!
Mewling infant! Mid 60s on this machine[^]; I'm not in any of the photos but the dark haired guy in the first picture was my shift leader.
The best things in life are not things.
You got me beat. Late '60s PDP-8/I PDP-8/I display[^] But then made up for it by being a computer operator for three Univac 418's. Univac 418's[^] That's me, mid '70s, with three computers to oversee, I had to be fast enough to be two places at once :laugh: Later, when I wrote the Biorhythm cartridge for the Bally Home Arcade (later Astrocade), I had to write a multi-byte binary multiply and divide math package to do the date calculations. I wish I had known how to do that in high school on the PDP-8/I, I ended up using the EAE (Extended Arithmetic Element) hardware to do date calculations. Turns out, every once in a while, a divide would take too long and the processor would then miss interrupts (really, really bad for the timesharing system it was running).
Psychosis at 10 Film at 11