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
Shaggar
Apr 26, 2006

Jabor posted:

actually, proportional fonts are good

not comic sans obv, but in general the reason people use monospaced fonts for writing code is 100% just inertia

no. monospaced fonts are much easier for reading code. Its the same reason we use tabs instead of spaces and all man style instead of some hosed up bullshit

Adbot
ADBOT LOVES YOU

oh no blimp issue
Feb 23, 2011


you were never normal

quiggy
Aug 7, 2010

[in Russian] Oof.


Jabor posted:

actually, proportional fonts are good

not comic sans obv, but in general the reason people use monospaced fonts for writing code is 100% just inertia

look at how wrong this post is

FamDav
Mar 29, 2008
gods favorite language Chinese is monospaced

it's the best

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

Shaggar posted:

no. monospaced fonts are much easier for reading code. Its the same reason we use tabs instead of spaces and all man style instead of some hosed up bullshit

actually, rob pike says monospaced fonts are bad because

Shaggar
Apr 26, 2006
idk who that is but hes probably an idiot.

Soricidus
Oct 21, 2010
freedom-hating statist shill

FamDav posted:

gods favorite language Chinese is monospaced

it's the best

now I want to see a Chinese programming language

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
i really don't care about fonts but if you don't use monospace does that mean your codea might not align even if they have the same number of characters because 'i' doesn't have the same width as 't'?

Shaggar
Apr 26, 2006
yes. monospace means each character has the same width.

quiggy
Aug 7, 2010

[in Russian] Oof.


Soricidus posted:

now I want to see a Chinese programming language

https://en.wikipedia.org/wiki/APL_(programming_language)

:v:

Jabor
Jul 16, 2010

#1 Loser at SpaceChem

Shaggar posted:

no. monospaced fonts are much easier for reading code. Its the same reason we use tabs instead of spaces and all man style instead of some hosed up bullshit

the entire reason proportional fonts are used in everyday writing is for readability. having different letter widths makes it easier and quicker to scan text and understand what has been written.

yes, it's hard to break with in-grained traditions, especially ones that you've been using since the first time you started coding. i personally only started using a proportional font as a joke, a bit of a laugh. but then i just kept using it after realizing that there's actually no real benefits to using a monospace ide font.

(i still use a monospace font in my terminal, because lots of programs do two-dimensional layout of stuff which all breaks with a proportional font. if i could solve that bit of historical inertia i'd start using a real font there as well.)

MononcQc
May 29, 2007

MALE SHOEGAZE posted:

actually, rob pike says monospaced fonts are bad because

The entire plan9 expats using Acme are like that (of course it comes from rob pike):


it does not use monospace by default, has no syntax highlighting, and its biggest feature is probably mouse chording more than anything.

It also explains why Go has a bunch of standalone tools (like go fmt) instead of bigass IDEs so the features could be lifted by users of acme without doing anything special.

HoboMan
Nov 4, 2010

turn off syntax highlighting.
make font 14pt dark green comic sans.
make background color light green.

e: :gas:

HoboMan fucked around with this message at 19:41 on Jul 5, 2016

NihilCredo
Jun 6, 2011

iram omni possibili modo preme:
plus una illa te diffamabit, quam multæ virtutes commendabunt



quote:

To snarf (ie., copy)

Shaggar
Apr 26, 2006

MononcQc posted:

The entire plan9 expats using Acme are like that (of course it comes from rob pike):


it does not use monospace by default, has no syntax highlighting, and its biggest feature is probably mouse chording more than anything.

It also explains why Go has a bunch of standalone tools (like go fmt) instead of bigass IDEs so the features could be lifted by users of acme without doing anything special.

idk if this is terrible because of the unreadable non-monospace font, or the bad Linux font rendering.

Shaggar
Apr 26, 2006

Jabor posted:

the entire reason proportional fonts are used in everyday writing is for readability. having different letter widths makes it easier and quicker to scan text and understand what has been written.

yes, it's hard to break with in-grained traditions, especially ones that you've been using since the first time you started coding. i personally only started using a proportional font as a joke, a bit of a laugh. but then i just kept using it after realizing that there's actually no real benefits to using a monospace ide font.

(i still use a monospace font in my terminal, because lots of programs do two-dimensional layout of stuff which all breaks with a proportional font. if i could solve that bit of historical inertia i'd start using a real font there as well.)

programming languages aren't read like normal human languages so monospacing helps make it easier to read. proportional fonts are useful because it makes individual words easier to read whereas monospaced fonts make blocks of code easier to read.

Sapozhnik
Jan 2, 2005

Nap Ghost
yeah that sounds great until the first time you look at a commented struct and there's just barf everywhere

or have to distinguish between 0 and O, or l and I.

proportional fonts for programming, loving lol

hipster childs just have to find as many ways as possible to be special

Bloody
Mar 3, 2013

rob pike is an absolute imbecile and anything he thinks is good is ipso facto bad

HoboMan
Nov 4, 2010

ok, how the gently caress does TransactionScope work? i am obviously missing something.

Finster Dexter
Oct 20, 2014

Beyond is Finster's mad vision of Earth transformed.

Shaggar posted:

idk if this is terrible because of the unreadable non-monospace font, or the bad Linux font rendering.

It's both

quiggy
Aug 7, 2010

[in Russian] Oof.


haskell is really neat, you guys

HoboMan
Nov 4, 2010

HoboMan posted:

ok, how the gently caress does TransactionScope work? i am obviously missing something.

hahaha, ofc the default settings for TransactionScope don't play nice with SQL Server it's two things both made by Microsoft after all

gonadic io
Feb 16, 2011

>>=

quiggy posted:

haskell is really neat, you guys

just bear in mind that the quicksort example that always gets trotted out is not quicksort and as much as it's neat it's mostly just a demo

quiggy
Aug 7, 2010

[in Russian] Oof.


gonadic io posted:

just bear in mind that the quicksort example that always gets trotted out is not quicksort and as much as it's neat it's mostly just a demo

you mean

code:
quicksort :: (Ord a) => [a] -> [a]
quicksort [] = []
quicksort (x:xs) = quicksort lesser ++ [x] ++ quicksort greater
    where
        lesser = [i | i <- xs, i <= x]
        greater = [i | i <- xs, i > x]
?

because that's literally the definition of quicksort if im not mistaken

HoboMan
Nov 4, 2010

are there any fancy data structures in haskell or do i need to roll my own if i am going to do a thing in it?

quiggy
Aug 7, 2010

[in Russian] Oof.


HoboMan posted:

are there any fancy data structures in haskell or do i need to roll my own if i am going to do a thing in it?

state is haraam, comrade

triple sulk
Sep 17, 2014



MononcQc posted:

The entire plan9 expats using Acme are like that (of course it comes from rob pike):


it does not use monospace by default, has no syntax highlighting, and its biggest feature is probably mouse chording more than anything.

It also explains why Go has a bunch of standalone tools (like go fmt) instead of bigass IDEs so the features could be lifted by users of acme without doing anything special.

i'm the oops

NihilCredo
Jun 6, 2011

iram omni possibili modo preme:
plus una illa te diffamabit, quam multæ virtutes commendabunt

HoboMan posted:

are there any fancy data structures in haskell or do i need to roll my own if i am going to do a thing in it?

i think the average haskellers has four terabytes of fancy data structure hd porn on his hdd

HoboMan
Nov 4, 2010

quiggy posted:

state is haraam, comrade

oh right, i keep forgetting how functional programming works

Asymmetrikon
Oct 30, 2009

I believe you're a big dork!
state doesn't really have much to do with data structures. haskell has plenty of exotic ones. you will learn to love the zipper.

HoboMan
Nov 4, 2010

the thing i want to do needs an efficient way to represent and traverse undirected graphs and n-ary trees.
since it's a toy thing i figured i may as well do it in a language i don't know, just trying to figure out how much i would be committing myself to.

quiggy
Aug 7, 2010

[in Russian] Oof.


HoboMan posted:

the thing i want to do needs an efficient way to represent and traverse undirected graphs and n-ary trees.
since it's a toy thing i figured i may as well do it in a language i don't know, just trying to figure out how much i would be committing myself to.

keep in mind im still very new to haskell, n-ary trees are probably not that bad but i have no idea how you'd do an undirected graph (or a directed graph for that matter)

HoboMan
Nov 4, 2010

an undirected graph can simply be represented as a list of all the edges if i remember correctly so this is probably fairly manageable

cinci zoo sniper
Mar 15, 2013




NihilCredo posted:

i think the average haskellers has four terabytes of fancy data structure hd porn on his hdd
lol if you download porn in tyool 2016

VikingofRock
Aug 24, 2008




quiggy posted:

you mean

code:
quicksort :: (Ord a) => [a] -> [a]
quicksort [] = []
quicksort (x:xs) = quicksort lesser ++ [x] ++ quicksort greater
    where
        lesser = [i | i <- xs, i <= x]
        greater = [i | i <- xs, i > x]
?

because that's literally the definition of quicksort if im not mistaken

The problem is that that quicksort doesn't sort in place, which messes up some of the asymptotics IIRC. There are various ways around it using mutable vectors and the like, and the code isn't that much uglier, but it does make for a less exciting demo.

quiggy posted:

keep in mind im still very new to haskell, n-ary trees are probably not that bad but i have no idea how you'd do an undirected graph (or a directed graph for that matter)

Not sure how well this scales, but I've represented small graphs in Haskell as association lists before and it seemed to work well enough. I think it was basically a wrapper around a Map Node [Node].

Shaggar
Apr 26, 2006

HoboMan posted:

hahaha, ofc the default settings for TransactionScope don't play nice with SQL Server it's two things both made by Microsoft after all

yeah it does.

Shaggar
Apr 26, 2006

HoboMan posted:

ok, how the gently caress does TransactionScope work? i am obviously missing something.

you wrap ur transactional code in a using w/ the transaction scope. if a transaction doesn't exist it is created, if it does exist, it is joined (depending on options).

HoboMan
Nov 4, 2010

sorry to break it to you shaggar, but microsoft makes bad decisions sometimes.

quiggy
Aug 7, 2010

[in Russian] Oof.


VikingofRock posted:

The problem is that that quicksort doesn't sort in place, which messes up some of the asymptotics IIRC. There are various ways around it using mutable vectors and the like, and the code isn't that much uglier, but it does make for a less exciting demo.

according to ~wikipedia~ quicksort can be in-place but doesn't have to be. besides can haskell even perform algorithms in-place whatsoever? like i have no idea how i'd implement a strictly in-place algorithm like fisher-yates shuffle in haskell

Adbot
ADBOT LOVES YOU

gonadic io
Feb 16, 2011

>>=

quiggy posted:

according to ~wikipedia~ quicksort can be in-place but doesn't have to be. besides can haskell even perform algorithms in-place whatsoever? like i have no idea how i'd implement a strictly in-place algorithm like fisher-yates shuffle in haskell

use a mutable array.

the idea that no mutation exists in haskell is completely wrong (and one that most beginners come to it with), it just is explicit and constrained.

  • Locked thread