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
1337JiveTurkey
Feb 17, 2005

Bognar posted:

If we're gonna shake up the front-end language options, can we at least pick a language with type checking?

Since nobody's going to use it directly anyhow, I'd just go with a more secure subset of the JVM with none of the dangerous bits to begin with.

Adbot
ADBOT LOVES YOU

fritz
Jul 26, 2003

TimWinter posted:

Why can't browsers just run python.

I think there's a question of what comes first, bad languages or bad programmers, and in the case of web stuff I have never seen any indication that it's not the second option.

Pollyanna
Mar 5, 2005

Milk's on them.


Update on the help button: we decided to place a link to the user guide under the pop-up search bar for finding people. :pwn:

nielsm
Jun 1, 2009



Pollyanna posted:

Update on the help button: we decided to place a link to the user guide under the pop-up search bar for finding people. :pwn:

Sounds like the equivalent of building the bike shed underground, with a trapdoor hidden in the woods as the only access.

HappyHippo
Nov 19, 2003
Do you have an Air Miles Card?

Pollyanna posted:

Also we're having a 30 minute meeting on where to put the "Get Help" button. :negative:

Bikeshedding.txt

JawnV6
Jul 4, 2004

So hot ...
C's a lot of fun, but I don't really think of it as squeezing performance. More like making peek/poke machine accesses prettier.

Anyway, gcc 7.0.0 optimizations are breaking the Kernel build.

nielsm posted:

Sounds like the equivalent of building the bike shed underground, with a trapdoor hidden in the woods as the only access.
Which will now become the user's expectation and must not ever be moved.

Space Kablooey
May 6, 2009


Pollyanna posted:

Update on the help button: we decided to place a link to the user guide under the pop-up search bar for finding people. :pwn:

At that point, why even bother?

Soricidus
Oct 21, 2010
freedom-hating statist shill
Nobody's ever going to read the user guide anyway

Strong Sauce
Jul 2, 2003

You know I am not really your father.





Hammerite posted:

You may think it's reasonable to have objects in the global namespace have effects on script execution based on magic names that aren't visually cued in any way, and call this opinion "experience", but I don't think it's reasonable, and I call it "brain damage caused by too much Javascript exposure"

yeah javascript is trash in that way. maybe next time spend some effort to read up so you don't run into these problems? but it's cool, you'll know better next time.

canis minor
May 4, 2011

My favorite JS weirdness is naming a form submit button "submit" and then trying to invoke submit call on such form - as form elements are referenced as [form].[name of element] naming an element this way overwrites submit event on the form. Works on other properties as well!

Xarn
Jun 26, 2015
My favourite language is actually C++. :v:

Dirty Frank
Jul 8, 2004

Xarn posted:

My favourite language is actually C++. :v:

Are you looking for a dom? ASL?

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

Dirty Frank posted:

Are you looking for a dom? ASL?

I thought people looking for the dom wrote JavaScript. :v:

The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer

Dirty Frank posted:

Are you looking for a dom? ASL?

i write vb so I'm all about a private sub

Internet Janitor
May 17, 2008

"That isn't the appropriate trash receptacle."

TooMuchAbstraction posted:

We hear so much about how all these languages suck...so what are y'all's favorite programming languages? And perhaps more importantly, are your favorite languages the ones you actually get to use for any substantial serious work? No "I did a few Project Euler problems in Haskell and really liked it".

I really dig K. As of last week I'm getting paid to write it, too. Only time will tell whether I've earned myself my dream job or created my own personal hell. At least the pay's good and my coworkers all seem to be friendly, intelligent people. :unsmith:

Amberskin
Dec 22, 2013

We come in peace! Legit!

TooMuchAbstraction posted:

We hear so much about how all these languages suck...so what are y'all's favorite programming languages? And perhaps more importantly, are your favorite languages the ones you actually get to use for any substantial serious work? No "I did a few Project Euler problems in Haskell and really liked it".

PL/1. Unironically.

Hammerite
Mar 9, 2007

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

Strong Sauce posted:

yeah javascript is trash in that way. maybe next time spend some effort to read up so you don't run into these problems? but it's cool, you'll know better next time.

Nah I'll just whine about it again, more cathartic and I can argue with people in this thread.

Ah, uh, I mean yes, I will study hard

Malcolm XML
Aug 8, 2009

I always knew it would end like this.

JawnV6 posted:

C's a lot of fun, but I don't really think of it as squeezing performance. More like making peek/poke machine accesses prettier.

Anyway, gcc 7.0.0 optimizations are breaking the Kernel build.

Which will now become the user's expectation and must not ever be moved.

More like the kernel relies on undefined behavior because C is underspecified

The real horror is that this kind of code can appear anywhere in big c codes libs

Strong Sauce
Jul 2, 2003

You know I am not really your father.





Hammerite posted:

Nah I'll just whine about it again, more cathartic and I can argue with people in this thread.

Ah, uh, I mean yes, I will study hard

cool just don't get so butthurt when you post about your own code in a coding horrors thread and it gets ripped on.

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe

Internet Janitor posted:

The preprocessor, undefined behavior, typedef syntax (and for that matter having both concepts of typedefs and structs rather than unifying them into a single idea), the anemic build systems that inevitably result in people defining compile-time logic using ad-hoc bash scripts,

A lot of the undefined behavior in C/C++ is basically unavoidable without either a completely different execution model (which would make C useless for many of its intended use cases) or a wildly more advanced compiler (which would have been impossible for most of its lifetime) or in many cases both plus massive restrictions on the usability of the language.

I will not defend signed overflow being U.B., though. We should really just define that to be wraparound these days.

Zemyla
Aug 6, 2008

I'll take her off your hands. Pleasure doing business with you!

rjmccall posted:

I will not defend signed overflow being U.B., though. We should really just define that to be wraparound these days.
What about the ones-complement and sign-magnitude integer machines that totally exist you guys so we need to keep them in the standard, just like trigraphs, because we make tons of machines that don't have square or curly brackets!

Athas
Aug 6, 2007

fuck that joker

Zemyla posted:

What about the ones-complement and sign-magnitude integer machines that totally exist you guys so we need to keep them in the standard, just like trigraphs, because we make tons of machines that don't have square or curly brackets!

You can just make it implementation-defined instead. I suspect signed overflow is undefined behaviour because it allows the compiler to assume x+1>x if x is signed, which sometimes simplifies range analysis.

Xarn
Jun 26, 2015
While I don't know of any sign-magnitude or ones-complement machine, aren't there still machines with saturating arithmetic? So defining it as overflowing in two-complement representation could still lead to pessimization on some hardware.

feedmegin
Jul 30, 2008

TooMuchAbstraction posted:

We hear so much about how all these languages suck...so what are y'all's favorite programming languages?

The one I invented myself, of course.

Edit: on Windows, of course, it's not main() but WinMain(), because Microsoft gotta be different! :sun:

nielsm
Jun 1, 2009



feedmegin posted:

The one I invented myself, of course.

Edit: on Windows, of course, it's not main() but WinMain(), because Microsoft gotta be different! :sun:

I don't know if any C compilers actually supported that directly, but you can definitely write a program that does one thing when run in a real DOS environment, and another thing when started from inside Windows <= 3.11. So I could imagine the compiler emitting an entry point that calls main() when run from DOS, and WinMain() when run from Windows.

HappyHippo
Nov 19, 2003
Do you have an Air Miles Card?

Athas posted:

I suspect signed overflow is undefined behaviour because it allows the compiler to assume x+1>x if x is signed, which sometimes simplifies range analysis.

Yeah and this is what I mean by the standards being written for compiler writers as opposed to language users.

Also, my favorite example of undefined behaviour in c is

quote:

An unmatched ‘ or ” character is encountered on a logical source line during tokenization.

Pollyanna
Mar 5, 2005

Milk's on them.


TooMuchAbstraction posted:

We hear so much about how all these languages suck...so what are y'all's favorite programming languages? And perhaps more importantly, are your favorite languages the ones you actually get to use for any substantial serious work? No "I did a few Project Euler problems in Haskell and really liked it".

Lisps! Specifically Clojure. It's fascinating to me and I have yet to crack the code on Lisp dialects' secrets to productivity and the "CODE IS DATA IS CODE" nirvana bullshit, and it may elude me for my entire life. But it sure sounds like a silver bullet.

Aside from that, I like Ruby and Elixir - I'm most productive in Ruby because that's where the grand majority of my experience lies, and I think about things in a functional manner most of the time and both Ruby and Elixir make that easy. As does Clojure, of course.

Not too hot on JavaScript, though ES6 is intriguing. .NET languages like C#, I don't get much chance to work in, which is a shame cause they don't look too bad.

Internet Janitor posted:

I really dig K. As of last week I'm getting paid to write it, too. Only time will tell whether I've earned myself my dream job or created my own personal hell. At least the pay's good and my coworkers all seem to be friendly, intelligent people. :unsmith:

Array languages like APL and K are also fascinating but I have no idea what I'd use them for :shrug: Hard number crunching and data processing, right?

feedmegin
Jul 30, 2008

nielsm posted:

I don't know if any C compilers actually supported that directly, but you can definitely write a program that does one thing when run in a real DOS environment, and another thing when started from inside Windows <= 3.11. So I could imagine the compiler emitting an entry point that calls main() when run from DOS, and WinMain() when run from Windows.

Nah. You're thinking of the MS-DOS stub at the start of PE/COFF files, which is completely separate and independent from the actual Windows program (and, of course, is running in 16-bit mode). You can't write one program which directly targets both environments or anything.

nielsm
Jun 1, 2009



feedmegin posted:

Nah. You're thinking of the MS-DOS stub at the start of PE/COFF files, which is completely separate and independent from the actual Windows program (and, of course, is running in 16-bit mode). You can't write one program which directly targets both environments or anything.

I thought you could do more with that, i.e. make a file that works as both MZ and NE format. Guess not.

fishmech
Jul 16, 2006

by VideoGames
Salad Prong

feedmegin posted:

Nah. You're thinking of the MS-DOS stub at the start of PE/COFF files, which is completely separate and independent from the actual Windows program (and, of course, is running in 16-bit mode). You can't write one program which directly targets both environments or anything.

You might not be able to write them in one source file, but there have been several programs out there that are both a full DOS program and a full 16 bit Windows program (or rarely 32 bit Windows program). It's usually only done to show off though.

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
In a sense all windows programs were dual-mode programs, as the "you must run this in windows" message was printed by the program itself and not the loader.

feedmegin
Jul 30, 2008

Plorkyeran posted:

In a sense all windows programs were dual-mode programs, as the "you must run this in windows" message was printed by the program itself and not the loader.

Yes, that would be the MS-DOS stub I just talked about. It's still there on modern Windows, even though for 64-bit Windows DOS isn't :shobon:

That said, I wasn't actually a Windows programmer back in the 3.1 days, so I'm willing to believe it was possible then in the pre-PE days.

feedmegin fucked around with this message at 16:21 on Jun 28, 2016

Zemyla
Aug 6, 2008

I'll take her off your hands. Pleasure doing business with you!
I know regedit and Scandisk were among the programs that worked in both DOS and Windows.

fishmech
Jul 16, 2006

by VideoGames
Salad Prong

Zemyla posted:

I know regedit and Scandisk were among the programs that worked in both DOS and Windows.

In Windows 95/98, Scandisk in Windows is accessed through a 5 kilobyte stub exe (scandskw.exe). Not sure whether that actually calls into the scandisk.exe file used in DOS mode though.

Internet Janitor
May 17, 2008

"That isn't the appropriate trash receptacle."

Pollyanna posted:

Array languages like APL and K are also fascinating but I have no idea what I'd use them for :shrug: Hard number crunching and data processing, right?

Actually at my new workplace K is used for a broad variety of things- number crunching is the core, but even stuff like web backends and automation scripts are mostly written in K. For those other tasks it doesn't shine as much, but it isn't really any worse than it would be to use JS or Python or any other conventional language.

Hughlander
May 11, 2005

JawnV6 posted:

C's a lot of fun, but I don't really think of it as squeezing performance. More like making peek/poke machine accesses prettier.

Anyway, gcc 7.0.0 optimizations are breaking the Kernel build.

Which will now become the user's expectation and must not ever be moved.

To be fair, they introduced a bug in the kernel. They didn't break the build. If a GCC actually had a release that couldn't compile the kernel I'd be amazed at their release process not even doing a sanity check on one of the largest single use cases of it. :)

krillin from Dragonball
Aug 8, 2013
Three days into my first coding job and I get to work on this: https://github.com/scoophealth/osca...A09Handler.java

Of note:
code:
private static void switchMatchingAppointment(LoggedInInfo loggedInInfo, String chartNo, List<Appointment> appointments) {
		// look through all appointments for matching demographic
		// set the here flag on matching
		// of not match throw exception.

		for (Appointment appointment : appointments) {
			logger.debug("checking appointment : " + appointment.getId());

			if (!isValidAppointmentStatusForMatch(appointment)) continue;

			if (chartNoMatches(loggedInInfo, appointment, chartNo)) {
				switchAppointmentStatus(appointment);
				return;
			}
		}

		throw (new IllegalStateException("Some one checking in who has no appointment."));
	}

	private static boolean isValidAppointmentStatusForMatch(Appointment appointment) {
		if ("H".equals(appointment.getStatus())) return (false);
		else if ("N".equals(appointment.getStatus())) return (false);
		else if ("C".equals(appointment.getStatus())) return (false);
		else if ("B".equals(appointment.getStatus())) return (false);

		return (true);
}
Use of continue, confusing function name, hard-coded values, and 5 separate returns? Great!

Cuntpunch
Oct 3, 2003

A monkey in a long line of kings
I checked the history on this, just to see if MAYBE, MAYBE it had been slow degradation caused by changing requirements.

Nope, it got *written* like this originally and never touched since.

:smithicide:

code:
if( 	input.Foo != null ||
	input.Foo != null ||
	input.Foo != null ||
	input.Foo != null)

qntm
Jun 17, 2009
What's the bet that getting input.Foo has side-effects?

Adbot
ADBOT LOVES YOU

JawnV6
Jul 4, 2004

So hot ...
Yeah, the quickest way to make that much worse is
code:
//  Avoids race condition

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