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
double sulk
Jul 2, 2010

NOTinuyasha posted:

big nerd ranch makes a good objective-c book

programming in objective-c is the best one

Adbot
ADBOT LOVES YOU

Posting Principle
Dec 10, 2011

by Ralp

OBAMA BIN LinkedIn posted:

boost::scoped_array m8

even msvc has std::array, how old is your compiler

X-BUM-RAIDER-X
May 7, 2008

Jerry SanDisky posted:

even msvc has std::array, how old is your compiler

OBAMA BIN LinkedIn posted:

ancient gcc extension that still complains if u don't specify a compile time const value when u initialise arrays.

X-BUM-RAIDER-X
May 7, 2008
also, our 'modern' platforms for real can't use any c++11 features cos we still have some boxes on rhel4

Posting Principle
Dec 10, 2011

by Ralp
you're a braver person than me, i can't write c++ anymore without c++11 stuff

uG
Apr 23, 2003

by Ralp
truly the terrible programmer safe zone/hideout

Ciaphas
Nov 20, 2005

> BEWARE, COWARD :ovr:


i'm forced to write code using oci and occi

please someone give me succor

X-BUM-RAIDER-X
May 7, 2008

uG posted:

truly the terrible programmer safe zone/hideout

now that you're here

uG
Apr 23, 2003

by Ralp
well i do have many adventures in c++ i just dont want to remember them

Doc Block
Apr 15, 2003
Fun Shoe
If you learn Objective-C from a book be prepared to do a substantial amount of catch-up reading on line.

Scorponok
May 13, 2002

No... not without incident.

Bloody posted:

does it take any effort at all to convert a project from using g++ to using llvm because if it does then i don't care because after this project i strongly hope to never use the c++ again

Clang doesn't support some of the same compiler parameters as gcc (-f-whatever), and is more picky about some code and will want you to fix it. For our app (hundreds of thousands of lines of code) it wasn't a big deal to port, maybe a couple of days IIRC? the worst thing was doing precomplied headers in a way that worked the same in clang and visual studio 2005 (yes, it's true, I long for death).

Ask me about the horrors of maintaining an app that builds itself on OS X using nmake, the horrible make tool included with MS visual studio and not updated in 10 years!

Sent from my iPad

Symbolic Butt
Mar 22, 2009

(_!_)
Buglord
my limited experience with ruby made me respect the language, it was much better than I ever expected. idk it's like ruby got oop right or something at least compared to python, perl or... php.

Symbolic Butt
Mar 22, 2009

(_!_)
Buglord
also I like to think that sulk is a dumbass and doesn't know poo poo

prefect
Sep 11, 2001

No one, Woodhouse.
No one.




Dead Man’s Band

Symbolic Butt posted:

my limited experience with ruby made me respect the language, it was much better than I ever expected. idk it's like ruby got oop right or something at least compared to python, perl or... php.

can you give me a thumbnail sketch of how it got oop right and the others got it wrong?

(not being a snarky prick; genuinely curious, because something about ruby gives me the heebie-jeebies and/or the willies)

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug
Ruby code:
666.class # => Fixnum
(69 ** 420).class # => Bignum
5.+(6) # => 11
it's all objects
Ruby code:
m = 5.method(:+) # => #<Method: Fixnum#+>
m.call 6 # => 11
m.receiver # => 5

tef
May 30, 2004

-> some l-system crap ->
ruby: has objects that respond to messages. this invokes methods. has lisp-2 style namespaces for method calls and variables. uses observer/internal iterators pushing a callback to the object. uses require/include to build scripts.

python: has objects that have attributes. this invokes functions. single namespace. self is lexically scoped. uses external iterators that return a value. has a library system.

both imperative call by object style scripting languages hth

double sulk
Jul 2, 2010

Symbolic Butt posted:

also I like to think that sulk is a dumbass and doesn't know poo poo

ruby is bad not as much because it's slow and is mostly used for web poo poo, but because of the way that a majority of ruby programmers write their code. also there are way too many tdd zealots who are worse than any javascript obsessor

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
i think all of the bad stuff in ruby is from people starting with rails and then moving backwards to ruby and applying all of rail's design idioms to their ruby programs even though they don't make sense in that context.

like me for instance

weird
Jun 4, 2012

by zen death robot
Ruby has Lisp-2 style namespaces? But Lisp-2s are awful and I thought Ruby was supposed to be hip and cool

uG
Apr 23, 2003

by Ralp
i dont know who lied to you about ruby being hip or cool but they lied its just another p-lang

Nomnom Cookie
Aug 30, 2009



chef uses ruby and chef is p good

the bang method thing is really stupid though. sometimes it means mutation, other times it means throwing exceptions, and still other times it means commit?? sounds like what it really means is "im a dumbass terrible p-langer who cant design an api to save my life so i'll just put in every method i can think of and add ! to some of them"

prefect
Sep 11, 2001

No one, Woodhouse.
No one.




Dead Man’s Band

Cocoa Crispies posted:

Ruby code:
5.+(6) # => 11

i'm not sure exactly why this weirds me out, but it does

double sulk
Jul 2, 2010

prefect posted:

i'm not sure exactly why this weirds me out, but it does

scala does the same thing

Nomnom Cookie
Aug 30, 2009



prefect posted:

i'm not sure exactly why this weirds me out, but it does

numbers arent objects thats why

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
numbers as objects is cool, it lets you do things like
code:
class Numeric
   def prime?
      #find if self is prime, return bool
   end
end

3.prime?
=> true
of course overriding base classes is a terrible idea if you're working on a large codebase but it makes personal projects like project euler a lot of fun

Nomnom Cookie
Aug 30, 2009



eax.mov(esp.asAddr())

EVERYTHING is an object :colbert:

Moist von Lipwig
Oct 28, 2006

by FactsAreUseless
Tortured By Flan

prefect posted:

i'm not sure exactly why this weirds me out, but it does

yeah same, makes my brain itch

coffeetable
Feb 5, 2006

TELL ME AGAIN HOW GREAT BRITAIN WOULD BE IF IT WAS RULED BY THE MERCILESS JACKBOOT OF PRINCE CHARLES

YES I DO TALK TO PLANTS ACTUALLY
i am using eclipse to write python code for some personal projects

does this make me a bad person

should i take the time (b/c these projects aren't particularly urgent) to swot up on vim/emacs/whatever it is the cool kids swear by

double sulk
Jul 2, 2010

just use sublime text

Nomnom Cookie
Aug 30, 2009



i like vim cause every fuckin thing has vim on it + you can trick out your local copy

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
just use sublime text

it's the perfect editor for the choosy programmer who is not crippled by autism

Stringent
Dec 22, 2004


image text goes here

chumpchous posted:

programmer who is not crippled by autism

:laugh:

uG
Apr 23, 2003

by Ralp
i use sublime text on windows 7

X-BUM-RAIDER-X
May 7, 2008

uG posted:

i use sublime text on windows 7

lol

X-BUM-RAIDER-X
May 7, 2008

chumpchous posted:

just use sublime text

it's the perfect editor for the choosy programmer who is not crippled by autism

lmao

X-BUM-RAIDER-X
May 7, 2008
*pays 70 dollars for a text editor*

*calls other programmers autistic*

X-BUM-RAIDER-X
May 7, 2008
just use gvim idiots

Doc Block
Apr 15, 2003
Fun Shoe

OBAMA BIN LinkedIn posted:

just use mvim idiots

ftfy, because :lol: if u don't use mac

Symbolic Butt
Mar 22, 2009

(_!_)
Buglord

prefect posted:

can you give me a thumbnail sketch of how it got oop right and the others got it wrong?

(not being a snarky prick; genuinely curious, because something about ruby gives me the heebie-jeebies and/or the willies)

uh no, I can't? sorry I'm a terrible programmer. I guess it boils down a lot to the syntax, in ruby oop feels much more at home compared to say python. here's my sorry excuse for an example:

Ruby code:
class Pair
    attr_accessor :x, :y
    def initialize(x, y)
        @x = x
        @y = y
    end
    def norm
        Math.sqrt(x*x + y*y)
    end
end

class PolarPair < Pair
    attr_accessor :r, :theta
    def initialize(r, theta)
        @r = r
        @theta = theta
    end
    def x
        @r * Math.cos(@theta)
    end
    def y
        @r * Math.sin(@theta)
    end
    def x= a
        b = y
        @theta = Math.atan2(b, a)
        @r = Math.sqrt(a*a + b*b)
        self
    end
    def y= b
        a = y
        @theta = Math.atan2(b, a)
        @r = Math.sqrt(a*a + b*b)
        self
    end
end
Python code:
import math

class Pair(object):
    def __init__(self, x, y):
        self.x = x
        self.y = y
    def norm(self):
        return math.sqrt(self.x*self.x + self.y*self.y)

class PolarPair(Pair):
    def __init__(self, r, theta):
        self.r = r
        self.theta = theta
    @property
    def x(self):
        return self.r * math.cos(self.theta)
    @property
    def y(self):
        return self.r * math.sin(self.theta)
    @x.setter
    def x(self, a):
        b = y
        self.theta = math.atan2(b, a)
        self.r = math.sqrt(a*a + b*b)
        return self
    @y.setter
    def y(self, b):
        a = y
        self.theta = math.atan2(b, a)
        self.r = math.sqrt(a*a + b*b)
        return self
also I loved messing around with the comparable/enumerable mixins poo poo. but yeah, I'm a suspicious person to say anything, I rarely done any non-trivial oop

Adbot
ADBOT LOVES YOU

Symbolic Butt
Mar 22, 2009

(_!_)
Buglord

gucci void main posted:

ruby is bad not as much because it's slow and is mostly used for web poo poo, but because of the way that a majority of ruby programmers write their code. also there are way too many tdd zealots who are worse than any javascript obsessor

oh ok, that sounds fair enough

  • Locked thread