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
lifg
Dec 4, 2000
<this tag left blank>
Muldoon
A lot of early computer science education is useful lies, and then you spend the rest of your life learning you were lied too. But usefully.

Adbot
ADBOT LOVES YOU

LLSix
Jan 20, 2010

The real power behind countless overlords

lifg posted:

A lot of education is useful lies, and then you spend the rest of your life learning you were lied to. But usefully.

Fixed that for you.


On a somewhat related note, those of you who get to write in modern languages don't know how good you have it. Our fresh-out-of-college hire doesn't understand binary and we've got a bunch of bit flags I've been trying to teach them about. They're making progress but its slow going.

LLSix fucked around with this message at 22:30 on Apr 13, 2023

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


Yeah, nothing special about CS here. If anything it's one of the fields where your undergraduate classes come closest to the truth.

Itaipava
Jun 24, 2007
So what exactly is "useful" about learning about arrays vs lists, and then later finding out that most "lists" are actually arrays? I guess it's always useful to learn that the world is a gently caress and out to get you at every turn (except apparently Scala)

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

Itaipava posted:

So what exactly is "useful" about learning about arrays vs lists, and then later finding out that most "lists" are actually arrays? I guess it's always useful to learn that the world is a gently caress and out to get you at every turn (except apparently Scala)

Linked lists are useful to learn about because they demonstrate concepts necessary to talk about trees.

TooMuchAbstraction
Oct 14, 2012

I spent four years making
Waves of Steel
Hell yes I'm going to turn my avatar into an ad for it.
Fun Shoe

Itaipava posted:

So what exactly is "useful" about learning about arrays vs lists, and then later finding out that most "lists" are actually arrays? I guess it's always useful to learn that the world is a gently caress and out to get you at every turn (except apparently Scala)

A lot of early data structures are mostly useful because they're something you can build/use when you're still getting a grasp on the basic task of getting the computer to do what you want them to do. The real thing being taught is how to be a massive pedant.

Itaipava
Jun 24, 2007
No I mean what's useful about the lying. Why do they call them lists if they are arrays??

lifg
Dec 4, 2000
<this tag left blank>
Muldoon
When you first learn about arrays v lists you’re only looking at a couple pieces of complexity, mostly time, and at a very theoretical level.

The reason a programming language might store lists as arrays is because they’re dealing actual users and modern CPUs and such, and there’s a lot more factors to make trade offs with.

Edit: didn’t see your post before I hit post. I dunno on that point.

Achmed Jones
Oct 16, 2004



Itaipava posted:

No I mean what's useful about the lying. Why do they call them lists if they are arrays??

it isn't lying. usually you're looking at standard list semantics, and being backed by an array is an implementation detail. same reason it's not lying to call it a heap even though it's backed by an array, and it's not lying to call it a hashmap even though collisions are backed by a list instead of next-bucket

bob dobbs is dead
Oct 8, 2017

I love peeps
Nap Ghost
the reason is locality on them lists is poo poo, which is really a feature of modern compute

TooMuchAbstraction
Oct 14, 2012

I spent four years making
Waves of Steel
Hell yes I'm going to turn my avatar into an ad for it.
Fun Shoe

Itaipava posted:

No I mean what's useful about the lying. Why do they call them lists if they are arrays??

The semantics of how you interact with the data structure depend on what type it declares itself to be. In particular, lists provide easy resizing (by adding and removing elements), while arrays generally force the user to perform resizing manually.

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice
Fwiw in c# we first had ArrayLists which is an accepted synonym for a dynamic array but when they introduced the generic version they went with List<T>. I don't know why though.

bob dobbs is dead
Oct 8, 2017

I love peeps
Nap Ghost
4 < 9

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice

Probably this. C# has generally avoided the really long namespace + class names of Java, maybe it's even a goal of the designers idk. Never really thought about it.

Erg
Oct 31, 2010

prom candy posted:

After reading that I've realized I don't know anything about programming or computers.

same

i realized 2 years in that i was never going to know anything about programming or computers and would get by on the equally useful skills of "has some common sense and ability to reason"

Itaipava
Jun 24, 2007

Achmed Jones posted:

it isn't lying. usually you're looking at standard list semantics, and being backed by an array is an implementation detail. same reason it's not lying to call it a heap even though it's backed by an array, and it's not lying to call it a hashmap even though collisions are backed by a list instead of next-bucket

But then isn't this just goal-post-moving of what "standard list semantics" means? A new grad will think it means "oh lookup by index is linear, but eg insertion at the beginning is constant time"

Achmed Jones
Oct 16, 2004



i mean insofar as any language changing is "goalpost moving" i guess

are you doing a bit here? it sounds like you have fundamental problems with the way that words have meaning, that communities evolve standards, etc

Achmed Jones
Oct 16, 2004



generally semantics of lists is not the internal behavior. it's operating on single items, having certain methods, having no upper bounds that needs to be changed manually, etc

Itaipava
Jun 24, 2007
I thinking you're taking me more seriously than my meaning here but I do honestly, earnestly think it's interesting that the term "list" means one thing in undergrad and then something else (in some aspects with opposite semantics) in the "real world". You can go on about words having specific meanings in specific communities and all that jazz but my "bit" was just that observation.

Steve French
Sep 8, 2003

I would personally not assume any particular implementation of something called “list” like I might about one called “linked list”

John DiFool
Aug 28, 2013

Happy page 2^9 fellow computer touchers

Jabor
Jul 16, 2010

#1 Loser at SpaceChem

Itaipava posted:

I thinking you're taking me more seriously than my meaning here but I do honestly, earnestly think it's interesting that the term "list" means one thing in undergrad and then something else (in some aspects with opposite semantics) in the "real world". You can go on about words having specific meanings in specific communities and all that jazz but my "bit" was just that observation.

Perhaps in an undergrad program that's based on what was hip 40 years ago and doesn't teach you anything other than Lisp.

Every other undergrad program is going to be pretty clear on what a "list" is and how you can implement a "linked list" vs. other ways of doing it.

bob dobbs is dead
Oct 8, 2017

I love peeps
Nap Ghost
cool kid lisp nowadays (clojure) has first class vectors and maps

Xarn
Jun 26, 2015
Tbh list is a stupid name for resizable array, so it fits that C# and Python both use it.

OTOH then you look at C++ and that's even worse :v:

redleader
Aug 18, 2005

Engage according to operational parameters
it's a list of items. ez

Pollyanna
Mar 5, 2005

Milk's on them.


Dehumanize yourself and return to Lisp dialects IMO.

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


If you had to define a list, you'd probably want to describe it as a linear data structure, meaning that you can view all of the elements by starting at the head and looking at the next one. Arrays and linked lists are both specific implementations of lists and they come with methods that expose details of their implementations, but the abstraction is still there.

LLSix
Jan 20, 2010

The real power behind countless overlords

Speaking of cool kid Lisp, the intro book for Scheme is still one of my favorite programming books. It's easy to read and learn from.

bob dobbs is dead
Oct 8, 2017

I love peeps
Nap Ghost
little schemer is third party. sussman wrote the wizard book so thats de facto official intro

Comb Your Beard
Sep 28, 2007

Chillin' like a villian.
Getting back into Java. Why create an interface and an Impl class where it's just 1:1 and you don't even implement the interface a second time? Always drove me nuts back in the day, seemed so stupid. Is there a way to get my IDE (VSCode) to go to the actual impl of the method? Getting this on a take home assignment.

Seeing @Autowired a lot and then the ability to use the methods non-statically. Why is this better than just a static method? Like a service class that holds no state itself.

Comb Your Beard fucked around with this message at 15:39 on Apr 19, 2023

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice

Comb Your Beard posted:

Getting back into Java. Why create an interface and an Impl class where it's just 1:1 and you don't even implement the interface a second time? Always drove me nuts back in the day, seemed so stupid. Is there a way to get my IDE (VSCode) to go to the actual impl of the method? Getting this on a take home assignment.

ctrl+F12 iirc?

Anyway can't speak for Java but we do it in c# so we can mock the interfaces for testing. There are other ways to accomplish this but using interfaces for everything seems to be the default.

Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS

Comb Your Beard posted:

Getting back into Java. Why create an interface and an Impl class where it's just 1:1 and you don't even implement the interface a second time? Always drove me nuts back in the day, seemed so stupid. Is there a way to get my IDE (VSCode) to go to the actual impl of the method? Getting this on a take home assignment.

In spring and other bean-heavy frameworks it’s a lot easier to just @Autowire an interface with a single impl bean registration than it is to instantiate and pass around instances of the impl.

Comb Your Beard
Sep 28, 2007

Chillin' like a villian.

Blinkz0rz posted:

In spring and other bean-heavy frameworks it’s a lot easier to just @Autowire an interface with a single impl bean registration than it is to instantiate and pass around instances of the impl.

Oh yeah I just asked about autowired above. You can autowire a class instead though, yeah? And skip the 1:1 interface:class part?

LLSix
Jan 20, 2010

The real power behind countless overlords

Anyone have advice for helping someone transition from Java to C (not C++, C)?

We have a new hire straight out of college whose only experience is with Java and Javascript but our codebase is C89. They seem to be struggling with the concept of pointers especially. So far I've been having them run through hackerrank C exercises to build skills and confidence while I kibitz and advise. It seems to be going okay during our 1-on-1s but translating that into being able to make changes in our codebase has been pretty slow. The obvious thing would be to go over examples from our codebase with them, but that was the first thing I tried and they weren't able to read a simple 5 line function that returned the sum of a specific array in a passed in struct. We spent most of an hour on it and while they made enough progress to be able to make the necessary one line change, they didn't really internalize it.

The new hire is fluent, but English is their second language, and I'm not sure how much is ESL problems and how much is programming stuff.

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

LLSix posted:

Anyone have advice for helping someone transition from Java to C (not C++, C)?

We have a new hire straight out of college whose only experience is with Java and Javascript but our codebase is C89. They seem to be struggling with the concept of pointers especially. So far I've been having them run through hackerrank C exercises to build skills and confidence while I kibitz and advise. It seems to be going okay during our 1-on-1s but translating that into being able to make changes in our codebase has been pretty slow. The obvious thing would be to go over examples from our codebase with them, but that was the first thing I tried and they weren't able to read a simple 5 line function that returned the sum of a specific array in a passed in struct. We spent most of an hour on it and while they made enough progress to be able to make the necessary one line change, they didn't really internalize it.

The new hire is fluent, but English is their second language, and I'm not sure how much is ESL problems and how much is programming stuff.

Ask them about how a machine executes an instruction. The exercises won't build up a reasonable mental model for them. And to understand pointers, IMO it's easiest to understand how the machine is using them and what they mean.

Have fun TA'ing a CS class.

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.
If you're looking for a project based approach, I'm not sure how you can get through http://emulator101.com/ or https://www.nand2tetris.org/ without understanding pointers.

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


Yeah, I don't think there's a great way to get pointers that doesn't involve looking at how machines execute code. An undergraduate architecture class will work but it's probably overkill. The project-based approach is probably much better.

John DiFool
Aug 28, 2013

Huge "old man yelling at clouds" vibe coming here, but: what the gently caress are they teaching in cs undergrad courses if graduates don't understand pointers coming out of it???

bob dobbs is dead
Oct 8, 2017

I love peeps
Nap Ghost
colleges give the implicature real hard that they are quality control for people but they cannot give you a single nine of any reasonable quality that wasnt there before. including the putative ability and willingness to do scut work for 4 years that some peeps talk about, to be honest

you get like 40% yield of actual learning from a college class. you can get that up to like 3 nines if you do intensive tutoring but that doesnt happen in stem land. in liberal arts land it happens sometimes but depends upon vicious exploitation of tutors

bob dobbs is dead fucked around with this message at 17:17 on Apr 19, 2023

Adbot
ADBOT LOVES YOU

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


bob dobbs is dead posted:

colleges give the implicature real hard that they are quality control for people but they cannot give you a single nine of any reasonable quality that wasnt there before. including the putative ability and willingness to do scut work for 4 years that some peeps talk about, to be honest

you get like 40% yield of actual learning from a college class. you can get that up to like 3 nines if you do intensive tutoring but that doesnt happen in stem land. in liberal arts land it happens sometimes but depends upon vicious exploitation of tutors

Yeah, it's pretty much this. Colleges want to do quality control but outside the very top end they're so dependent on tuition revenue that they're really challenged to kick anyone out or even discourage them from attending. That's why you have to screen your new graduates so hard.

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