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
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?

Lutha Mahtin posted:

is this the name for the thing like in python where if you make a call with one of the optional parameters, you have to label it.

no, it's the thing where the value 0 and "nothing" are no longer conflated

the standard library has

code:
enum<T> Optional {
   case None
   case Some(T)
}

and there's syntactic shorthand for it like

code:
func divide(numerator: Int, by denominator: Int) -> Int? {
    guard denominator != 0 else {
       return nil
    }
    return numerator / denominator
}

the Int? return type is shorthand for Optional<Int> and nil is shorthand for .None

to unwrap an optional you assign it in an if let construct where the variable is valid in the body which is only executed if the value is non-nil (or use guard let which doesn't require nesting scope), or you can force-unwrap it with ! but your program will abort if the value is actually nil

this means that you're forced to be clear in your code everywhere you could actually wind up propagating a "nothing" rather than just silently and obscurely failing

Adbot
ADBOT LOVES YOU

Shaggar
Apr 26, 2006

vodkat posted:

just out of curiosity whats the yospinion on swift?

its crap for idiots same as objc.

Shaggar
Apr 26, 2006
apple didn't want to use java or c# cause nih.

qntm
Jun 17, 2009
Python code:
class Infix:
	def __init__(self, f):
		self.f = f
	def __ror__(self, l):
		class Partial:
			def __init__(self, l, f):
				self.l = l
				self.f = f
			def __or__(self, r):
				return self.f(self.l, r)
		return Partial(l, self.f)

max = Infix(lambda x, y: x if x >= y else y)

print(23 |max| 766 |max| 55) # 766

Bloody
Mar 3, 2013

python is so gross

Asymmetrikon
Oct 30, 2009

I believe you're a big dork!
Pycharm freaks if you do the infix poo poo because of pep 8

gently caress you too, python

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
lol i'm getting flamed on our internal mailing list for asserting that email is a bad medium for discussions taking place between many individuals

FamDav
Mar 29, 2008
yo tef where is that list what a library says vs what it means and is "high-performance" on it.

FamDav
Mar 29, 2008
if not it should mean "handles our problem"

Shaggar
Apr 26, 2006

MALE SHOEGAZE posted:

lol i'm getting flamed on our internal mailing list for asserting that email is a bad medium for discussions taking place between many individuals

mailing lists are absolutely retarded which makes them perfect for Linux.

Shaggar
Apr 26, 2006
"ask the mailing list" is the absolute worst response for requests for help. atleast create yourself a stack overflow or a forums.

JawnV6
Jul 4, 2004

So hot ...
years of arguing here and elsewhere on the internet has left my email persona unfit for general discussion

bobbilljim
May 29, 2013

this christmas feels like the very first christmas to me
:shittydog::shittydog::shittydog:

MALE SHOEGAZE posted:

lol i'm getting flamed on our internal mailing list for asserting that email is a bad medium for discussions taking place between many individuals

lol

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

i always wanted to overload an operator in python to do one thing 99% of the time but 1% of the time it does something else. that would be a fun bug to track down

Ragg
Apr 27, 2003

<The Honorable Badgers>

Shaggar posted:

mailing lists are absolutely retarded which makes them perfect for Linux.

http://lkml.iu.edu/hypermail/linux/kernel/0908.3/01481.html

Dev 1: Personally, I care about metadata consistency, and ext3 documentation suggests that journal protects its integrity. Except that it does not on broken storage devices, and you stil need to run fsck there.
Dev 2: as the ext3 authors have stated many times over the years, you still need to run fsck periodicly anyway.
Dev 1: Where is that documented?
Dev 2: linux-kernel mailing list archives.
Dev 3: Probably from some 6-8 years ago, in e-mail postings that I made.

Ragg
Apr 27, 2003

<The Honorable Badgers>
Thanks Dan Luu.

fritz
Jul 26, 2003

Blinkz0rz posted:

why the gently caress wouldn't you just use max(a, b) and a + b instead of trying to be clever

your compiler doesn't give a gently caress, you write code for developers to understand

the only place it gets used us in things like "loop over all the things on a container and score a function on them and what's the worst" which I found myself doing a ton of

so that's the max part and I think I put the sum part in for some drat fool reason I can't remember right now

brap
Aug 23, 2004

Grimey Drawer
swift is basically the best language right now and my only regret is that it is realistically confined to iOS development for the time being

it has learned from the mistakes of language designers in the 90s and early 2000s and made important improvements that are only possible by creating a new language from scratch.

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
why isn't it good for osx?

triple sulk
Sep 17, 2014



actually, c# is the best language

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
swift is really good from the playing around i've done.

Bloody
Mar 3, 2013

triple sulk posted:

actually, c# is the best language

i literally cannot quote this enough even if the loving value types are hosed up garbage and the boxed value types are still also hosed up garbage

Baxate
Feb 1, 2011

truly incredible that it took nearly 40 years for a language, swift, to be as good as C

kitten emergency
Jan 13, 2008

get meow this wack-ass crystal prison
c# would be better if it was more universal

I hope swift eats golangs lunch eventually tho because that's a real dumpster fire

Bloody
Mar 3, 2013

uncurable mlady posted:

c# would be better if it was more universal

I hope swift eats golangs lunch eventually tho because that's a real dumpster fire

its gettin there

Asymmetrikon
Oct 30, 2009

I believe you're a big dork!
golang does have gofmt, so that's cool, and channels are kind of neat i guess? still wouldn't want to write in it though

Bloody
Mar 3, 2013

go is really really really bad

Lutha Mahtin
Oct 10, 2010

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

fleshweasel posted:

swift is basically the best language right now and my only regret is that it is realistically confined to iOS development for the time being

there are a lot of cool things in swift but i would honestly trust microsoft more to run a free programming language project in which "community" stakeholders are ever even listened to. not that apple is evil, they just seem to have a very lazy and self serving approach to a lot of the open source projects that power their poo poo, only putting in the bare minimum of effort to ensure needed features and an advantageous development plan

FamDav
Mar 29, 2008
paging rjmccall

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed

MALE SHOEGAZE posted:

why isn't it good for osx?

no one outside of apple writes osx-only software other than artisinal toys and ios dev tools

Shaggar
Apr 26, 2006

Asymmetrikon posted:

golang does have gofmt, so that's cool, and channels are kind of neat i guess? still wouldn't want to write in it though

lol. gofmt is a basic editor feature except its really specific to how the bad developers of go want their bad language to look like.

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

Plorkyeran posted:

no one outside of apple writes osx-only software other than artisinal toys and ios dev tools

ok that was my guess


how long until swift is good enough on linux that i can write dumb personal shell tools and stuff with it

Shaggar
Apr 26, 2006
Linux guy: "hey, today I used mailing lists and got excited about writing more shell commands. This is definitely the best way to do things!"

Chamook
Nov 17, 2006

wheeeeeeeeeeeeee

triple sulk posted:

actually, f# is the best language

Jeffrey of YOSPOS
Dec 22, 2005

GET LOSE, YOU CAN'T COMPARE WITH MY POWERS
If you're not gonna use a functional language, at least use C so you are categorically prevented from working with those OO idiots. Namaste.

Asymmetrikon
Oct 30, 2009

I believe you're a big dork!

Chamook posted:

triple sulk posted:

actually, f# is the best language

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

Shaggar posted:

Linux guy: "hey, today I used mailing lists and got excited about writing more shell commands. This is definitely the best way to do things!"

i'm not a linux guy i'm polyamourOS

brap
Aug 23, 2004

Grimey Drawer

MALE SHOEGAZE posted:

why isn't it good for osx?

it's good for OS X it's just people these days tend to do web or thinly veiled web wrappers on the desktop and native on mobile for their chickenshit apps. see slack, trello, etc

Vanadium
Jan 8, 2005

Delphi update: Delphi 2010 is actually quite nice because it's got generics and anonymous functions, so you can almost write real code in it instead of just prodding the GUI or the DB

having a seemingly random selection of windows api functions actually declared while stuff like the "pls return the size of this file" function is missing is still confusing me though

Adbot
ADBOT LOVES YOU

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

elm has elm-format

  • Locked thread