Coding: Fleeting Thoughts

A place to discuss the implementation and style of computer programs.

Moderators: phlip, Moderators General, Prelates

User avatar
Thesh
Made to Fuck Dinosaurs
Posts: 6238
Joined: Tue Jan 12, 2010 1:55 am UTC
Location: Colorado

Re: Coding: Fleeting Thoughts

Postby Thesh » Fri Oct 16, 2015 7:33 am UTC

You know, as much as I try to come up with excuses, databases simply get NULL wrong. Okay, yes, they make some good points - when MiddleName IS NULL it doesn't mean they don't have no middle name, it means that you don't know there middle name, so you can't say two people are the same by comparing their middle name - and I know it's a bad example, since you can share first, middle, and last name and still be different people.

But then when you start using set operations like UNION, INTERSECT, EXCEPT, and DISTINCT, all that logic goes out the window. If you are using strings, you can use NULL or empty, and the results are the same. To keep consistent, with the above logic, you would have to return duplicate rows whenever there is any null in any column - however, this is not done because it would be extremely annoying. Thus, for the sake of consistency, there should not be null, there should be EMPTY, which is equal to EMPTY, and not equal to a value (even if you call it NULL).

It has programming advantages too - every single programming language I know of treats null == null, so to make your business logic and your database logic consistent, EMPTY would be a much better way to handle it. Also, when writing SQL, you would be able to write "WHERE A <> B" instead of "WHERE A<> B OR (A IS NOT NULL AND B IS NULL) OR (A IS NULL AND B IS NOT NULL)"

There's also the "SELECT 1 WHERE 1 NOT IN (NULL)" problem.
Summum ius, summa iniuria.

User avatar
Moo
Oh man! I'm going to be so rebellious! I'm gonna...
Posts: 6401
Joined: Thu Aug 16, 2007 3:15 pm UTC
Location: Beyond the goblin city
Contact:

Re: Coding: Fleeting Thoughts

Postby Moo » Fri Oct 16, 2015 8:16 am UTC

Qaanol wrote:
ucim wrote:New to OOP - quick question. Say I have a bunch of unrelated classes, and they all have to be able to do foo(). As it turns out, the code (or at least the logic) for foo() is the same for all the classes. If I make a member function foo() for each class, and later change the way foo() foos, I have to change it in every class that uses it. What is the canonical way to implement a function that is identical in a bunch of unrelated classes?

And does python implement this?

Jose

I’m rather a fan of using an interface (aka. protocol) with a default implementation.
Yes, I was about to suggest an interface as well; although I'm coming at it from a C#.NET point of view. Not sure how helpful it is in Python. If still interested, have a look at this, for example:
http://www.codeproject.com/Articles/474 ... umerable-I

It discusses the built in IEnumerable interface, which shares similarities with the example you gave. It gives me the ability to implement it in otherwise unrelated classes that all need the ability to be enumerated. It is of course far more detailed than you need but the introduction and implementation examples might help you understand the general idea.
Proverbs 9:7-8 wrote:Anyone who rebukes a mocker will get an insult in return. Anyone who corrects the wicked will get hurt. So don't bother correcting mockers; they will only hate you.
Hawknc wrote:FFT: I didn't realise Proverbs 9:7-8 was the first recorded instance of "haters gonna hate"

Breakfast
Posts: 117
Joined: Tue Jun 16, 2009 7:34 pm UTC
Location: Coming to a table near you

Re: Coding: Fleeting Thoughts

Postby Breakfast » Fri Oct 16, 2015 3:01 pm UTC

ucim wrote:New to OOP - quick question. Say I have a bunch of unrelated classes, and they all have to be able to do foo(). As it turns out, the code (or at least the logic) for foo() is the same for all the classes. If I make a member function foo() for each class, and later change the way foo() foos, I have to change it in every class that uses it. What is the canonical way to implement a function that is identical in a bunch of unrelated classes?

And does python implement this?

Jose


One "pure" OO (take that with a grain of salt) way to handle this would be to put your function in it's own class. Then you would want to put member variables on the classes that would use it and pass an instance into their constructors. Bonus points for having the consuming classes use an interface so that you can pass in different implementations without changing the consumer code. This is sometimes called "poor man's dependency injection."

User avatar
roflwaffle
Posts: 360
Joined: Wed Jul 01, 2009 6:25 am UTC

Re: Coding: Fleeting Thoughts

Postby roflwaffle » Fri Oct 16, 2015 10:27 pm UTC

Thesh wrote:You know, as much as I try to come up with excuses, databases simply get NULL wrong. Okay, yes, they make some good points - when MiddleName IS NULL it doesn't mean they don't have no middle name, it means that you don't know there middle name, so you can't say two people are the same by comparing their middle name - and I know it's a bad example, since you can share first, middle, and last name and still be different people.

But then when you start using set operations like UNION, INTERSECT, EXCEPT, and DISTINCT, all that logic goes out the window. If you are using strings, you can use NULL or empty, and the results are the same. To keep consistent, with the above logic, you would have to return duplicate rows whenever there is any null in any column - however, this is not done because it would be extremely annoying. Thus, for the sake of consistency, there should not be null, there should be EMPTY, which is equal to EMPTY, and not equal to a value (even if you call it NULL).

It has programming advantages too - every single programming language I know of treats null == null, so to make your business logic and your database logic consistent, EMPTY would be a much better way to handle it. Also, when writing SQL, you would be able to write "WHERE A <> B" instead of "WHERE A<> B OR (A IS NOT NULL AND B IS NULL) OR (A IS NULL AND B IS NOT NULL)"

There's also the "SELECT 1 WHERE 1 NOT IN (NULL)" problem.

Don't quote me on this, but I think it's just *convention. The downside is that the interaction between set based operations and relational algebra results in SQL's 3VL being **functionally incomplete without the addition of IS UNKNOWN or use of IS NULL/ISNULL/etc...

* https://en.wikipedia.org/wiki/Intersect ... tersection

** https://en.wikipedia.org/wiki/Null_%28S ... predicates

User avatar
jestingrabbit
Factoids are just Datas that haven't grown up yet
Posts: 5967
Joined: Tue Nov 28, 2006 9:50 pm UTC
Location: Sydney

Re: Coding: Fleeting Thoughts

Postby jestingrabbit » Sat Oct 17, 2015 4:59 am UTC

ameretrifle wrote:Magic space feudalism is therefore a viable idea.

flownt
Posts: 70
Joined: Sat Feb 09, 2013 5:24 pm UTC

Re: Coding: Fleeting Thoughts

Postby flownt » Tue Oct 20, 2015 4:11 am UTC

jestingrabbit wrote:radium underpants.

http://idlewords.com/talks/haunted_by_data.htm


That is a very nice talk! I like your analogy with radio active waste and will use it when trying to explain my liking of online privacy.

Did the audience like it as well?

User avatar
Moo
Oh man! I'm going to be so rebellious! I'm gonna...
Posts: 6401
Joined: Thu Aug 16, 2007 3:15 pm UTC
Location: Beyond the goblin city
Contact:

Re: Coding: Fleeting Thoughts

Postby Moo » Tue Oct 20, 2015 11:50 am UTC

Dear Lord take me now

AllHell.JPG
Proverbs 9:7-8 wrote:Anyone who rebukes a mocker will get an insult in return. Anyone who corrects the wicked will get hurt. So don't bother correcting mockers; they will only hate you.
Hawknc wrote:FFT: I didn't realise Proverbs 9:7-8 was the first recorded instance of "haters gonna hate"

User avatar
Flumble
Yes Man
Posts: 2051
Joined: Sun Aug 05, 2012 9:35 pm UTC

Re: Coding: Fleeting Thoughts

Postby Flumble » Tue Oct 20, 2015 12:35 pm UTC

Isn't it clear? It's right there in the middle over and over again: a time-out.

Though to be fair, yes, that error message should be enclosed in a <pre> tag, so the newlines actually show up as newlines. (And the teletype font adds to the atmosphere.)

User avatar
Moo
Oh man! I'm going to be so rebellious! I'm gonna...
Posts: 6401
Joined: Thu Aug 16, 2007 3:15 pm UTC
Location: Beyond the goblin city
Contact:

Re: Coding: Fleeting Thoughts

Postby Moo » Tue Oct 20, 2015 12:55 pm UTC

Well yes it's quite clear what happened, from the 5 minute coma the browser goes into as much as anything. This is inside the user back end of our corporate site CRM, which our Marketing department uses to manage content. It's hardly an elegant error message for a user.
Proverbs 9:7-8 wrote:Anyone who rebukes a mocker will get an insult in return. Anyone who corrects the wicked will get hurt. So don't bother correcting mockers; they will only hate you.
Hawknc wrote:FFT: I didn't realise Proverbs 9:7-8 was the first recorded instance of "haters gonna hate"

User avatar
Flumble
Yes Man
Posts: 2051
Joined: Sun Aug 05, 2012 9:35 pm UTC

Re: Coding: Fleeting Thoughts

Postby Flumble » Tue Oct 20, 2015 1:32 pm UTC

Considering your (cheeky) edit, I guess I wasn't clear enough: it doesn't only need a <pre> tag but also green characters scrolling down a black background with a large red flashing caption reading "ERROR".


On a completely different note: can anyone explain to me what Hindley-Milner lacks as a type system? (Why is it not sufficient for (difficult) Haskell?)

User avatar
Moo
Oh man! I'm going to be so rebellious! I'm gonna...
Posts: 6401
Joined: Thu Aug 16, 2007 3:15 pm UTC
Location: Beyond the goblin city
Contact:

Re: Coding: Fleeting Thoughts

Postby Moo » Tue Oct 20, 2015 2:44 pm UTC

Edit to the second post? I removed some excessive snark. I can be less civil if you prefer? I made no edit to the first. I guess I'm not sure where our cross wires are coming from here but I guess it's not a big deal. I just think it's a horrendous way to handle errors on a client facing page.
Proverbs 9:7-8 wrote:Anyone who rebukes a mocker will get an insult in return. Anyone who corrects the wicked will get hurt. So don't bother correcting mockers; they will only hate you.
Hawknc wrote:FFT: I didn't realise Proverbs 9:7-8 was the first recorded instance of "haters gonna hate"

speising
Posts: 2272
Joined: Mon Sep 03, 2012 4:54 pm UTC
Location: wien

Re: Coding: Fleeting Thoughts

Postby speising » Tue Oct 20, 2015 4:12 pm UTC

Not only inelegant, but exposing database and implementation details to the user is always a security problem. (See little bobby tables)

korona
Posts: 495
Joined: Sun Jul 04, 2010 8:40 pm UTC

Re: Coding: Fleeting Thoughts

Postby korona » Tue Oct 20, 2015 7:08 pm UTC

Flumble wrote:On a completely different note: can anyone explain to me what Hindley-Milner lacks as a type system? (Why is it not sufficient for (difficult) Haskell?)

I'm not a Haskell expert, but Hindley-Milner is incapable of expressing the construction that guarantees the safety of the state monad. Haskell (which is Hindley-Milner + some extensions AFAIK) on the other hand is not powerful enough to express concepts that require dependent types. You cannot define a "n-dimensional vector space" type in Haskell as that would require a type that depends on an integer.

User avatar
headprogrammingczar
Posts: 3072
Joined: Mon Oct 22, 2007 5:28 pm UTC
Location: Beaming you up

Re: Coding: Fleeting Thoughts

Postby headprogrammingczar » Wed Oct 21, 2015 12:13 am UTC

You're going to have to explain that first point, because State is perfectly expressible in H-M as far as I am aware.

A good thing to mention that that Haskell does above and beyond H-M is type classes. Or you can even just run down the list of GHC extensions. Rank-N types are notable for being impossible to infer (which H-M notably guarantees for all programs).
<quintopia> You're not crazy. you're the goddamn headprogrammingspock!
<Weeks> You're the goddamn headprogrammingspock!
<Cheese> I love you

User avatar
chridd
Has a vermicelli title
Posts: 824
Joined: Tue Aug 19, 2008 10:07 am UTC
Location: ...Earth, I guess?
Contact:

Re: Coding: Fleeting Thoughts

Postby chridd » Wed Oct 21, 2015 1:46 am UTC

headprogrammingczar wrote:You're going to have to explain that first point, because State is perfectly expressible in H-M as far as I am aware.
Perhaps ze's thinking of the ST monad. (And yeah, I think the State monad is expressible in H-M.)
~ chri d. d. /tʃɹɪ.di.di/ (Phonotactics, schmphonotactics) · she(?)(?(?)(?))(?(?(?))(?))(?) · Forum game scores
mittfh wrote:I wish this post was very quotable...
flicky1991 wrote:In both cases the quote is "I'm being quoted too much!"
chridd (on Discord) wrote:
Dummy wrote:Sorry You're Gay Dads
SYG'D

korona
Posts: 495
Joined: Sun Jul 04, 2010 8:40 pm UTC

Re: Coding: Fleeting Thoughts

Postby korona » Wed Oct 21, 2015 2:31 pm UTC

chridd wrote:
headprogrammingczar wrote:You're going to have to explain that first point, because State is perfectly expressible in H-M as far as I am aware.
Perhaps ze's thinking of the ST monad. (And yeah, I think the State monad is expressible in H-M.)

Oops, you're right. Thank you for the correction.

User avatar
Flumble
Yes Man
Posts: 2051
Joined: Sun Aug 05, 2012 9:35 pm UTC

Re: Coding: Fleeting Thoughts

Postby Flumble » Thu Oct 22, 2015 11:39 am UTC

Moo wrote:Edit to the second post? I removed some excessive snark. I can be less civil if you prefer? I made no edit to the first. I guess I'm not sure where our cross wires are coming from here but I guess it's not a big deal. I just think it's a horrendous way to handle errors on a client facing page.

Ah, it was snarkiness beforehand (I couldn't parse it unambiguously); I thought my satirizing the error presentation maybe wasn't clear in my first reaction. The more civil edit made it clear to me that the intent of my post did come across, so yeah, one vote in favour of being more civil when it reduces noise in communication. :P


headprogrammingczar wrote:A good thing to mention that that Haskell does above and beyond H-M is type classes. Or you can even just run down the list of GHC extensions. Rank-N types are notable for being impossible to infer (which H-M notably guarantees for all programs).

Thanks, I assumed H-M already deals with type classes.
I think my brain is not yet ready for rank-k or rank-n types or the ST monad for that matter, so I have some learning to do first. :roll:

User avatar
The Great Hippo
Swans ARE SHARP
Posts: 7100
Joined: Fri Dec 14, 2007 4:43 am UTC
Location: behind you

Re: Coding: Fleeting Thoughts

Postby The Great Hippo » Fri Oct 23, 2015 10:10 am UTC

I'm experimenting with a class in Python 3 that instances objects which ONLY exist as keys in a particular dictionary. They represent the "range" of possible states for another type of object (events).

I'm overriding the __eq__ built-in (the equality operator) so that these key-objects compare as equal to any event object that falls within key's defined "range". I'm setting __hash__ appropriately. However...

Is this "bad practice"? I'm making an object that evaluates as equal to a group of objects that don't necessarily equal each other. IE, I'm ignoring the transitive property: A = B, and A = C, but B does NOT necessarily equal C. I'm ONLY breaking this rule inside of a single dictionary (which uses ONLY this type of object as a key), but I'm concerned it might create unexpected problems elsewhere.

Ubik
Posts: 1016
Joined: Thu Oct 18, 2007 3:43 pm UTC

Re: Coding: Fleeting Thoughts

Postby Ubik » Fri Oct 23, 2015 10:36 am UTC

The second sentence in your post gives me the impression like you're about to create an enumeration / enumerated type, or at least something very similar to them. It also looks like there already is a python module for it, enum, maybe there's something useful there.

User avatar
The Great Hippo
Swans ARE SHARP
Posts: 7100
Joined: Fri Dec 14, 2007 4:43 am UTC
Location: behind you

Re: Coding: Fleeting Thoughts

Postby The Great Hippo » Fri Oct 23, 2015 11:16 am UTC

Thanks! I'm reading about them now; I'm a little fuzzy on how this works, but aliasing might get me where I want to go.

(Effectively, I want to associate a "range" of possible object states with a set of objects; for example, all events of type X with set A, and all events with type X *and* attribute Y with set B.)

(...And I just realized a problem with this setup; it would mean I'd have a dictionary that would be expected to return *multiple* values.)

User avatar
firechicago
Posts: 621
Joined: Mon Jan 11, 2010 12:27 pm UTC
Location: One time, I put a snowglobe in the microwave and pushed "Hot Dog"

Re: Coding: Fleeting Thoughts

Postby firechicago » Fri Oct 23, 2015 11:30 am UTC

The Great Hippo wrote:Is this "bad practice"? I'm making an object that evaluates as equal to a group of objects that don't necessarily equal each other. IE, I'm ignoring the transitive property: A = B, and A = C, but B does NOT necessarily equal C. I'm ONLY breaking this rule inside of a single dictionary (which uses ONLY this type of object as a key), but I'm concerned it might create unexpected problems elsewhere.

I haven't written enough Python to know what's considered good or bad practice, but this seems like it would be a maintainability nightmare, if only because anyone who doesn't know exactly how and why you built it this way is going to find this wildly unintuitive and surprising behavior. (And remember, the set of people who don't know exactly how and why this was built this way probably includes you in six months when you trace a bug back to this piece of code).

User avatar
ahammel
My Little Cabbage
Posts: 2135
Joined: Mon Jan 30, 2012 12:46 am UTC
Location: Vancouver BC
Contact:

Re: Coding: Fleeting Thoughts

Postby ahammel » Fri Oct 23, 2015 2:04 pm UTC

The Great Hippo wrote:I'm experimenting with a class in Python 3 that instances objects which ONLY exist as keys in a particular dictionary. They represent the "range" of possible states for another type of object (events).
Do you need to mutate this dict? It sounds like you might be better served by a function

Code: Select all

def f(thing):
    if thing in an_enum: return foo
    elif thing in another_enum: return bar
    elif ...


Or, if the keys are static but the events change along with program state, you might be able to encapsulate the value of the state and send it as an argument to your function:

Code: Select all

def f(thing, state):
    if thing in an_enum: return foo(thing, state)
    elif thing in another_enum: return bar(thing, state)


This would have the additional desirable property of doing the same thing regardless of the global state, which is handy for testing and reasoning about correctness.

If you really do need mutability, though, I'd probably write a RangedDict class that owns the logic, rather than try to press ordinary dicts into service. I don't think over riding __eq__ with a method that doesn't calculate equality is a great idea.
He/Him/His/Alex
God damn these electric sex pants!

Dr. Willpower
Posts: 197
Joined: Wed May 28, 2008 3:55 pm UTC

Re: Coding: Fleeting Thoughts

Postby Dr. Willpower » Fri Oct 23, 2015 5:04 pm UTC

I can't speak to the goal that you're trying to accomplish, but referring to the __eq__ operator: People will generally assume that __eq__ means that objects are equal (whatever that means, I'm not exactly a python guru). If you're not worried about anyone else ever using or modifying this code, it might be ok. Then again, if you are, you might want to create a special area in the code where this specifically applies. Then inform potential users that when working in this zone, things will not behave as expected.

To me what you're describing sounds like identifying objects with particular sets of properties- i.e. some kind of filtering. Perhaps it would be more beneficial to make some kind of class or function that groks events into categories. You could even define the categories to come with their own grokking filters, and apply them as necessary. Then you could wrap events in the catergory class to get some behavior, and unwrap it again when you're done with it?

Something like this:

Code: Select all

Object:
    grok_event_into_category(event) => class_name
    add_filter(class_name)

category:
    filter(event) => boolean (belongs or not)
    wrap(event)
    unwrap() => event (the one we were keeping inside, with possible modifications)

    ...
    do_stuff_to_event_according_to_our_category_rules(event)
    ...

event:
    some => property
    properties => property
    here => property
Image
Hat me, bro

User avatar
The Great Hippo
Swans ARE SHARP
Posts: 7100
Joined: Fri Dec 14, 2007 4:43 am UTC
Location: behind you

Re: Coding: Fleeting Thoughts

Postby The Great Hippo » Sat Oct 24, 2015 11:39 am UTC

I appreciate all the responses!

firechicago: Yeah, I see what you mean; in retrospect I can see how this could devolve into a nightmare, especially if I started using the dictionary for other stuff (without realizing it).

ahammel: Regrettably, yeah -- it needs to be mutable. Both events and the keys are dynamically generated by the code. However -- a 'RangedDict' is actually probably a pretty good approach; my initial reasoning for not wanting to do it was that I don't know how dictionaries do key lookup (and so just overriding __eq__ and relying on Python to do the lookup would be faster/more effective), but after some investigation it appears that all I have to do is twerk dict.keys().

Dr. Willpower: That approach might work too; actually, I've been tinkering around with ways to arbitrarily organize event objects into groups, and something like that might work.

User avatar
ahammel
My Little Cabbage
Posts: 2135
Joined: Mon Jan 30, 2012 12:46 am UTC
Location: Vancouver BC
Contact:

Re: Coding: Fleeting Thoughts

Postby ahammel » Sat Oct 24, 2015 4:00 pm UTC

The Great Hippo wrote:ahammel: Regrettably, yeah -- it needs to be mutable. Both events and the keys are dynamically generated by the code. However -- a 'RangedDict' is actually probably a pretty good approach; my initial reasoning for not wanting to do it was that I don't know how dictionaries do key lookup (and so just overriding __eq__ and relying on Python to do the lookup would be faster/more effective), but after some investigation it appears that all I have to do is twerk dict.keys().
Honestly, I would just write my own rather than inheriting from the built-in dict object. It would be easy enough to store key-value pairs in a sorted list and do key lookup by a binary search. That makes key lookup O(log n) rather than amoritized constant, but that's probably not a big deal unless they're huge or very frequently accessed.
He/Him/His/Alex
God damn these electric sex pants!

User avatar
Whizbang
The Best Reporter
Posts: 2238
Joined: Fri Apr 06, 2012 7:50 pm UTC
Location: New Hampshire, USA

Re: Coding: Fleeting Thoughts

Postby Whizbang » Sun Oct 25, 2015 12:37 am UTC

CFT, coding on an iPad is a pain.

User avatar
jestingrabbit
Factoids are just Datas that haven't grown up yet
Posts: 5967
Joined: Tue Nov 28, 2006 9:50 pm UTC
Location: Sydney

Re: Coding: Fleeting Thoughts

Postby jestingrabbit » Sun Oct 25, 2015 10:20 pm UTC

flownt wrote:
jestingrabbit wrote:radium underpants.

http://idlewords.com/talks/haunted_by_data.htm


That is a very nice talk! I like your analogy with radio active waste and will use it when trying to explain my liking of online privacy.

Did the audience like it as well?


That isn't my talk, I just wanted to give it a bit more bandwidth. And yes, the core analogy is very strong. Data vs Radiation lines up really well, and I think we're going to reverse our opinion of data lakes pretty quickly.
ameretrifle wrote:Magic space feudalism is therefore a viable idea.

User avatar
Xenomortis
Not actually a special flower.
Posts: 1421
Joined: Thu Oct 11, 2012 8:47 am UTC

Re: Coding: Fleeting Thoughts

Postby Xenomortis » Mon Oct 26, 2015 1:59 pm UTC

I am not currently looking for a new job.
But when that time comes, I will have to remember to avoid any workplace that uses Eclipse or anything related to it.
Image

User avatar
Flumble
Yes Man
Posts: 2051
Joined: Sun Aug 05, 2012 9:35 pm UTC

Re: Coding: Fleeting Thoughts

Postby Flumble » Mon Oct 26, 2015 2:10 pm UTC

But eclipse is just one exchangeable tool in a large chain. How bad can it be?

User avatar
Xenomortis
Not actually a special flower.
Posts: 1421
Joined: Thu Oct 11, 2012 8:47 am UTC

Re: Coding: Fleeting Thoughts

Postby Xenomortis » Mon Oct 26, 2015 2:26 pm UTC

It was designed by a drunk goldfish and implemented by sober children?

The daily crash aside (and it really is daily), it's unbelievably slow on startup, insists on rebuilding things that are already built and haven't changed, frequently chokes trying to open files, and when it does crash, there's something like a 50% chance I have to clean and rebuild all of my projects to get things working again.

And then there's this notion of "workspaces". Seriously, that shit is annoying.
Image

User avatar
Yakk
Poster with most posts but no title.
Posts: 11083
Joined: Sat Jan 27, 2007 7:27 pm UTC
Location: E pur si muove

Re: Coding: Fleeting Thoughts

Postby Yakk » Mon Oct 26, 2015 2:48 pm UTC

Is there no way to replace the IDE build process with a make file process?

You get UI-free building (easier to script), more reliable building (no crashy IDE), programmer-configurable build steps in text, etc.

And, presuming it doesn't suck, you should be able to insert it as a custom build or custom build step into the IDE, no?
One of the painful things about our time is that those who feel certainty are stupid, and those with any imagination and understanding are filled with doubt and indecision - BR

Last edited by JHVH on Fri Oct 23, 4004 BCE 6:17 pm, edited 6 times in total.

User avatar
Flumble
Yes Man
Posts: 2051
Joined: Sun Aug 05, 2012 9:35 pm UTC

Re: Coding: Fleeting Thoughts

Postby Flumble » Mon Oct 26, 2015 3:41 pm UTC

Does anyone know the paper/article about middle school children(?) answering a variable assignment question before and after being taught how it works and the kids basically either understood it from the start or didn't learn it at all?

I thought I heard about it in this topic, or at least this forum, but I can't find it.

User avatar
Xenomortis
Not actually a special flower.
Posts: 1421
Joined: Thu Oct 11, 2012 8:47 am UTC

Re: Coding: Fleeting Thoughts

Postby Xenomortis » Mon Oct 26, 2015 4:07 pm UTC

This one?
http://www.eis.mdx.ac.uk/research/PhDAr ... paper1.pdf

I believe it's for first year undergrads though, not middle-school students.

(Linked to here: http://blog.codinghorror.com/separating ... ing-goats/)
Image

EvanED
Posts: 4331
Joined: Mon Aug 07, 2006 6:28 am UTC
Location: Madison, WI
Contact:

Re: Coding: Fleeting Thoughts

Postby EvanED » Mon Oct 26, 2015 4:16 pm UTC

Xenomortis wrote:This one?
http://www.eis.mdx.ac.uk/research/PhDAr ... paper1.pdf

I believe it's for first year undergrads though, not middle-school students.

(Linked to here: http://blog.codinghorror.com/separating ... ing-goats/)

That paper has been retracted, which should be completely unsurprising because even if the data is correct the conclusions and editoralizing were and are pure BS (or at least unsupportable from the evidence). And more recently, others have tried to replicate the prediction results and have had questionable success at best.

It’s not enough to summarise the scientific result, because I wrote and web-circulated “The camel has two humps” in 2006. That document was very misleading and, in the way of web documents, it continues to mislead to this day. I need to make an explicit retraction of what it claimed. Dehnadi didn’t discover a programming aptitude test. He didn’t find a way of dividing programming sheep from non-programming goats. We hadn’t shown that nature trumps nurture.


Frankly, the fact that a notice to that effect hasn't been edited into the CodingHorror blog post I think is dishonest. (Jeff Atwood may not be aware, though there's a reasonable chance he saw a post I made on another forum about this and in which I explicitly tagged him. I can't confirm he saw it though.)

User avatar
Xenomortis
Not actually a special flower.
Posts: 1421
Joined: Thu Oct 11, 2012 8:47 am UTC

Re: Coding: Fleeting Thoughts

Postby Xenomortis » Mon Oct 26, 2015 4:36 pm UTC

I seem to remember the advice "when reading a scientific paper, start with the results" or something to that affect, only reading the author's conclusions and notes until you've made your own.
Ambitious conclusions are not uncommon.
Image

EvanED
Posts: 4331
Joined: Mon Aug 07, 2006 6:28 am UTC
Location: Madison, WI
Contact:

Re: Coding: Fleeting Thoughts

Postby EvanED » Mon Oct 26, 2015 4:52 pm UTC

There's a difference between "overly-ambitious conclusion borne out of wishful thinking" and "holy hell how did this thing even get published in this current state."

User avatar
Flumble
Yes Man
Posts: 2051
Joined: Sun Aug 05, 2012 9:35 pm UTC

Re: Coding: Fleeting Thoughts

Postby Flumble » Mon Oct 26, 2015 4:59 pm UTC

Thanks guys! Especially for the detailed retraction.

commodorejohn
Posts: 1109
Joined: Thu Dec 10, 2009 6:21 pm UTC
Location: Placerville, CA
Contact:

Re: Coding: Fleeting Thoughts

Postby commodorejohn » Mon Oct 26, 2015 5:50 pm UTC

EvanED wrote:Frankly, the fact that a notice to that effect hasn't been edited into the CodingHorror blog post I think is dishonest. (Jeff Atwood may not be aware, though there's a reasonable chance he saw a post I made on another forum about this and in which I explicitly tagged him. I can't confirm he saw it though.)

Have you considered emailing him directly? Seems like a more likely proposition than mentioning him somewhere and hoping he notices. His email address is on this page (though you have to enable Javascript to get it.)
"'Legacy code' often differs from its suggested alternative by actually working and scaling."
- Bjarne Stroustrup
www.commodorejohn.com - in case you were wondering, which you probably weren't.

schapel
Posts: 244
Joined: Fri Jun 13, 2014 1:33 am UTC

Re: Coding: Fleeting Thoughts

Postby schapel » Mon Oct 26, 2015 6:18 pm UTC

Flumble wrote:Does anyone know the paper/article about middle school children(?) answering a variable assignment question before and after being taught how it works and the kids basically either understood it from the start or didn't learn it at all?

This is a common problem in teaching. Students often think they know the answers already and don't really listen to the explanation. Then they end up being more confident in their misconceptions.

EvanED
Posts: 4331
Joined: Mon Aug 07, 2006 6:28 am UTC
Location: Madison, WI
Contact:

Re: Coding: Fleeting Thoughts

Postby EvanED » Mon Oct 26, 2015 6:38 pm UTC

commodorejohn wrote:
EvanED wrote:Frankly, the fact that a notice to that effect hasn't been edited into the CodingHorror blog post I think is dishonest. (Jeff Atwood may not be aware, though there's a reasonable chance he saw a post I made on another forum about this and in which I explicitly tagged him. I can't confirm he saw it though.)

Have you considered emailing him directly? Seems like a more likely proposition than mentioning him somewhere and hoping he notices. His email address is on this page (though you have to enable Javascript to get it.)
I did think about emailing, and maybe I'll do that this time around. That being said, "hoping he notices" isn't as close to "hope he stumbles across it" as it would be here; I @-mentioned him on a Discourse blog that I know he visits, so it would have shown up as a notification. It's more like "hope he hasn't turned off notifications and isn't always completely overwhelmed by their number" or something like that.


Return to “Coding”

Who is online

Users browsing this forum: No registered users and 3 guests