Two Plus Two Publishing LLC Two Plus Two Publishing LLC
 

Go Back   Two Plus Two Poker Forums > >

Notices

Programming Discussions about computer programming

Reply
 
Thread Tools Display Modes
Old 04-18-2018, 07:56 PM   #32426
jjshabado
Carpal Tunnel
 
jjshabado's Avatar
 
Join Date: Jul 2006
Posts: 22,077
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Quote:
Originally Posted by kerowo View Post
I think it's like Algebra, some people have no problem with that substitution and some people just take forever to get past a letter being a number.


That’s not really what I meant though. I meant more that some people seem to think it’s a super critical CS concept that needs to be taught early and in great depth.

Substitution of letters for numbers in algebra is a core concept that needs to be understood early. I don’t think pointers are equivalent.

Edit: So to expand on that, I don’t think python is a bad teaching language because it obscures pointers (which I think is sort of arguable depending on how you look at it) because I don’t think explicit pointers are necessary to teach many core CS concepts.
jjshabado is offline   Reply With Quote
Old 04-18-2018, 07:59 PM   #32427
RustyBrooks
Carpal \'Tunnel
 
RustyBrooks's Avatar
 
Join Date: Feb 2006
Location: Austin, TX
Posts: 23,532
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Also this may be elitism but I think there are different paths for different types of programming learners. For someone who wants to do some programming as a hobby or to achieve some goal, you want to get them somewhere where they can Make Stuff pretty quick, web pages or desktop apps or little games or something, even if they don't understand huge parts of the system for a while.

For someone getting a CS degree, imo, this is a HUGE mistake. You need to start with the fundamentals. I would argue that pretty much any first semester data structures and algorithms class could be done in C with out any problem. And arguably the things that a language like python abstracts would not be useful at all, except perhaps for built in hashmaps. But how many first semester algorithms use hash maps?

Keep in mind that your introduction to algorithms are things like "sort an array of numbers in place", stuff that people used to do using *magnetic tape*. Or "calculate a fibonacci sequence" and stuff like that. For loops, while loops, and arrays are basically all you need for a semester or two.
RustyBrooks is offline   Reply With Quote
Old 04-18-2018, 08:02 PM   #32428
RustyBrooks
Carpal \'Tunnel
 
RustyBrooks's Avatar
 
Join Date: Feb 2006
Location: Austin, TX
Posts: 23,532
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

FWIW I think golang is actually also a pretty good first choice
RustyBrooks is offline   Reply With Quote
Old 04-18-2018, 08:04 PM   #32429
jjshabado
Carpal Tunnel
 
jjshabado's Avatar
 
Join Date: Jul 2006
Posts: 22,077
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Quote:
Originally Posted by RustyBrooks View Post
For loops, while loops, and arrays are basically all you need for a semester or two.
I don't actually have strong opinions on any of these topics, but there's a solid argument that starting like this sets you down a certain type of path and thinking. Like how your native language influences how you think.

An alternative path would be focusing on simple functional programming and even using recursion.
jjshabado is offline   Reply With Quote
Old 04-18-2018, 08:09 PM   #32430
jmakin
 
jmakin's Avatar
 
Join Date: Jan 2008
Location: Streaming
Posts: 27,373
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

I think the massive variety in CS programs is a factor here and what they want to achieve, for instance, at my school (@barrin6 can feel free to correct me on this) I felt was more theory based with some light application, at least the path I took.

The upper division for general CS where I go is almost entirely electives of your own choosing, and I happened to take a path that resulted in pretty much 0 programming outside of the occasional light assignment that required some pseudocode. This is my first quarter in 2 years where I've had to do a lot of programming. I went over a year without doing any programming at all.

Compare that to my lower divs which consisted almost entirely of programming assignments. I don't think it prepared me well for upper division at all, outside of my data structures class, which was a 4th semester course in which we implemented every basic data structure in C++ from scratch.
jmakin is offline   Reply With Quote
Old 04-18-2018, 08:17 PM   #32431
jjshabado
Carpal Tunnel
 
jjshabado's Avatar
 
Join Date: Jul 2006
Posts: 22,077
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Totally agree on a lot of these choices depending on the program and what that program is trying to achieve.
jjshabado is offline   Reply With Quote
Old 04-18-2018, 08:19 PM   #32432
jmakin
 
jmakin's Avatar
 
Join Date: Jan 2008
Location: Streaming
Posts: 27,373
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

I am totally the stereotypical CS grad that can't write a line of code. I don't think that should be an outcome for a good CS program either. I know my CS school is considered really good but I would hate to see the bad, because I have a lot to criticize.

thankfully I have 18 units of programming courses this quarter to shake off the rust before I start my job full time.
jmakin is offline   Reply With Quote
Old 04-18-2018, 08:21 PM   #32433
RustyBrooks
Carpal \'Tunnel
 
RustyBrooks's Avatar
 
Join Date: Feb 2006
Location: Austin, TX
Posts: 23,532
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Quote:
Originally Posted by jjshabado View Post
I don't actually have strong opinions on any of these topics, but there's a solid argument that starting like this sets you down a certain type of path and thinking. Like how your native language influences how you think.

An alternative path would be focusing on simple functional programming and even using recursion.
Maybe. One of the first languages I worked in professionally was sort of a loosey-goosey languages that had some functional programming aspects. Very few people knew it so we'd typically hire programmers who knew other languages and teach them. Invariably everyone would start out writing programs in this language as if it were C, which ends up with bad/crappy/slow/long programs. After a few months, a light bulb would usually go off.

I worked with a bunch of people who all got a CS degree in Italy. Getting an undergrad in CS did not involve touching a computer. Computer Science is like 90% a branch of math really.

I wonder if there are any CS programs that have really dedicated themselves to starting with high level languages only and then working their way down. I've never seen it, usually I've seen the opposite. I dunno, maybe it would work.
RustyBrooks is offline   Reply With Quote
Old 04-18-2018, 08:22 PM   #32434
codeartisan
centurion
 
codeartisan's Avatar
 
Join Date: Jun 2008
Posts: 124
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Quote:
Originally Posted by RustyBrooks View Post
I personally think people should start with C (not C++!) also. My first class was Pascal but they replaced it with C++ the next year. I actually don't think Java is a very good first choice because it has a lot of complicated and verbose syntax that makes the whole thing look more complicated than it is. C is very bare-bones syntax wise.
Pretty much my path when I was a CS undergrad. They taught us Pascal for data structures, alogorithms etc. to give us a little discipline and assembler to let us hit the metal. Once we had taken those on board they let us loose on C.

The combination meant we applied some good practices in our C code, while being able to easily understand what was going on underneath the hood when it came to pointers, function pointers, endian-ness and the like.
codeartisan is offline   Reply With Quote
Old 04-18-2018, 08:26 PM   #32435
RustyBrooks
Carpal \'Tunnel
 
RustyBrooks's Avatar
 
Join Date: Feb 2006
Location: Austin, TX
Posts: 23,532
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Regarding pointers and their importance, I know a lot of veteran programmers who are kind of hazy on the difference between the heap and the stack.

ETA: I don't mean the data structures called that, I mean the way that memory is stored in programs
RustyBrooks is offline   Reply With Quote
Old 04-18-2018, 08:28 PM   #32436
jmakin
 
jmakin's Avatar
 
Join Date: Jan 2008
Location: Streaming
Posts: 27,373
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Quote:
Originally Posted by RustyBrooks View Post
Regarding pointers and their importance, I know a lot of veteran programmers who are kind of hazy on the difference between the heap and the stack.

ETA: I don't mean the data structures called that, I mean the way that memory is stored in programs
wow, that seems kinda important because generally heap allocation is way slower than stack allocation, at least in C
jmakin is offline   Reply With Quote
Old 04-18-2018, 08:36 PM   #32437
ChrisV
Carpal \'Tunnel
 
ChrisV's Avatar
 
Join Date: Jul 2004
Location: Adelaide, Australia
Posts: 36,576
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

The dirty little secret of programming is that 90% of jobs do not require you to be able to write highly performant code. Usually there are other bottlenecks. I have spent way longer in my career optimizing SQL queries than I have optimizing code. It should be noted that the 10% of jobs which do require you to be able to do it are the lucrative ones, so I'm certainly not saying it's useless to know.
ChrisV is offline   Reply With Quote
Old 04-18-2018, 09:33 PM   #32438
:::grimReaper:::
veteran
 
:::grimReaper:::'s Avatar
 
Join Date: Jul 2010
Posts: 2,317
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Quote:
Originally Posted by saw7988 View Post
What a ridiculous conversation. Verbose boilerplate code that doesn't need to be explained to beginners is like the last reason to choose a language
It's not only code verbosity and not knowing what you're typing, it's that Java shoves OOP down your throat, which eventually a new programmer has to unlearn if they want to do anything outside of Java/C# well.
:::grimReaper::: is offline   Reply With Quote
Old 04-18-2018, 09:34 PM   #32439
:::grimReaper:::
veteran
 
:::grimReaper:::'s Avatar
 
Join Date: Jul 2010
Posts: 2,317
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Quote:
Originally Posted by jjshabado View Post
I worked with a prof that used Scheme as a beginner language and one big reason was that students could completely understand everything in the code he showed right from the start.
SICP?
:::grimReaper::: is offline   Reply With Quote
Old 04-18-2018, 09:43 PM   #32440
jmakin
 
jmakin's Avatar
 
Join Date: Jan 2008
Location: Streaming
Posts: 27,373
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

i wanted to buy that book after i just read the wiki but ugh scheme/lisp. nope nope nope
jmakin is offline   Reply With Quote
Old 04-19-2018, 12:20 AM   #32441
jjshabado
Carpal Tunnel
 
jjshabado's Avatar
 
Join Date: Jul 2006
Posts: 22,077
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Quote:
Originally Posted by :::grimReaper::: View Post
SICP?

Sort of based off of it.
jjshabado is offline   Reply With Quote
Old 04-19-2018, 01:00 AM   #32442
suzzer99
Carpal \'Tunnel
 
suzzer99's Avatar
 
Join Date: Nov 2005
Location: on top of the bell curve
Posts: 85,026
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

I agree starting with C is a good idea. I started with Fortran which is kind of in the same vein.
suzzer99 is offline   Reply With Quote
Old 04-19-2018, 03:59 AM   #32443
blackize5
adept
 
Join Date: Sep 2012
Posts: 1,183
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

MIT has been staring high level for a while. Used to be scheme I think and currently uses python.

Having taken introductory courses in Pascal, C++, and then nearly a decade later in python the latter is far superior. I do think that lower level languages should be worked into the curriculum fairly early, but I strongly believe that first exposure should be with a high level languages.

This allows you to focus on things like algorithmic thinking, basic control flow, etc without immediately running afoul of things like pointers, static typing, or manual memory management. Ideally you get students exposed to what you can do with these tools first and then start to teach how it all works. This helps with keeping people in CS programs. Stumbling across pointers right off the bat scares a lot of people away.
blackize5 is offline   Reply With Quote
Old 04-19-2018, 06:23 PM   #32444
jmakin
 
jmakin's Avatar
 
Join Date: Jan 2008
Location: Streaming
Posts: 27,373
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

it could easily be argued there are too many people in CS programs.

I get what you're saying, that the low level annoying stuff can get in the way of early problem solving.

But, there's nothing stopping a professor from providing helper functions to do that kind of stuff if it's really an issue.
jmakin is offline   Reply With Quote
Old 04-19-2018, 06:32 PM   #32445
Victor
Carpal \'Tunnel
 
Victor's Avatar
 
Join Date: Jul 2003
Posts: 59,197
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

I don't know how to use pointers. I don't know offhand a stack or heap.
Victor is offline   Reply With Quote
Old 04-19-2018, 07:28 PM   #32446
Grue
Pooh-Bah
 
Grue's Avatar
 
Join Date: Mar 2004
Location: It is pitch black.
Posts: 5,165
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

^ same but I don't care
Grue is offline   Reply With Quote
Old 04-19-2018, 07:55 PM   #32447
PJo336
THRILLHOUSE!
 
PJo336's Avatar
 
Join Date: Mar 2007
Posts: 21,505
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Quote:
Originally Posted by Grue View Post
^ same but I don't care
lol, this
PJo336 is offline   Reply With Quote
Old 04-19-2018, 10:47 PM   #32448
well named
poorly undertitled
 
well named's Avatar
 
Join Date: Jun 2007
Location: esse est coesse
Posts: 73,830
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

I can't imagine how unfulfilled I would be if I hadn't spent all that time learning about dlmalloc.
well named is offline   Reply With Quote
Old 04-20-2018, 02:13 AM   #32449
kerowo
lolcat
 
kerowo's Avatar
 
Join Date: Nov 2005
Posts: 34,473
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Quote:
Originally Posted by Victor View Post
I don't know how to use pointers. I don't know offhand a stack or heap.
Quote:
Originally Posted by Grue View Post
^ same but I don't care
Quote:
Originally Posted by PJo336 View Post
lol, this
You do you probably just call it a reference instead...
kerowo is offline   Reply With Quote
Old 04-20-2018, 07:47 AM   #32450
jjshabado
Carpal Tunnel
 
jjshabado's Avatar
 
Join Date: Jul 2006
Posts: 22,077
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

I think its important that people can understand something like this and figure out where the bug (assuming this isn't the desired functionality) is:

Code:
>>> def foo(n, l=[]):
...         l.append(n)
...         print l
>>> foo(1)
[1]
>>> foo(2)
[1, 2]
>>> foo(3,[])
[3]
>>> foo(4)
[1, 2, 4]
But I don't really care too much about deeper pointer / reference knowledge. Or like the "Is Java pass by reference or pass by value" arguments. If you know and understand how the code actually works, I don't care too much about your semantics.
jjshabado is offline   Reply With Quote

Reply
      

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Forum Jump


All times are GMT -4. The time now is 03:09 AM.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
Copyright © 2008-2017, Two Plus Two Interactive
 
 
Poker Players - Streaming Live Online