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
Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug
just did one in ruby with rspec because nobody is asking for help, it's bad (i really need a cell class)

Ruby code:
class Board
  attr_accessor :current_state
  def initialize
    self.current_state = new_state
  end

  def iterate!
    next_state = new_state
    current_state.each_with_index do |row, ri|
      row.each_with_index do |cell, ci|
        next_state[ri][ci] = lives? ri, ci
      end
    end

    self.current_state = next_state
  end

  def at(x, y)
    current_state[x][y] rescue false
  end

  def set(x, y, val)
    current_state[x][y] = val
  end

  private
  def new_state
    width = 20
    height = 20
    Array.new(height){Array.new(width){false}}
  end

  def neighbors(x, y)
    [
      at(x-1, y-1),
      at(x, y-1),
      at(x+1, y-1),
      at(x-1, y),
      at(x+1, y),
      at(x-1, y+1),
      at(x, y+1),
      at(x+1, y+1)
    ]
  end

  def neighbor_count(x, y)
    neighbors(x, y).select{|v| v}.length
  end

  def lives?(x, y)
    if at(x, y)
      remain_alive?(x, y)
    else
      come_alive?(x, y)
    end
  end

  def remain_alive?(x, y)
    count = neighbor_count(x, y)
    count == 2 || count == 3
  end

  def come_alive?(x, y)
    count = neighbor_count(x, y)
    count == 3
  end
end


describe Board do
  subject { Board.new }
  it 'initializes' do
    subject.should be
  end

  it 'has a current_state' do
    subject.current_state.should be_an Array
  end

  it 'starts all-dead' do
    subject.current_state.flatten.all? do |c|
      c == false
    end.should == true
  end

  it 'remains all-dead after iteration' do
    subject.iterate!
    subject.current_state.flatten.all? do |c|
      c == false
    end.should == true
  end

  it 'should iterate a block as identity' do
    subject.set 1, 1, true
    subject.set 1, 2, true
    subject.set 2, 1, true
    subject.set 2, 2, true

    subject.iterate!

    subject.at(1,1).should == true
    subject.at(1,2).should == true
    subject.at(2,1).should == true
    subject.at(2,2).should == true
  end

  it 'should have a single cell die' do
    subject.set 1, 1, true

    subject.iterate!

    subject.current_state.flatten.all? do |c|
      c == false
    end.should == true
  end

  it 'should have a blinker toggle' do
    subject.set 2, 1, true
    subject.set 2, 2, true
    subject.set 2, 3, true

    subject.iterate!

    subject.at(1, 2).should == true
    subject.at(2, 1).should == false
    subject.at(2, 2).should == true
    subject.at(2, 3).should == false
    subject.at(3, 2).should == true

    subject.iterate!

    subject.at(1, 2).should == false
    subject.at(2, 1).should == true
    subject.at(2, 2).should == true
    subject.at(2, 3).should == true
    subject.at(3, 2).should == false
  end
end

Adbot
ADBOT LOVES YOU

tef
May 30, 2004

-> some l-system crap ->
thing is I can see that is fun, but i really dislike the presentation of it.

and i'm a misanthrope.

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

tef posted:

thing is I can see that is fun, but i really dislike the presentation of it.

corey haines is a nice guy but it's because he's kind of a feel good hippy

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

Cocoa Crispies posted:

corey haines is a nice guy but it's because he's kind of a feel good hippy

like i'm pretty sure that while he did the "travel around the world and teach people tdd and software craftsmanship for room and board" thing he was going to north american venues in a beat-up old toyota filled with all his worldly possessions (clothes, macbook pro)

Notorious b.s.d.
Jan 25, 2003

by Reene

tef posted:

computer scientists hate him! find out how to beat programming with these 6 sessions .


so i finally watched a twenty minute talk to find out what the gently caress is happening. ten minutes of ecclesiastic matters before they explain what happens.


so far:

choose problem. write code in pairs. stop, and throw away code after 45 minutes. talk about the problem, and then pair with a new person. during this people with beards make fun of your code.

oh. why is not written down anywhere :confused: and it seems they always use conway's game of life


aha:

it's a real life version of a thread that has been fizz-buzzed.

a simple problem everyone can bikeshed, and then hours of intensive discussion and everyone posting sillier and sillier versions.

i think conway's game is just the introductory session, so you can figure out how the process is supposed to work

i assume the way that this improves anyone's work isn't earth-shattering revelations. it's just the opportunity to work side by side with someone who is potentially smarter than, or different from, the most mentor-like dude at your current employer

given how many rubyists have no outside experience and work with other idiots with no outside experience, i would argue anything that diffuses any god drat useful information at all is a good thing

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

Notorious b.s.d. posted:

i think conway's game is just the introductory session, so you can figure out how the process is supposed to work

i assume the way that this improves anyone's work isn't earth-shattering revelations. it's just the opportunity to work side by side with someone who is potentially smarter than, or different from, the most mentor-like dude at your current employer

given how many rubyists have no outside experience and work with other idiots with no outside experience, i would argue anything that diffuses any god drat useful information at all is a good thing

for what it's worth, there's very few ruby people at this one, it's a pretty decent mix of java and .net people, phps, javascripts, and a couple people that know dozens of languages

every session is 45 minutes of conway's then you throw it away and do conway's in the next session

quote:

given how many rubyists have no outside experience and work with other idiots with no outside experience, i would argue anything that diffuses any god drat useful information at all is a good thing
this goes for anybody who self-identifies as a language-user: javas like shaggar, phps like tbc, etc.

MononcQc
May 29, 2007

a programming language optimized for demo toy problems is what needs to be created next

tef
May 30, 2004

-> some l-system crap ->
php

double sulk
Jul 2, 2010

javascript

Posting Principle
Dec 10, 2011

by Ralp
#include <fizzbuzz>

tef
May 30, 2004

-> some l-system crap ->

Cocoa Crispies posted:

corey haines is a nice guy but it's because he's kind of a feel good hippy

i hate evangelism. i also hate it when I have to watch a 20 minute video for what can be written in a tweet.

manero
Jan 30, 2006

Cocoa Crispies posted:

corey haines is a nice guy but it's because he's kind of a feel good hippy

I hosted a coderetreat with him this past year and it was awesome.

Notorious b.s.d. posted:

i think conway's game is just the introductory session, so you can figure out how the process is supposed to work

i assume the way that this improves anyone's work isn't earth-shattering revelations. it's just the opportunity to work side by side with someone who is potentially smarter than, or different from, the most mentor-like dude at your current employer

given how many rubyists have no outside experience and work with other idiots with no outside experience, i would argue anything that diffuses any god drat useful information at all is a good thing

We did conway's game for the whole day, and I was a bit surprised at how many people froze up when we were supposed to do pure TDD. It was great to get a chance to see how other people worked, too.

Notorious b.s.d.
Jan 25, 2003

by Reene

Cocoa Crispies posted:

this goes for anybody who self-identifies as a language-user: javas like shaggar, phps like tbc, etc.

the comparison to php is apt: like php, rails exploded out of nowhere creating legions of entry-level jobs

like php, the most competent people who want to make money and have stable 9-5 jobs move on to other platforms

as a result the composition of the rubyist community is frozen: at any given time most of them are either young and inexperienced or kinda dumb. kind of like a pot of boiling water is always 212F: the molecules that were warmer than 212F left the drat pot

(unlike php ruby is not a godawful ball of spit and baling wire, but the community problems are similar)

Notorious b.s.d. fucked around with this message at 18:50 on Dec 8, 2012

tef
May 30, 2004

-> some l-system crap ->

javascript was more the result of being hired to write a scheme variant and then being told to 'make it look like java'

on the other hand, php happened from wanting to do basic html templating.

Notorious b.s.d.
Jan 25, 2003

by Reene

tef posted:

javascript was more the result of being hired to write a scheme variant and then being told to 'make it look like java'

on the other hand, php happened from wanting to do basic html templating.

Personal Home Page

tef
May 30, 2004

-> some l-system crap ->

Notorious b.s.d. posted:

(unlike php ruby is not a godawful ball of spit and baling wire, but the community problems are similar)

other people have successfully reimplemented the ruby grammar. with php, all of the variants have their own subtly different and incompatible grammar.

tef
May 30, 2004

-> some l-system crap ->

Notorious b.s.d. posted:

Personal Home Page

it is a toy problem. it suffers from architecture.

most frameworks come at an unnecessary upfront cost for a small bit of dynamic/generated content. this is why people still use php. it solves the very simple problems they have without requiring them to understand much in the way of organizing their code.

tef
May 30, 2004

-> some l-system crap ->

manero posted:

I hosted a coderetreat with him this past year and it was awesome.


We did conway's game for the whole day, and I was a bit surprised at how many people froze up when we were supposed to do pure TDD. It was great to get a chance to see how other people worked, too.

was any test data provided or did you spent a couple of minutes retyping your inputs and outputs for each session

double sulk
Jul 2, 2010

Notorious b.s.d. posted:

the comparison to php is apt: like php, rails exploded out of nowhere creating legions of entry-level jobs

like php, the most competent people who want to make money and have stable 9-5 jobs move on to other platforms

as a result the composition of the rubyist community is frozen: at any given time most of them are either young and inexperienced or kinda dumb. kind of like a pot of boiling water is always 212F: the molecules that were warmer than 212F left the drat pot

(unlike php ruby is not a godawful ball of spit and baling wire, but the community problems are similar)

i'll admit that rails jobs are what i'm looking for right now and i'm still young, but it's tough because since smaller companies/startups are the ones using them, they end up looking for people who have a few years of it under their belt. but by that point, they're probably moving on to better or different things. i do like rails more than django though if only because i feel that you have to do a bit more work for yourself and that aside from scaffolding (which you don't really even use once you're used to how rails works), you don't have the benefit of an admin panel to do a lot of extra work for you. i feel like i've learned a bit more in working with it, at least.

had a phone screen a couple days ago and a coding challenge i sent over last night for a position at a place in nyc. i've been looking at postings and even if they're for senior(ish) roles, if the requirements seem reasonable i try to send my resume just to see if it'll stick, and this case was one of them. i'm really not assuming anything will pan out here, but if i get brought on it'd be for a junior position. it would be a really difficult life move for me though because i'd have to relocate up there. it's fortunately only an hour and a half away and i could come home on weekends, but i'm not sure how much of a strain that'll become, but at this point if i want to get anywhere i feel like it's almost mandatory.

/en

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope

tef posted:

so i finally watched a twenty minute talk to find out what the gently caress is happening. ten minutes of ecclesiastic matters before they explain what happens.

so far:

choose problem. write code in pairs. stop, and throw away code after 45 minutes. talk about the problem, and then pair with a new person. during this people with beards make fun of your code.

oh. why is not written down anywhere :confused: and it seems they always use conway's game of life

lol, i went to the site because and was trying to find some explanation on what the gently caress is this poo poo about. the web page says pretty much nothing. i noticed that the video is 20 minutes long and was nope.avi.

basically

tef posted:

i also hate it when I have to watch a 20 minute video for what can be written in a tweet.

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope

Cocoa Crispies posted:

i am running the miami code retreat today and some people were shocked that part of the rules is to delete your code every 45 minutes and start from scratch

hey, cocoa crispies, tell them to put this quote on their homepage:

tef posted:

a simple problem everyone can bikeshed, and then hours of intensive discussion and everyone posting sillier and sillier versions.

because the current page is useless

0xB16B00B5
Aug 24, 2006

by Y Kant Ozma Post
yospos.posting.instructions.posse.cut.ogg

0xB16B00B5
Aug 24, 2006

by Y Kant Ozma Post
are there any meetups like this for node? it would be nice to talk with other experienced node developers and their years of experience

manero
Jan 30, 2006

tef posted:

was any test data provided or did you spent a couple of minutes retyping your inputs and outputs for each session

nope, we weren't allowed to keep code between exercises (tests included), so we started fresh each time.

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

tef posted:

was any test data provided or did you spent a couple of minutes retyping your inputs and outputs for each session

manero posted:

nope, we weren't allowed to keep code between exercises (tests included), so we started fresh each time.

i showed a couple of test data sets on the projector (dead field stays dead, 2x2 square stays 2x2 square, one cell dies, three cell row becomes a three cell column and row again)

the way i did my implementation was i started with dead field, wrote code to make that pass, then 2x2 square, didn't have to write code (hadn't implemented iterate! yet), then one cell dies (implemented everything), then the three-cell toggle (didn't have to change anything)

Max Facetime
Apr 18, 2009

Hard NOP Life posted:

Thats been known since the 70s when the mythical man month was published. He was recommending since then to write in less verbose and higher level languages since you output the same number of lines of code regardless of the language

he says "Productivity seems constant in terms of elementary statements, a conclusion that is reasonable in terms of the thought a statement requires and the errors it may include", but this is from a comparison between lines of code in PL/I and assembler and is a special case

he says of this gain in productivity from the transition from assembler to a higher-level language: "Most past progress in software productivity has come from eliminating noninherent difficulties such as awkward machine languages and slow batch turnaround" and that "There are not a lot more of these easy pickings".

also, to go much beyond the state of the art in 1995 "Radical progress is going to have to come from attacking the essential difficulties of fashioning complex conceptual constructs".

programming by its nature already abstracts repeated fragments into functions or modules, therefore mere compression to reduce the number of keypresses leads to just less typing, not increased productivity

Sapozhnik
Jan 2, 2005

Nap Ghost
why does every loving generation of twattish 20 year old programmers have to re-invent the subject from first principles, poorly

i'm a beautiful and unique white hipster gently caress, i'm going to accidentally discover Hooke's Law all over again and then write a blog post explaining my fantastic novel discovery to the world in the most condescending way imaginable

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

Win8 Hetro Experie posted:

programming by its nature already abstracts repeated fragments into functions or modules, therefore mere compression to reduce the number of keypresses leads to just less typing, not increased productivity

our functions and modules do waaaay more though

back then you had a library to make a linked list

now i have a library to send an encrypted message to and get a response from a service that i don't need to know the physical location of that's easier to use than any linked list implementation

result = HttpClient.post "https://example.com/kajigger", shaggar: 'wrong'

tef
May 30, 2004

-> some l-system crap ->
much programming advice from the 70's and 80's only really holds if you're doing embedded programming.

tef
May 30, 2004

-> some l-system crap ->

manero posted:

nope, we weren't allowed to keep code between exercises (tests included), so we started fresh each time.

this is stupid, you are stupid.

here is a text file.

code:
3 3
   
***
   
here is a text file that is output

code:
3 3
 * 
 * 
 * 
repeatedly entering this poo poo in is a total waste of time

tef
May 30, 2004

-> some l-system crap ->

Mr Dog posted:

why does every loving generation of twattish 20 year old programmers have to re-invent the subject from first principles, poorly

because most programmers would rather write code than read code.



quote:

i'm a beautiful and unique white hipster gently caress, i'm going to accidentally discover Hooke's Law all over again and then write a blog post explaining my fantastic novel discovery to the world in the most condescending way imaginable

let me tell you about my new java web framework *slides chair on rollers*

prefect
Sep 11, 2001

No one, Woodhouse.
No one.




Dead Man’s Band

Mr Dog posted:

why does every loving generation of twattish 20 year old programmers have to re-invent the subject from first principles, poorly

i'm a beautiful and unique white hipster gently caress, i'm going to accidentally discover Hooke's Law all over again and then write a blog post explaining my fantastic novel discovery to the world in the most condescending way imaginable

tef posted:

much programming advice from the 70's and 80's only really holds if you're doing embedded programming.

tef
May 30, 2004

-> some l-system crap ->

Win8 Hetro Experie posted:

he says of this gain in productivity from the transition from assembler to a higher-level language: "Most past progress in software productivity has come from eliminating noninherent difficulties such as awkward machine languages and slow batch turnaround" and that "There are not a lot more of these easy pickings".

software productivity (and reuse) is mostly a social issue, not a technical one.


quote:

also, to go much beyond the state of the art in 1995 "Radical progress is going to have to come from attacking the essential difficulties of fashioning complex conceptual constructs".

the next big leap will not be finding new ways of programming, but new ways to avoid programming.

quote:

programming by its nature already abstracts repeated fragments into functions or modules, therefore mere compression to reduce the number of keypresses leads to just less typing, not increased productivity

this is a pretty modern idea of programming. programming for years was more about performing a calculation, repeating a set of instructions over and over again.

it wasn't till later on with the rise of jackson and dijkstra that structured programming concepts like (if, while, for and modules and functions) really caught on.

and it hasn't really caught on that fast. i've seen lots of new programmers reimplenting function dispatch. many recent languages still don't have mature module or library support either.

tef
May 30, 2004

-> some l-system crap ->

fwiw, early kernighan books are a goldmine, if you ignore the pascal and ratfor specific advice.

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

Mr Dog posted:

why does every loving generation of twattish 20 year old programmers have to re-invent the subject from first principles, poorly

i'm a beautiful and unique white hipster gently caress, i'm going to accidentally discover Hooke's Law all over again and then write a blog post explaining my fantastic novel discovery to the world in the most condescending way imaginable

learning enough to teach is gratifying, and nobody's forcing you to read condescending blog posts (unless you get paid based on hacker news karma in which case condolences)

prefect
Sep 11, 2001

No one, Woodhouse.
No one.




Dead Man’s Band

tef posted:

fwiw, early kernighan books are a goldmine, if you ignore the pascal and ratfor specific advice.

Normally when I read older books like that, I try to think of the general sense of what they're talking about, instead of the specific problem they're trying to fix. Even if this particular problem doesn't exist in modern languages, this kind of problem probably still shows up in other places.

tef
May 30, 2004

-> some l-system crap ->
there is also lots of 'use bitfields everywhere. don't ever copy things. garbage collection is too slow' type poo poo left over too.

prefect
Sep 11, 2001

No one, Woodhouse.
No one.




Dead Man’s Band

tef posted:

there is also lots of 'use bitfields everywhere. don't ever copy things. garbage collection is too slow' type poo poo left over too.

I don't have any formal Computer Scientist education; are bitfields generally a bad idea these days? (There are some architect-types at my current place who are madly in love with them.)

0xB16B00B5
Aug 24, 2006

by Y Kant Ozma Post
i like them cause they index well

Adbot
ADBOT LOVES YOU

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

prefect posted:

I don't have any formal Computer Scientist education; are bitfields generally a bad idea these days? (There are some architect-types at my current place who are madly in love with them.)

i don't usually use bitfields: i'm more likely to have a set (serialized to json as an array i guess?) that i can check for membership in for little on/off switches

yeah it stores bigger but the database we use has a per-value limit of megabytes and no limit on the number of keys/values or the space they take up

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