POV-Ray : Newsgroups : povray.off-topic : FizzBuzz Server Time
4 Sep 2024 05:13:53 EDT (-0400)
  FizzBuzz (Message 5 to 14 of 24)  
<<< Previous 4 Messages Goto Latest 10 Messages Next 10 Messages >>>
From: Orchid XP v8
Subject: Programming failure
Date: 4 Jul 2010 10:48:46
Message: <4c309f4e$1@news.povray.org>
Orchid XP v8 wrote:
> http://www.codinghorror.com/blog/2007/02/why-cant-programmers-program.html

I few clicks away from this, I got to here:

http://www.eis.mdx.ac.uk/research/PhDArea/saeed/paper1.pdf

I don't know about you, but *I* have always wondered why some people 
find programming hard. It is a "well known" fact that there seem to be 
two types of students: those who "get" programming, and find 
introductory courses ridiculously easy, and those do "don't get" 
programming, and find even the simplest exercises insummountably difficult.

I haven't finished reading this paper yet, but it throws some 
interesting ideas out there. One particular paragraph leaps out at me:


capabilities of computers could have a massive negative impact on their 
success at programming. Many of their subjects tried to use meaningful 
names for their variables, apparently hoping that the machine would be 
able to read and understand those names and so perceive their intentions."

Oh I have *so* seen this! People who seem to think that if they write 
their code with obvious-enough names and syntax that's near-enough to 
being correct, the computer will "just know" what they mean. They fail 
to grasp that the syntax must be EXACTLY CORRECT, even if it seems silly 
or unnecessary.

I guess it's because they're used to talking to humans. If you say 
something to a human with somewhat incorrect grammer (or even 
horrifyingly broken grammer), they can usually still figure out what you 
mean.

Computers are far, far more stupid than humans. But decades of advances 
in computing technology have brought us to the point where computers 
*look clever*, even though they aren't. I suspect this might be why some 
people have trouble learning to *use* a computer too.

-- 
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*


Post a reply to this message

From: nemesis
Subject: Re: FizzBuzz
Date: 4 Jul 2010 10:55:01
Message: <web.4c309fba99168f123cfb39c30@news.povray.org>
Orchid XP v8 <voi### [at] devnull> wrote:
> http://www.codinghorror.com/blog/2007/02/why-cant-programmers-program.html
>
> Oh, *that's* fizzbuzz? Hmm, OK.
>
> Also... that's really kinda scary. o_O Let's hope plumbers are better...
> uh... hmm, OK, maybe not. Well let's hope to **** that medical
> professionals are better! O_O

the real problem is that many people who should really be plumbers or medicals
are into programming careers.  well, plumbing may still have its uses... :)


Post a reply to this message

From: Orchid XP v8
Subject: Re: FizzBuzz
Date: 4 Jul 2010 11:05:54
Message: <4c30a352$1@news.povray.org>
>> Also... that's really kinda scary. o_O Let's hope plumbers are better...
>> uh... hmm, OK, maybe not. Well let's hope to **** that medical
>> professionals are better! O_O
> 
> the real problem is that many people who should really be plumbers or medicals
> are into programming careers.  well, plumbing may still have its uses... :)

Well, hey, at least getting programming wrong doesn't kill people...

...oh, wait:

http://en.wikipedia.org/wiki/Therac-25

Hmm. Oh dears.

Well, at least if a plumber or medical person does their job wrong, you 
can get compensation? :-}

-- 
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*


Post a reply to this message

From: Orchid XP v8
Subject: Re: FizzBuzz
Date: 4 Jul 2010 11:08:39
Message: <4c30a3f7$1@news.povray.org>
nemesis wrote:

> the real problem is that many people who should really be plumbers or medicals
> are into programming careers.  well, plumbing may still have its uses... :)

One could argue that The Real Problem(tm) is that IDE vendors keep 
claiming to have made programming "easy" now. ;-)

-- 
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*


Post a reply to this message

From: Darren New
Subject: Re: FizzBuzz
Date: 4 Jul 2010 15:35:02
Message: <4c30e266$1@news.povray.org>
Warp wrote:
> be competent programmers even though they hadn't ever written a single line
> of code.

I usually ask them to print out the prime numbers less than 100 or something.

>   On a side note, interviewers should, on the other hand, be careful with
> what they consider "trivial" assignments. 

Yeah. I had one that was something like "print the lowest N values from a 
binary tree, in C". When's the last time I did recursion in C? And doing it 
over the phone? Bleh.

-- 
Darren New, San Diego CA, USA (PST)
    C# - a language whose greatest drawback
    is that its best implementation comes
    from a company that doesn't hate Microsoft.


Post a reply to this message

From: nemesis
Subject: Re: FizzBuzz
Date: 4 Jul 2010 15:50:01
Message: <web.4c30e58b99168f12c91dc5c20@news.povray.org>
Orchid XP v8 <voi### [at] devnull> wrote:
> nemesis wrote:
>
> > the real problem is that many people who should really be plumbers or medicals
> > are into programming careers.  well, plumbing may still have its uses... :)
>
> One could argue that The Real Problem(tm) is that IDE vendors keep
> claiming to have made programming "easy" now. ;-)

still waiting for the magical "Make Solution" button... ;)


Post a reply to this message

From: Slime
Subject: Re: Binary search
Date: 4 Jul 2010 17:48:53
Message: <4c3101c5$1@news.povray.org>
> find :: (Ord y) => (x -> y) -> y -> IArray x -> (Int,Int) -> Maybe x
 > find field target array (base,size)
 > | size < 0 = error "invalid subrange size"
 > | size == 0 = Nothing
 > | size == 1 = if field (array ! base) == target then Just (array !
 > base) else Nothing
 > | otherwise =
 > let size2 = size `div` 2
 > in find field target array (base, size2) `mappend` find field target
 > array (base + size2, size - size2)

I don't know Haskell, but my best guess at understanding this code looks 
like you're always recursing into both sides, without actually doing the 
comparison of the center element to the target element. So you're not 
saving any time, and you would get faster results with a linear search. 
But maybe I just don't understand the language well enough to see the 
comparison.

  - Slime


Post a reply to this message

From: Neeum Zawan
Subject: Re: FizzBuzz
Date: 5 Jul 2010 02:51:46
Message: <87bpambetj.fsf@fester.com>
Darren New <dne### [at] sanrrcom> writes:

> Warp wrote:
> I usually ask them to print out the prime numbers less than 100 or something.

primes = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71,
73, 79, 83, 89, 91, 97]
for prime in prime:
    print prime


Post a reply to this message

From: Invisible
Subject: Re: Binary search
Date: 5 Jul 2010 03:58:09
Message: <4c319091$1@news.povray.org>
Slime wrote:
>  > find :: (Ord y) => (x -> y) -> y -> IArray x -> (Int,Int) -> Maybe x
>  > find field target array (base,size)
>  > | size < 0 = error "invalid subrange size"
>  > | size == 0 = Nothing
>  > | size == 1 = if field (array ! base) == target then Just (array !
>  > base) else Nothing
>  > | otherwise =
>  > let size2 = size `div` 2
>  > in find field target array (base, size2) `mappend` find field target
>  > array (base + size2, size - size2)
> 
> I don't know Haskell, but my best guess at understanding this code looks 
> like you're always recursing into both sides, without actually doing the 
> comparison of the center element to the target element.

Oh... my god... >_<



I blame Warp. I was so busy making sure that there's no off-by-one 
errors that I totally forgot to actually, you know, IMPLEMENT THE RIGHT 
ALGORITHM!


Post a reply to this message

From: Invisible
Subject: Re: Binary search
Date: 5 Jul 2010 04:09:56
Message: <4c319354$1@news.povray.org>
OK, 3rd time lucky: let's see if I can actually implement this thing 
correctly. :-P

find :: (Ord y) => (x -> y) -> y -> IArray x -> (Int,Int) -> Maybe x
find field target array (base,size)
   | size <  0 = error "invalid subrange size"
   | size == 0 = Nothing
   | size == 1 = if field (array ! base) == target then Just (array ! 
base) else Nothing
   | otherwise =
     let
       size2 = size `div` 2
       base2 = base + size2
     in
       case compare (field (array ! base2)) target of
         EQ -> Just (array ! base2)
         GT -> find field target array (base, size2)
         LT -> find field target array (base + size2, size - size2)

Now, finally, it should work. (But I've said that twice before already...)

Damnit, no wonder nobody loves me. :-(


Post a reply to this message

<<< Previous 4 Messages Goto Latest 10 Messages Next 10 Messages >>>

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.