Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
double sulk
Jul 2, 2010

i already thought that javascript was terrible, but holy gently caress this book is eye opening

Adbot
ADBOT LOVES YOU

FamDav
Mar 29, 2008

Toady posted:

stack memory, references, and so on aren't taught from the start, so it's a bunch of fundamentals dumped suddenly into people's laps via ugly memory diagrams that look as complicated and computer sciencey as possible

One of the many problems with explaining pointers within a language like C(++) is having to deal with things like

code:
x = *ptr+1;
y = *(ptr+1);
And explaining why the latter even works. Apparently at UCLA (lol joke school) they drill this by having you solve by hand this worksheet of ridiculous pointer manipulation for a homework. I guess you're supposed to learn to never make extensive use of pointers because pointers are a bad.

EDIT:

Having to learn about stack vs. heap, how stack frames work wrt function calls, the concept of function calls themselves, or even just how assignment works is hard for many people. Trying to teach all of this at once in an introductory CS course is a good way to cut your numbers down quickly, but it in no way separates the bad from the good. Instead, teach a Python or a Ruby and ways to deconstruct problems in the intro course; leave pointers to a data structures or architecture class.

There's this habit of engineers/science types/etc. to look down on people who don't immediately grok concepts in their particular field, when usually their understanding comes from previous experience. If you don't shame these people (like in every other discipline) you usually find that they can/will do as well as the people who knew all of the introductory information beforehand.

FamDav fucked around with this message at 05:40 on Jan 7, 2013

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde
Stanford has a course dedicated 100% to explaining the concept that programs run on hardware

Socracheese
Oct 20, 2008

i had a course like that, they teach you about processor clocks and ram chips and stuff but my course was hilariously outdated and taught by a really old guy. the labs were in GNU-ARM assembly, I couldn't find any trace of the software we were using on google, and I remember the prof saying something like "so then these ram modules get chained together to make huge reserves of ram, 64 megabytes, maybe even more in modern pcs"

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde

Socracheese posted:

i had a course like that, they teach you about processor clocks and ram chips and stuff
CS107 isn't the computer architecture course (tho obviously they have that too)

the computer architecture course is taught by this greek prof who mumbles the last part of every sentence, thank god i never had to take that one

Deus Rex
Mar 5, 2005

FamDav posted:

Diffeqs was fun because there were a bunch of bio or chem or whatever people in it and they were all bad at math.

chemistry people aren't bad at math <:mad:>

Luigi Thirty
Apr 30, 2006

Emergency confection port.

college status: accidentally enrolled in a java security class, too late to fix that. barely know any java. should be fun.

weird
Jun 4, 2012

by zen death robot
I wrote a sudoku solver in Dylan, and it's a pretty nice language overall, but prefix-dylan would probably be a lot nicer. With deeply nested function calls I think it's easier to read when the brackets delimit complete function calls rather than just the arguments. The verbosity is a turn-off, too, and if you're using lots of lambdas then having those 'end's sprinkled everywhere looks pretty bad. Even for a simple (contrived) example, I think
code:
(define l3 (map (lambda (x) (* x x))
                (filter (lambda (x) (member? x l1))
                        l2)))
looks a lot cleaner than
code:
define variable l3 = map(method(x) x * x end,
                         choose(method(x) member?(x, l1) end,
                                l2));
And it looks worse and worse the more complex the things you're doing are, whereas Lisp holds up. Plus the Lisp/Scheme naming conventions look awful with the Algolish syntax (eg, member?(x, l), *table*[key]).

Obviously I'm just sperging about silly syntax things, and it's a really nice language in the ways that actually matter, but it's just super ugly compared to how it would look with a less verbose and more Lispy syntax.

tef
May 30, 2004

-> some l-system crap ->
so i tried a lisp that wasn't lisp and wanted lisp

Workaday Wizard
Oct 23, 2009

by Pragmatica

tef posted:

so i tried a lisp that wasn't lisp and wanted lisp

do your parents know you are lispian?

Dans Macabre
Apr 24, 2004


https://github.com/billiob/bfb/blob/master/code.bfpp

EVGA Longoria
Dec 25, 2005

Let's go exploring!

how long has it been since someone pointed out perl owns?

cause perl owns.

X-BUM-RAIDER-X
May 7, 2008
yeah

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde

X-BUM-RAIDER-X
May 7, 2008
lol if you code your irc bots in anything but perl

Jonny 290
May 5, 2005



[ASK] me about OS/2 Warp
perl's pretty cool. its back burner for me this spring though. its java time

X-BUM-RAIDER-X
May 7, 2008

Jonny 290 posted:

perl's pretty cool. its back burner for me this spring though. its java time

you'll be back before long, and when you are, don't expect any special treatment from us.

Zombywuf
Mar 29, 2008

Notorious b.s.d. posted:

i never understood what was so hard about pointers. if pointers are hard, how do people manage to learn java or perl or whatever, where almost everything is a pointer all the time

i am not being facetious this is a completely real question

Because most programming courses go something like this:

* Hello World
* 100 bottles of beer
* Variables are allocated on the stack and pointers reference data allocated on the heap, to allocate memory on the heap use malloc and release it with free. Go implement a red-black tree
* Everyone who doesn't already know how to program drops out.

Of course in a non-C course it goes more like:

* Hello World
* 100 bottles of beer
* This language doesn't have pointers, rejoice because we have freed you from the tyranny of malloc and free. Go implement a red-black tree
* Everyone who doesn't already know how to program drops out.

Sneaking Mission
Nov 11, 2008

when is school going to be back in session so there will be people who want to talk about prolog again?

prefect
Sep 11, 2001

No one, Woodhouse.
No one.




Dead Man’s Band

Zombywuf posted:

Because most programming courses go something like this:

* Hello World
* 100 bottles of beer
* Variables are allocated on the stack and pointers reference data allocated on the heap, to allocate memory on the heap use malloc and release it with free. Go implement a red-black tree
* Everyone who doesn't already know how to program drops out.

Of course in a non-C course it goes more like:

* Hello World
* 100 bottles of beer
* This language doesn't have pointers, rejoice because we have freed you from the tyranny of malloc and free. Go implement a red-black tree
* Everyone who doesn't already know how to program drops out.

When is "Towers of Hanoi"?

Jonny 290
May 5, 2005



[ASK] me about OS/2 Warp

prefect posted:

When is "Towers of Hanoi"?

that's 102 because you need recursion

Zombywuf
Mar 29, 2008

prefect posted:

When is "Towers of Hanoi"?

At my uni it was in AI class. We used Prolog.

EVGA Longoria
Dec 25, 2005

Let's go exploring!

Jonny 290 posted:

perl's pretty cool. its back burner for me this spring though. its java time

the other real perl developer here is starting to get on a groovy kick, so there's a good chance i'll be playing around with that before long, then i have to remember the bits of java i taught myself when i was a youngin and see how terrible it is

Blotto Skorzany
Nov 7, 2008

He's a PSoC, loose and runnin'
came the whisper from each lip
And he's here to do some business with
the bad ADC on his chip
bad ADC on his chiiiiip

OBAMA BIN LinkedIn posted:

lol if you code your irc bots in anything but perl

ps someone should take over the lovely perl irc bot i wrote years ago that lives in #cobol and a couple other channels probably because i don't feel like paying for my vps any more

FamDav
Mar 29, 2008

Sneaking Mission posted:

when is school going to be back in session so there will be people who want to talk about prolog again?

Prolog is p based. based god swag jerry rice cookin' cookin' cookin'.

MononcQc
May 29, 2007

My guess is that people have more trouble with C and C++'s type notation for pointers and arrays than the concept of pointers themselves. I don't remember people in my class seeming to struggle too much with either allocating or deallocating or constructors and destructors except a few simple gotchas, but I remember them being annoyed by -> vs. . to access members of a struct/class, or trying to use arbitrary sized multidimensional arrays as arguments whatnot, and especially being tripped up in the bit where an array is a pointer but not really.

Similarly, I remember people having a decent understanding of many data structures, but struggling with C++ to implement them more than anything. I'm thinking the problem with understanding pointers is more "how the hell does C and C++ do them" rather than "what are they?".

I don't think the concept is extremely hard in either cases, but it is certainly harder in C and C++ than other languages.

FamDav
Mar 29, 2008

MononcQc posted:

My guess is that people have more trouble with C and C++'s type notation for pointers and arrays than the concept of pointers themselves. I don't remember people in my class seeming to struggle too much with either allocating or deallocating or constructors and destructors except a few simple gotchas, but I remember them being annoyed by -> vs. . to access members of a struct/class, or trying to use arbitrary sized multidimensional arrays as arguments whatnot, and especially being tripped up in the bit where an array is a pointer but not really.

Similarly, I remember people having a decent understanding of many data structures, but struggling with C++ to implement them more than anything. I'm thinking the problem with understanding pointers is more "how the hell does C and C++ do them" rather than "what are they?".

I don't think the concept is extremely hard in either cases, but it is certainly harder in C and C++ than other languages.

This actually reminds me of Plangs the class, wherein the first thing we did in each language we looked at was implemented a BST. When we had to do it in say-ploos-ploos the entire class just shut down and assumed the fetal position. My one friend who is otherwise competent poo poo out this 300 line monstrosity of unworkable C++ trying to implement left pointer right pointer value.

Dicky B
Mar 23, 2004

Pascal is probably a good language for teaching pointers

double sulk
Jul 2, 2010

objective c, where almost everything is a pointer

double sulk
Jul 2, 2010

it's a horrible first language through and what I learned on when i got back into programming :(

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe

Notorious b.s.d. posted:

i never understood what was so hard about pointers. if pointers are hard, how do people manage to learn java or perl or whatever, where almost everything is a pointer all the time

i am not being facetious this is a completely real question

well theres some crazy pointer garbage sometimes where some code allocates a giant chunk of memory and does crazy things with pointer arithmetic and filling it where it does long *my_thing = ((long *)foo)[1];

thats not possible in java or p langs they restrict you to actually writing good code

Tiny Bug Child
Sep 11, 2004

Avoid Symmetry, Allow Complexity, Introduce Terror
pointers are useless unless you're programming in some antiquated language that makes you manage your own memory

FamDav
Mar 29, 2008
Sometimes just to gently caress with people I check in member function pointers and they just fuckin stare in code review.

FamDav
Mar 29, 2008
like i had to explain to this old dude i work with (worked on tribes, p cool actually) where the variable declaration was.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
int (*gently caress) (char *c, const char * const *syntax[]);

X-BUM-RAIDER-X
May 7, 2008

Tiny Bug Child posted:

pointers are useless unless you're programming in some antiquated language that makes you manage your own memory

X-BUM-RAIDER-X
May 7, 2008
also that is basically only C

FamDav
Mar 29, 2008

Suspicious Dish posted:

int (HeteroEarth::*gently caress) (char* c, char const * const * syntax[]);

better.

Also member pointers are actually useful but they have similarly confusing syntax, e.g.

C++ code:
int std::map<int>::* const
Also unironically kill yourself if you don't always put your consts to the right.

FamDav fucked around with this message at 20:44 on Jan 7, 2013

Zombywuf
Mar 29, 2008

MononcQc posted:

My guess is that people have more trouble with C and C++'s type notation for pointers and arrays than the concept of pointers themselves. I don't remember people in my class seeming to struggle too much with either allocating or deallocating or constructors and destructors except a few simple gotchas, but I remember them being annoyed by -> vs. . to access members of a struct/class, or trying to use arbitrary sized multidimensional arrays as arguments whatnot, and especially being tripped up in the bit where an array is a pointer but not really.

Back when I learned C the biggest difficulty with pointers was simply that "*foo" is a value, "&foo" is a pointer to foo and "int *foo" is the declaration of a pointer to a value. I wonder how different the history of programming languages would be if "int &foo" was the syntax for pointer declarations.

Adbot
ADBOT LOVES YOU

MononcQc
May 29, 2007

best way to read C/C++ types: Clockwise/Spiral Rule

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply