|
I think that the OS/IDE/Paren arguments are for hobbyists, I know what I prefer but if the company I work for says use Notepad then I use notepad.
|
# ? Apr 23, 2019 10:29 |
|
|
# ? May 21, 2024 02:50 |
|
TheresaJayne posted:I think that the OS/IDE/Paren arguments are for hobbyists, I know what I prefer but if the company I work for says use Notepad then I use notepad. I think most programmers (in western nations anyway) are privileged enough to pick jobs where they achieve good job satisfaction. I would not work at a place where I was required to use painful tools. This does not mean that I'm going to quit over the mandated brace style or anything like that, but saying that only hobbyists care about tooling is not correct. (Also, the OS issue is somewhat more substantial - I had to do OpenCL development on Windows for an industrial course I was teaching, and it was quite painful. I never thought GPU programming would be nicer on Linux than on Windows, but here we are.)
|
# ? Apr 23, 2019 10:37 |
|
TheresaJayne posted:I think that the OS/IDE/Paren arguments are for hobbyists, I know what I prefer but if the company I work for says use Notepad then I use notepad. I've worked at two places where I haven't been allowed to install linux on my work computer. Both times I ended up just using the work computer as an extremely overspecced ssh tunnel hub so I could do most of my work my personal computer with linux. I guess if the company I work for says use Notepad then I find a workaround.
|
# ? Apr 23, 2019 11:03 |
|
sunaurus posted:I've worked at two places where I haven't been allowed to install linux on my work computer. Both times I ended up just using the work computer as an extremely overspecced ssh tunnel hub so I could do most of my work my personal computer with linux. I guess if the company I work for says use Notepad then I find a workaround. Same, but through a linux VM. Editing ssh-remote files in emacs is more comfy if the other end of the tunnel is on a different continent. I have colleagues that unironically use telnet+nano for their C++ coding. Ironically, because of that, we only get simple thinkpads instead of decent workstations.
|
# ? Apr 23, 2019 11:16 |
|
Soricidus posted:You’re talking like you think it’s possible for an automated process to make the correct aesthetic judgements to format code the right way IDEs do auto-indentation already, it's not much more than that. One guy writes his {'s on the same line as the function declaration, you like them one line below so your IDE moves it. That's very easy. What sort of text style would you say is aesthetically beautiful formatting, but isn't easily quantifiable under syntax rules?
|
# ? Apr 23, 2019 11:47 |
|
Ola posted:IDEs do auto-indentation already, it's not much more than that. One guy writes his {'s on the same line as the function declaration, you like them one line below so your IDE moves it. That's very easy. What sort of text style would you say is aesthetically beautiful formatting, but isn't easily quantifiable under syntax rules? Line continuations are problematic for auto formatters. Where to break, how much to indent isn't always clear, and can vary by context. A human eye often produces better aesthetics here.
|
# ? Apr 23, 2019 13:39 |
|
Use \n for line breaks that the autoformatter is allowed to alter and \r for manual line breaks for breaking up long lines. Problem solved.
|
# ? Apr 23, 2019 15:22 |
|
TheresaJayne posted:I think that the OS/IDE/Paren arguments are for hobbyists, I know what I prefer but if the company I work for says use Notepad then I use notepad. There's nothing incompatible with working with what your company demands and saying "i wish we would use X". In fact, there's nothing wrong with moving to a different job that lets you use tools that you're comfortable with. "I'm a real programmer and roll over and use whatever my company demands no matter how uncomfortable" is a weird stance to take.
|
# ? Apr 23, 2019 15:29 |
|
eth0.n posted:Line continuations are problematic for auto formatters. Where to break, how much to indent isn't always clear, and can vary by context. A human eye often produces better aesthetics here. The autoformatter should follow simple and predictable rules here, and in cases where it looks like poo poo the human can fix it by breaking out subparts into separate expressions.
|
# ? Apr 23, 2019 15:54 |
|
CPColin posted:Use \n for line breaks that the autoformatter is allowed to alter and \r for manual line breaks for breaking up long lines. Problem solved. This makes me feel super anxious and I can't even tell you why
|
# ? Apr 23, 2019 15:55 |
|
Ola posted:Me too, but it shouldn't matter in a project either, that's why it should just get reformatted in each client. The running code doesn't care. Is this a thing that's done? How does it work in practice? Does everyone's IDE just save the file in their preferred format? If so, doesn't that make diffs horrendous? How can I refer to a line number when talking to someone if they have to code formatted differently? If I'm looking at the code in a code review, is it going to be formatted differently depending on who's posted the review?
|
# ? Apr 23, 2019 16:17 |
|
HappyHippo posted:Is this a thing that's done? How does it work in practice? Does everyone's IDE just save the file in their preferred format? If so, doesn't that make diffs horrendous? How can I refer to a line number when talking to someone if they have to code formatted differently? If I'm looking at the code in a code review, is it going to be formatted differently depending on who's posted the review? No, it's a fantasy suggestion that hasn't been properly thought through!
|
# ? Apr 23, 2019 17:25 |
|
Not that fantastical. Smalltalk has had a semantic-based version management system for ages. A good deal of the research at our PL lab was essentially reproducing some of the Smalltalk functionality in other languages using Eclipse's AST API.
|
# ? Apr 23, 2019 18:37 |
|
Jabor posted:The autoformatter should follow simple and predictable rules here, and in cases where it looks like poo poo the human can fix it by breaking out subparts into separate expressions. Unfortunately what looks poo poo for one person’s set of preferences may look great for another’s, so now we’re back at the original problem where people are editing code just to change the formatting.
|
# ? Apr 23, 2019 18:46 |
|
HappyHippo posted:Is this a thing that's done? How does it work in practice? Does everyone's IDE just save the file in their preferred format? If so, doesn't that make diffs horrendous? How can I refer to a line number when talking to someone if they have to code formatted differently? If I'm looking at the code in a code review, is it going to be formatted differently depending on who's posted the review? I guess it could work, if your IDE formats code to your liking when you pull code but pushing up to CI has a pre-commit hook that calls a formatter? I've never tried that so IDK how practical it would be.
|
# ? Apr 23, 2019 23:34 |
|
Not really a horror, but a pretty silly fuckup. I thought I'd be cute and add something likecode:
HappyHippo posted:Is this a thing that's done? How does it work in practice? Does everyone's IDE just save the file in their preferred format? If so, doesn't that make diffs horrendous? How can I refer to a line number when talking to someone if they have to code formatted differently? If I'm looking at the code in a code review, is it going to be formatted differently depending on who's posted the review? E: CPColin posted:Source code should only ever save to disk as an AST and IDE's should just format them into readable text on load. dougdrums fucked around with this message at 00:45 on Apr 24, 2019 |
# ? Apr 24, 2019 00:42 |
|
I was only mostly joking, of course.
|
# ? Apr 24, 2019 00:59 |
|
It would be cool if you could get a list of AST changes for a given pull request or something. There's gotta be something out there that does this already.
|
# ? Apr 24, 2019 01:33 |
|
Is integrating open source code a valid horror? Let me introduce you to mDNSResponder. Years ago, Apple decided they needed a way to announce devices and services onto a local network, so that applications can find and talk to other applications without manual setup. This became mDNS, also known by the marketing name "Bonjour". It's one way for your phone to detect your Apple TV, or your Mac to discover your WIFI speakers. There's others, but Apple uses it exclusively. Except it's a lovecraftian horror show. Apple actually open sources their reference implementation, called mDNSResponder, to try to drive adoption. There's one one problem: it's crap. Utter, utter crap. Not only does it not actually build on most platforms (the platform layers shipped with the release don't match the actual core changes they've made over the years, so every vendor integrating it has to re-do it) it's a pile of dusty C code written by monkeys. Don't believe me? Here's just one random file from it that I found on GitHub: https://github.com/jevinskie/mDNSResponder/blob/master/mDNSCore/mDNS.c Note the formatting, and the size. No, the guy that imported the code dump hasn't touched the formatting, that's all as-shipped. Yes, it's an old version, but the newer ones are almost identical barring some minor bug fixes. Apple actually tried to replace this crap with a re-written C++ version a few years ago called discoveryd, which was quickly killed off due to apparently insurmountable bugs.
|
# ? Apr 24, 2019 11:48 |
|
I'll see your Bonjour implementation and raise you the TypeScript type checker: https://github.com/Microsoft/TypeScript/blob/master/src/compiler/checker.ts
|
# ? Apr 24, 2019 13:25 |
|
Volte posted:I'll see your Bonjour implementation and raise you the TypeScript type checker:
|
# ? Apr 24, 2019 13:45 |
|
https://twitter.com/kherman/status/1120738998928977920 As a software developer in Texas, the thought of dealing with this gives me anxiety.
|
# ? Apr 24, 2019 16:03 |
|
Permanent dst would be the dumbest method to pick, so I'm sure they'll do it.
|
# ? Apr 24, 2019 16:58 |
|
Volte posted:I'll see your Bonjour implementation and raise you the TypeScript type checker: Other than the sheer size, this doesn't look at all bad to me? Functions and variables have clear names and types, there's little mutability or casts, no magic literals, comments aren't plentiful but aren't lacking either. TypeScript has easily the most complicated type system of any widely-adopted language, so it can't really be helped that the type checker is a complicated class. Function names like getIsContextSensitiveAssignmentOrContextType are as good as you can get IMO. Meanwhile, that Bonjour code has more magic numbers than a Martin Gardner book.
|
# ? Apr 24, 2019 17:05 |
|
Volte posted:I'll see your Bonjour implementation and raise you the TypeScript type checker: OH LAWD HE COMIN
|
# ? Apr 24, 2019 17:22 |
|
fishmech posted:Permanent dst would be the dumbest method to pick, so I'm sure they'll do it. I get why it's dumb but I'll still vote for it because I like it being light later in the day like it is right now and changing the clocks is dumb as gently caress
|
# ? Apr 24, 2019 17:24 |
|
No Safe Word posted:changing the clocks is dumb as gently caress Same. California passed a proposition last year to allow the state to go to year-round DST, should the Feds open the door to that. I don't care if we're year-round UTC-08 or UTC-07; I just want to eliminate the two weeks per year that I'm all hosed up on clock bullshit. (My most recent period of unemployment coincided with the start of DST and it was wonderful not having to participate!)
|
# ? Apr 24, 2019 17:45 |
|
EpicCodeMonkey posted:Don't believe me? Here's just one random file from it that I found on GitHub:
|
# ? Apr 24, 2019 17:52 |
|
No Safe Word posted:I get why it's dumb but I'll still vote for it because I like it being light later in the day like it is right now and changing the clocks is dumb as gently caress It'd probably be good to do some studies to figure out which one would make the biggest beneficial difference to night shift workers. Of course Texas will probably do it by coin flip because Texas.
|
# ? Apr 24, 2019 17:53 |
|
Bonfire Lit posted:It's always a good sign if your license statement is immediately followed by a 10 line paragraph about how you're an idiot if you have different style preferences than the author. I'm a big fan of the complaint about "type* varname" causing confusion and being verboten, followed by that rule being broken ten lines of code later.
|
# ? Apr 24, 2019 18:20 |
|
Bonfire Lit posted:It's always a good sign if your license statement is immediately followed by a 10 line paragraph about how you're an idiot if you have different style preferences than the author. quote:so-called "standard" C functions quote:* Formatting notes: code:
code:
dougdrums fucked around with this message at 18:53 on Apr 24, 2019 |
# ? Apr 24, 2019 18:49 |
|
Gotta love nerds that get extremely mad about cosmetic poo poo. When I started my current job I found an old style guide that declared "camel case is for wiki pages and idiots" among other things. Thankfully the guy who wrote it isn't around any more.
|
# ? Apr 24, 2019 21:20 |
|
I get mad when people don't post in 40 c olumn mode
|
# ? Apr 24, 2019 22:11 |
|
Scaramouche posted:I get mad when people don't post in 40 c Linus Torvalds account found.
|
# ? Apr 24, 2019 22:34 |
|
TBF, that “char *” example is clearer if written as char *x,y
|
# ? Apr 25, 2019 00:09 |
|
Love when people think it’s possible to write C without invoking undefined behaviour, if only they condescend hard enough.
|
# ? Apr 25, 2019 01:04 |
|
char* x,y; is one of the dumber parts of c.
|
# ? Apr 25, 2019 02:31 |
|
HappyHippo posted:char* x,y; is one of the dumber parts of c. IMO, if it were more strongly typed, then char * would be the type, and both x and y would be pointers. As it is, though, char is the type which leaves x as a pointer and y as a scalar. This kind of ambiguity is indeed a horror. Edit: this makes me glad I’m using C# now LongSack fucked around with this message at 04:47 on Apr 25, 2019 |
# ? Apr 25, 2019 04:27 |
|
Ola posted:IDEs do auto-indentation already, it's not much more than that. One guy writes his {'s on the same line as the function declaration, you like them one line below so your IDE moves it. That's very easy. What sort of text style would you say is aesthetically beautiful formatting, but isn't easily quantifiable under syntax rules? In JavaScript sometimes you make long lines with lambdas nested inside expressions. Sometimes you do a few of these in a row. Sometimes I have a few complex, but similar lines in a row* and that's when I like to add horizontal spacing to make sure the like tokens line up. That can't really be done automatically because it's a subjective choice of whether to do it or not. *These are all the cases where the DRY principle did not give good enough savings
|
# ? Apr 25, 2019 05:09 |
|
|
# ? May 21, 2024 02:50 |
|
LongSack posted:This kind of ambiguity is indeed a horror. code:
So the stronger typing is nice but it would make C arrays syntactically inconsistent or semantically inconvenient. It's just the matter of knowing why you're using C in the first place. That being said I love that I can use abstract stuff like BlockingCollections and also void* all the same in C# (more or less). Also gently caress writing C declarations like that. Just don't do it aaaaaaaarrrrrrggg
|
# ? Apr 25, 2019 05:39 |