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
CPColin
Sep 9, 2003

Big ol' smile.

No Safe Word posted:

semicolons-only

;_;

Adbot
ADBOT LOVES YOU

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

Jazerus posted:

ultimately the ASI wars are over, everyone just does whatever they prefer and then formats it in line with the rest of the codebase.

This is the correct thing for all this type of poo poo. If you don't have a code style for your project/team/company then just use prettier to format all your code.

Soricidus
Oct 21, 2010
freedom-hating statist shill
I use semicolons in python, that’s how much I love them

Magissima
Apr 15, 2013

I'd like to introduce you to some of the most special of our rocks and minerals.
Soiled Meat
Haskell can technically be written with semicolons (and brackets) instead of indentation but I've never seen it used in the wild. It's useful in the REPL though.

code:
foo :: Double -> Double;
foo x = let {
  s = sin x;
  c = cos x;
  } in 2 * s * c

Magissima fucked around with this message at 03:23 on Dec 10, 2019

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe
I had an advisor who use the explicit notation religiously in Haskell.

I liked the indentation-based notation, but something about Haskell’s rules was wrong for me; I would write stuff that didn’t parse, and I could never figure out what it was. I’ve never had that problem with Python.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
Semicolon insertion in javascript works like much of the rest of the language: fine until it fucks you over in the most asinine and unintuitive way possible. There are languages with similar features (e.g. go) that are designed so it’s not an issue.

Seems like some programmers prefer to memorize fiddly rules when there’s an easy alternative, and then expect everyone else to do the same. Sometimes they’re in a position to dictate a style guide. Hopefully there’s helpful tooling involved!

(I’ve totally been that person, but I’m learning from my mistakes. Just write the drat semicolons. Install a font that renders semicolons as a 1px interpunct or whatever if it ruins your aesthetics.)

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


Magissima posted:

Haskell can technically be written with semicolons (and brackets) instead of indentation but I've never seen it used in the wild. It's useful in the REPL though.

code:
foo :: Double -> Double;
foo x = let {
  s = sin x;
  c = cos x;
  } in 2 * s * c

That just looks so wrong.

https://twitter.com/zkat__/status/1204188153008906240

ultrafilter fucked around with this message at 06:30 on Dec 10, 2019

Qwertycoatl
Dec 31, 2008


It's terrible in 2019 but back in the day it wasn't a metaphor of a typewriter, it was output to a literal teleprinter

Soricidus
Oct 21, 2010
freedom-hating statist shill

Qwertycoatl posted:

It's terrible in 2019 but back in the day it wasn't a metaphor of a typewriter, it was output to a literal teleprinter

Was DOS really ever used with teleprinters? and why is Unix, which actually calls its text mode interface a teletypewriter to this day, perfectly happy using LF by itself?

Hammerite
Mar 9, 2007

And you don't remember what I said here, either, but it was pompous and stupid.
Jade Ear Joe

Dr. Stab posted:

Semicolons or newlines, pick exactly one.

No. They serve different purposes

dougdrums
Feb 25, 2005
CLIENT REQUESTED ELECTRONIC FUNDING RECEIPT (FUNDS NOW)

Soricidus posted:

Was DOS really ever used with teleprinters? and why is Unix, which actually calls its text mode interface a teletypewriter to this day, perfectly happy using LF by itself?
In the DOS case it comes from CP/M. I dunno about LF by itself though.

canis minor
May 4, 2011

Hammerite posted:

No. They serve different purposes

What's the purpose of new line in JS?

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

canis minor posted:

What's the purpose of new line in JS?

Semicolon insertion opportunity.

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



canis minor posted:

What's the purpose of new line in JS?

So Internet Explorer can count lines of code executed and cut you off when you do too many.

lobsterminator
Oct 16, 2012




Munkeymon posted:

So Internet Explorer can count lines of code executed and cut you off when you do too many.

Also at Microsoft your productivity used to be (maybe still is) measured by lines of code per week. That's more than enough reason to keep hitting that return.

putin is a cunt
Apr 5, 2007

BOY DO I SURE ENJOY TRASH. THERE'S NOTHING MORE I LOVE THAN TO SIT DOWN IN FRONT OF THE BIG SCREEN AND EAT A BIIIIG STEAMY BOWL OF SHIT. WARNER BROS CAN COME OVER TO MY HOUSE AND ASSFUCK MY MOM WHILE I WATCH AND I WOULD CERTIFY IT FRESH, NO QUESTION

canis minor posted:

What's the purpose of new line in JS?

New line is sometimes purely a formatting thing, other times it ends a statement and an automatic semicolon is inserted by the interpreter.

A semicolon always ends a statement (which is why you should probably just use them if you don't have an auto-formatter [but really you should have an auto-formatter/linter]).

Hammerite
Mar 9, 2007

And you don't remember what I said here, either, but it was pompous and stupid.
Jade Ear Joe

canis minor posted:

What's the purpose of new line in JS?

I interpreted Dr. Stab's post as being about programming language design in general, not about JavaScript specifically, and my post is to be read in that context whether or not that was in fact how Dr. Stab intended their post to be interpreted.

Soricidus
Oct 21, 2010
freedom-hating statist shill
I propose the addition of a number of new semantic characters to Unicode, such as statement terminator, etc. Then people can configure their ide to render these with or without semicolons as they prefer.

eth0.n
Jun 1, 2012

Soricidus posted:

I propose the addition of a number of new semantic characters to Unicode, such as statement terminator, etc. Then people can configure their ide to render these with or without semicolons as they prefer.

And we could have an indentation character that people can configure to render at their preferred width!

NtotheTC
Dec 31, 2007


eth0.n posted:

And we could have an indentation character that people can configure to render at their preferred width!

could you also add a smaller, fixed indentation character that I could group together in lots of say, 4, so that I can be consistent across all systems i might need to view my code on tia

Beef
Jul 26, 2004
Garbage.

Whitespace is the only seperator and group everything between parenthesis.

RPATDO_LAMD
Mar 22, 2013

🐘🪠🍆
A lisp dialect, but instead of parens it uses quote marks and you have to escape them an extra time for every layer of nesting

Ola
Jul 19, 2004

Soricidus posted:

I propose the addition of a number of new semantic characters to Unicode, such as statement terminator, etc. Then people can configure their ide to render these with or without semicolons as they prefer.

I would render it as COMPUTER EXECUTE

canis minor
May 4, 2011

Soricidus posted:

I propose the addition of a number of new semantic characters to Unicode, such as statement terminator, etc. Then people can configure their ide to render these with or without semicolons as they prefer.

So, something like this https://www.fileformat.info/info/unicode/block/control_pictures/list.htm?

Soricidus
Oct 21, 2010
freedom-hating statist shill

no, those are just printable representations of ASCII control characters, which mostly don't have useful semantics unless you're implementing a teletype protocol or a mainframe database. that's why we need new characters specifically for programming.

Linear Zoetrope
Nov 28, 2011

A hero must cook
This is ridiculous, the only valid statement separator is BEL

JawnV6
Jul 4, 2004

So hot ...

Linear Zoetrope posted:

This is ridiculous, the only valid statement separator is BEL

I worked with a talented contractor who managed to add a BEL to the console spew of our device on boot. I left it in because I pavloved right on it and expected the bell when I'd flash a new build.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe

Soricidus posted:

no, those are just printable representations of ASCII control characters, which mostly don't have useful semantics unless you're implementing a teletype protocol or a mainframe database. that's why we need new characters specifically for programming.

That is a good idea, some sort of Separator for different Groups of code. Perhaps we could call it the Group Separator?

Doom Mathematic
Sep 2, 2008

OddObserver posted:

Not enough |0 around for that, I think?

You may be thinking of asm.js, which is a different thing from WebAssembly.

JawnV6 posted:

I worked with a talented contractor who managed to add a BEL to the console spew of our device on boot. I left it in because I pavloved right on it and expected the bell when I'd flash a new build.

I used to put && echo ^G^G^G on the end of long-running commands so I knew when they were done.

Doom Mathematic fucked around with this message at 23:03 on Dec 11, 2019

Ralith
Jan 12, 2011

I see a ship in the harbor
I can and shall obey
But if it wasn't for your misfortune
I'd be a heavenly person today
notify-send is nice for that in the modern world

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
the galaxy brain version is the HCT build system used by some parts of microsoft which uses text to speech to literally say "Build Complete" out of your speakers

scared me shitless the first time i compiled DirectXShaderCompiler

Zopotantor
Feb 24, 2013

...und ist er drin dann lassen wir ihn niemals wieder raus...

Soricidus posted:

Was DOS really ever used with teleprinters? and why is Unix, which actually calls its text mode interface a teletypewriter to this day, perfectly happy using LF by itself?

Unix tty devices have options for things like turning LF into CR/LF.

all hope abandon, ye who enter the termios(3) man page

OddObserver
Apr 3, 2009
Seeing form-feed characters in source files is kinda an interesting "whoa, history!" experience.

Soricidus
Oct 21, 2010
freedom-hating statist shill

Suspicious Dish posted:

That is a good idea, some sort of Separator for different Groups of code. Perhaps we could call it the Group Separator?

What is a “group of code”? That’s not a term anyone uses. Now you’re right back at the old problem of using an arbitrary character with a different intended semantic, like semicolon or line feed. That’s why we need explicit statement separator, block start/block end, etc.

Hammerite
Mar 9, 2007

And you don't remember what I said here, either, but it was pompous and stupid.
Jade Ear Joe

Ola posted:

I would render it as COMPUTER EXECUTE

Approved, but your compy has to say it in a scary robot voice

Athas
Aug 6, 2007

fuck that joker

OddObserver posted:

Seeing form-feed characters in source files is kinda an interesting "whoa, history!" experience.

This is still relatively common practice in Emacs-land. Which makes no sense to me; Emacs out-of-the-box does not do anything particularly intelligent with form-feed characters and just renders them as ^L (although there are commands for zooming between them).

lobsterminator
Oct 16, 2012




This is one kind of a horror, I guess:

https://www.zdnet.com/article/russian-police-raid-nginx-moscow-office/

Volguus
Mar 3, 2009

That's a political horror, not a coding one.

Simulated
Sep 28, 2001
Lowtax giveth, and Lowtax taketh away.
College Slice

Volguus posted:

That's a political horror, not a coding one.

What is the difference?

Adbot
ADBOT LOVES YOU

NtotheTC
Dec 31, 2007


https://twitter.com/elonmusk/status/1205230908837523456

Talking smugly about code and programming (and physics) without having the faintest idea how it works counts as a horror right?

NtotheTC fucked around with this message at 13:32 on Dec 13, 2019

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