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.
 
  • Locked thread
Lutha Mahtin
Oct 10, 2010

Your brokebrain sin is absolved...go and shitpost no more!

binary search trees stored in an array have a neat property where the index # for each level of the tree corresponds to a power of two. welp that's the one thing i remember from my algorithms class

Adbot
ADBOT LOVES YOU

Shaman Linavi
Apr 3, 2012

my algorithms class was taught by a dude that used kinesthetic learning
this meant we would all stand up in class while he or another student would physically sort us or whatever

and let me tell you, it sure as hell worked because i dont think ill ever forget how to quicksort

Notorious b.s.d.
Jan 25, 2003

by Reene

so loving future posted:

it's hard to beat regular old c, because it's really loving simple and helps you understand what the poo poo is actually going on inside the computer

python is good for 1) immediate gratification and 2) learning higher level things like algorithms and basic organization of stuff

honestly tho.... who didn't learn qbasic first?

i learned C first because djgpp was free and it's what i had. i would not recommend that path to anyone

rhide was pretty rad tho

Sapozhnik
Jan 2, 2005

Nap Ghost

comedyblissoption posted:

implementing a linked list as an array would probably be faster the vast, vast majority of the time

linked lists that are implemented as dynamically allocated non-contiguous memory should be considered incredibly niche

optimizing for the computer's cache is one of the most important things in a data structure and linked lists poo poo all over that

This also doesn't make much sense to me, I'm afraid.

The whole point of using a linked list is to be able to insert and remove things from the middle of the list quickly. Backing your linked list with a slab allocator will speed up rapid allocations and deallocations but it won't do anything to help your cache usage, because the order in which your nodes gets traversed will get jumbled very quickly on account of all those insertions and removals in the middle. Having all the nodes be located in vaguely the same area of memory doesn't change that.

If you only need to insert and remove things at the start and end, and you also need to optimize for traversal performance, then the data structure you're looking for is a ring buffer, not a linked list.

Sapozhnik fucked around with this message at 15:26 on Aug 4, 2016

hobbesmaster
Jan 28, 2008

well a circular buffer is just another vector so

Sapozhnik
Jan 2, 2005

Nap Ghost
I mean when I'm writing C I use intrusive linked lists and the containerof() macro as my default collection data structure because it's quick and easy to implement, and most code isn't performance critical so who cares if it's not the absolute fastest thing in the world.

Though on further reflection I'm not entirely sure why. It wouldn't be any harder to bang out yet another dynamic array implementation instead.

FamDav
Mar 29, 2008

Mr Dog posted:

This also doesn't make much sense to me, I'm afraid.

The whole point of using a linked list is to be able to insert and remove things from the middle of the list quickly. Backing your linked list with a slab allocator will speed up rapid allocations and deallocations but it won't do anything to help your cache usage, because the order in which your nodes gets traversed will get jumbled very quickly on account of all those insertions and removals in the middle. Having all the nodes be located in vaguely the same area of memory doesn't change that.

If you only need to insert and remove things at the start and end, and you also need to optimize for traversal performance, then the data structure you're looking for is a ring buffer, not a linked list.

for tens of thousands (at least) of elements, shifting everything in a vector over on a random insert is faster than random insertion into a linked list because of cache coherency (and branch prediction helps too). this is for the case where you don't already have an iterator to where you want to insert into the list.

Mao Zedong Thot
Oct 16, 2008


abraham linksys posted:

i may be using go at my next gig which seems like it kind of sucks for web services, but at least i think it'll be easier to maintain than the python codebases i've worked on

I went from a python shop to a go shop and oh my gently caress is it nice. having code that like compiles and stuff, with types, what a revolution in programming!?!?

further evidence that go is good: shaggars reaction to it

Luigi Thirty
Apr 30, 2006

Emergency confection port.

LordSaturn posted:

pick a top-left corner and blit?

nah, i can draw on a flat. i meant of arbitrary shape.

i did get affine texture mapping sorta working with that help... the vertices are getting reordered somewhere along the line so the UV coordinates get rotated and the texture comes out wrong and I'm working on fixing that. it's even not as slow as i thought it would be.

GameCube
Nov 21, 2006

so loving future posted:

I went from a python shop to a go shop and oh my gently caress is it nice. having code that like compiles and stuff, with types, what a revolution in programming!?!?

further evidence that go is good: shaggars reaction to it

shaggar's usually right, though. sucks but it's true.

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
actually, go is pretty good.

Mao Zedong Thot
Oct 16, 2008


I had to gently caress with maven yesterday for $client. Pretty sure maven is like go -- in that it's really good, but people seize on the handful of weird or not good things about it -- to the exclusion of all the amazing poo poo it does

"xml!? lmao"
"yeah but..."
"lol hahaha xml"

repeat with like vendoring for go

brap
Aug 23, 2004

Grimey Drawer
go is bad

HoboMan
Nov 4, 2010

so loving future posted:

I had to gently caress with maven yesterday for $client. Pretty sure maven is like go -- in that it's really good, but people seize on the handful of weird or not good things about it -- to the exclusion of all the amazing poo poo it does

"xml!? lmao"
"yeah but..."
"lol hahaha xml"

repeat with like vendoring for go

no but everyone loves maven

Bloody
Mar 3, 2013

go's idea of types is a bunch of poo poo you throw away with an interface{}

fritz
Jul 26, 2003

so loving future posted:

I had to gently caress with maven yesterday for $client. Pretty sure maven is like go -- in that it's really good, but people seize on the handful of weird or not good things about it -- to the exclusion of all the amazing poo poo it does

"xml!? lmao"
"yeah but..."
"lol hahaha xml"

repeat with like vendoring for go

ive barely touched a maven but given a choice between xml and makefile syntax

Sapozhnik
Jan 2, 2005

Nap Ghost

Bloody posted:

go's idea of types is a bunch of poo poo you throw away with an interface{}

i look forward to the inevitable clusterfuck that was c# 1 to c# 2 or java 1.4 to java 5 happening to go

generics will happen, and they will gently caress up absolutely everything for the next five years by which time go will be replaced with some other fad lang

eschaton
Mar 7, 2007

Don't you just hate when you wind up in a store with people who are in a socioeconomic class that is pretty obviously about two levels lower than your own?
Lisp-Smalltalk supremacy

AWWNAW
Dec 30, 2008

three times in as many months an internal recruiter has invited me to interview and then backed off when figuring out i dropped out of college for a job

i like my job and not even looking right now but getting negged by invitation is starting to piss me off. i kinda want to go back to school anyway but i have like 16 yrs exp (level 99 code mage) and i'm having trouble rationalizing it

signed,
a terrible programmar

AWWNAW
Dec 30, 2008

in other recruiter goings, got an email last night, subject "it never hurts to look" and the job description was for a jr. lvl position at a company I left 4 years ago where I was the 2nd employee lol

brap
Aug 23, 2004

Grimey Drawer
how much work do you have left to complete the degree

JimboMaloi
Oct 10, 2007

those places sounds like places you maybe dont want to work if theyre that uptight about having finished a degree

AWWNAW
Dec 30, 2008

fleshweasel posted:

how much work do you have left to complete the degree

i dropped not even a year into it, so it'd take me 4+ years on an super aggressive schedule if i keep day job. i'd be nearing 40. drat

JimboMaloi posted:

those places sounds like places you maybe dont want to work if theyre that uptight about having finished a degree

i was totally disinterested in the job, it was some megaglobal consulting corp w/ a reverse commute to the burbs, but I'm noticing a trend? the further i get into my career the more it seems like not having a degree is going to gently caress me up and i'll be writing javascript when i'm 50

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

If you're on linux, and you want a good, mainstream general purpose language suited for general web stuff, your choices are go and the jvm.

here's a list of popular web langs from: https://en.wikipedia.org/wiki/Programming_languages_used_in_most_popular_websites

- ASP.NET (C#)
- C
- C++
- D
- Erlang
- go
- Hack
- Java
- JavaScript
- Perl
- PHP
- Python
- Ruby
- Scala
- Swift (I'm adding swift because it should be here)
- Xhp

If you remove the languages that are not linux ready (.NET, Swift), the bad languages (Ruby, Python, PHP, Javascript, Hack, Perl, Xhp), the languages unsuitable for the domain (C, C++), and languages I don't really know anything about (D), you're left with:

- erlang
- jvm
- go

erlang is cool but not very mainstream and not as general purpose as go or the jvm.

so that leaves you with go or the java ecosystem. they actually complement eachother well imo.

Sapozhnik
Jan 2, 2005

Nap Ghost
python 3 is ok. probably.

idk people make the whole dynamic typing thing work but it's not for me really. i'm sure with type annotations and slightly better ides it is at least serviceable.

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

Mr Dog posted:

i look forward to the inevitable clusterfuck that was c# 1 to c# 2 or java 1.4 to java 5 happening to go

generics will happen, and they will gently caress up absolutely everything for the next five years by which time go will be replaced with some other fad lang

i really don't think generics are going to happen in go. they don't make sense for the language. if you need generics go probably isn't right for your use case.

gonadic io
Feb 16, 2011

>>=
In terrible programming, rather than terrible opinions, news today I typed a > instead of a | and overwrote my script with the contents of a csv. That script that I hadn't committed for a few days.

Luckily it only took about 20 mins to reimplement my changes

Luigi Thirty
Apr 30, 2006

Emergency confection port.

i had no idea people used D for anything

Corla Plankun
May 8, 2007

improve the lives of everyone

AWWNAW posted:

i dropped not even a year into it, so it'd take me 4+ years on an super aggressive schedule if i keep day job. i'd be nearing 40. drat


i was totally disinterested in the job, it was some megaglobal consulting corp w/ a reverse commute to the burbs, but I'm noticing a trend? the further i get into my career the more it seems like not having a degree is going to gently caress me up and i'll be writing javascript when i'm 50

how do they even know you didn't finish? just leave that crap off your resume man

hobbesmaster
Jan 28, 2008

i think he meant more that having a degree was a condition of getting the job

Soricidus
Oct 21, 2010
freedom-hating statist shill

MALE SHOEGAZE posted:

If you're on linux, and you want a good, mainstream general purpose language suited for general web stuff, your choices are go and the jvm.

here's a list of popular web langs from: https://en.wikipedia.org/wiki/Programming_languages_used_in_most_popular_websites

- ASP.NET (C#)
- C
- C++
- D
- Erlang
- go
- Hack
- Java
- JavaScript
- Perl
- PHP
- Python
- Ruby
- Scala
- Swift (I'm adding swift because it should be here)
- Xhp

If you remove the languages that are not linux ready (.NET, Swift), the bad languages (Ruby, Python, PHP, Javascript, Hack, Perl, Xhp), the languages unsuitable for the domain (C, C++), and languages I don't really know anything about (D), you're left with:

- erlang
- jvm
- go

erlang is cool but not very mainstream and not as general purpose as go or the jvm.

so that leaves you with go or the java ecosystem. they actually complement eachother well imo.

well I could have all the mature libraries, unparalleled tooling, and experienced programmers that come with picking the jvm, but I'm going to pick golang instead because

hobbesmaster
Jan 28, 2008

because you trust google to maintain a programming language

Captain Foo
May 11, 2004

we vibin'
we slidin'
we breathin'
we dyin'

Luigi Thirty posted:

i had no idea people used D for anything

not surprised this is being said in yospos

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

Soricidus posted:

well I could have all the mature libraries, unparalleled tooling, and experienced programmers that come with picking the jvm, but I'm going to pick golang instead because

they're good for different things.

eschaton
Mar 7, 2007

Don't you just hate when you wind up in a store with people who are in a socioeconomic class that is pretty obviously about two levels lower than your own?

AWWNAW posted:

i was totally disinterested in the job, it was some megaglobal consulting corp w/ a reverse commute to the burbs, but I'm noticing a trend? the further i get into my career the more it seems like not having a degree is going to gently caress me up and i'll be writing javascript when i'm 50

that's the opposite of what I've noticed over the past 20-some years: the longer your career, the more interested in what you've done in production anyone hiring will be

I think (and hope) you're just finding some bizarre outliers or incompetent corporate recruiters

Finster Dexter
Oct 20, 2014

Beyond is Finster's mad vision of Earth transformed.
Heh, I sort of half-trolled my dev team by proclaiming inheritance is bad, and so far there's been a lot of sputtering about "pillars of OOP". I think I may email them that OOP video, "Object-Oriented Programming is Bad" and see if anyone's head explodes.

HoboMan
Nov 4, 2010

is oop actually bad? i personally hate it but i'm a terrible programmer

HoboMan
Nov 4, 2010

also i'm pretty sure i just had a guid collision

hobbesmaster
Jan 28, 2008

HoboMan posted:

is oop actually bad? i personally hate it but i'm a terrible programmer

the problem is that programmers that appear to have never heard of composition ruin oop

Adbot
ADBOT LOVES YOU

Deep Dish Fuckfest
Sep 6, 2006

Advanced
Computer Touching


Toilet Rascal

HoboMan posted:

also i'm pretty sure i just had a guid collision

congrats on experiencing the rarest event in the history of the universe i guess

  • Locked thread