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
Phobeste
Apr 9, 2006

never, like, count out Touchdown Tom, man

Ephphatha posted:

Guess this is the most appropriate place to ask, there was some talk in one of the other threads about some articles detailing why over-using globals in code is an anti-pattern but I've never managed to find anything more comprehensive than a vague blog post. Anyone have any material they'd recommend? I don't expect anything to change at my workplace but it might make me feel better to know I'm not the only person who wants to actually use appropriate scoping to the extent the lovely languages I have to code in support it.

Volguus posted:

Well, there are at least few things that happen when you use (not even abuse) global variables (singletons included):
1. Cannot parallelize the code
You maybe can parallelize the code, but you'll need so many mutexes all over the place that there'll be no advantage gained with threads

2. Any change has side-effects
And that will slow down releases, unless you have 110% test coverage unexpected bugs will crop up all over the place. Developers will be effectively afraid to touch anything for hell may break loose

3. Developers (some at least, the good ones) will hate working on that code, they'll leave the company and only the mediocre ones will remain. Unless you have some other extraordinary things to hire and keep good people, the company is doomed (unless they're in such a niche market that they have no competition).

And of course a lot of other issues, but these were the first things that I thought of.

4. The way a lot of languages implement globals, especially c, it can be very hard to figure out what's a global and where it's from, and where it's defined. Grep is always your best friend when dealing with c code anyway but if whoever wrote it in the first place wasn't really disciplined with naming things and even sometimes if they are (looking at you, linux kernel) those globals can be the thing that makes it required.

5. Requires more effort to dependency inject making testing harder

Adbot
ADBOT LOVES YOU

Phobeste
Apr 9, 2006

never, like, count out Touchdown Tom, man
It's a bit weird working where I work, because I work on an embedded development team at a full stack from hardware to web company. We have integrations in both directions, and our software folks (including us) are in a different org from our hardware folks. Software has continually tried agile, but for hardware...

For hardware agile works in early development - prototyping, basically. When you're going through a couple rounds of prototyping, it makes a hell of a lot of sense to do Agile, make quick decisions, have limited scope of work, and make choices based on that limited scope, because otherwise you go crazy. The thing is, when it comes to the actual product development phase, this falls completely apart, entirely because of lead times - it's all very well to expect engineers to make a bunch of decisions in two weeks, but then it takes another six to ten to get the parts back. At that point, gantt charts are king.

The thing is, we're caught in the middle, and it's a weird place to be. We help the prototyping, but we're prototyping too - working up quick software to support boards that purposefully will never see production, helping out to write scripts for mechanical prototypes where if we're lucky a third of them will see the light of day - and again, that's exactly how we want it to work on the hardware side. But then, we go into product development mode, and the thing here is that there's a set of non-negotiable features that we basically have to go down the list of. Because basically if we don't get all of them done, the product is useless.

But at the same time, we're supporting existing products by adding new features/functionality/bugfixes/integrations to upstream with the rest of the software/web team, who are all doing Agile, which works really well for them. So we're kind of caught in the middle.

This isn't really a request for help because I know the answer- somebody (not me, I'm just the dev team lead) decides whether that new product launching on time is more important to the business than x y and z random feature, and we do our prioritized work- but more to say, anybody else who's caught between Agile and non-Agile teams, I feel your pain. Significantly.

Phobeste
Apr 9, 2006

never, like, count out Touchdown Tom, man

Illegal Move posted:

Wow, sounds like X is a dipshit.

Yeah who names themselves after a letter anyway

Where I work we have a couple different teams at different levels of the stack and the behavior of the teams is very... different. The middleware team is working a bunch with a sister company that mostly does web things to develop an electron.js app and they're all heavily (mostly because they have to be since the sister company is running most of the show due to politics) engaged in a big ol' agile process and it seems miserable! They also seem to constantly be in terrible drama filled trouble and have been through a couple complete leadership changes and I just don't get it.

Meanwhile my firmware team is now 3 people including me for the next eight weeks or so due to a baby and while we have way too much work to do, at least nobody seems to argue with the old quick, cheap, or quality: pick two maxim.

Phobeste
Apr 9, 2006

never, like, count out Touchdown Tom, man

HardDiskD posted:

I also work with cleaning history before merging branches, and I did a git push -f origin master while on an unrelated branch a few days ago. Luckily my coworker had a local copy of the repo and he averted the crisis. I then learned about the git push --force-with-lease command which pushes to the current branch only if there has been no work done on it.

Why not just make another branch and clean that up locally before pushing it....

Phobeste
Apr 9, 2006

never, like, count out Touchdown Tom, man

raminasi posted:

And what, open a new PR? That's way more annoying and confusing than just blowing away a private branch history.

Why? With github you can make a comment in either PR invoking the name of the other and both of them will get links in the comment stream to the other one; just say "closed in favor of #152" or "supercedes #151" or whatever. Probably other git platforms have the same thing. Force pushing is terrible and branching and PRs are free.

Phobeste
Apr 9, 2006

never, like, count out Touchdown Tom, man
I would love to weigh in with something intelligent on this but unfortunately I'm blindly typing through a pink afterimage that fills my entire field of vision

Phobeste
Apr 9, 2006

never, like, count out Touchdown Tom, man
Emacs for me is just what I'm used to and what my reflexes do and it doesn't hurt that it's very good. Also very easily extendable, all that jazz. At some point I should figure out how to get it more IDE-like though. I have to use eclipse for a couple boring reasons right now and boy does it suck goat rear end to use. The problem is it's all so goddamn mouse focused. And it's tough to do what leper khan said and build in emacs keys - you can get a pretty basic version though - but the thing with emacs is it's so extensible and so equally easy to invoke basic editing commands and more advanced things there's a ton of stuff I'm used to that I just won't get in an emacs plugin for eclipse. Registers. Rectangular selections. Magit, the only good git interface to ever exist. I think it's probably easier to turn something like emacs, which for me is very ergonomic and easy to use, into an IDE than try and customize every little corner of a complete pile of usability trash like eclipse.

Phobeste
Apr 9, 2006

never, like, count out Touchdown Tom, man
Linux kernel style goto error handling is the best for those sorts of workflows in c where you have multiple function calls which depend on things the previous function call did and if any one of them fails you need to wind up all the stuff you did before it. Hell I'm not even sure how else you'd do it without RAII-style code.

Phobeste
Apr 9, 2006

never, like, count out Touchdown Tom, man
sarehu is both passionate and exceptionally skilled in the craftsmanship of what he does, I'll give him that.

Phobeste
Apr 9, 2006

never, like, count out Touchdown Tom, man

CPColin posted:

Both, as far as I knew. Shortly before I left, they also came up with something similar to Stack Exchange, where a company can pay for EE to host a support site, basically. I kept worrying about that feature's longevity, because it sure seemed like there wasn't a whole lot of value in what we were offering these companies. Now I've been gone for ten months, so I'm just guessing, but I bet a bunch of those companies declined to renew their subscriptions.


There's definitely some value, a lot of vendors for complex things like micros want to have their own support portal because they don't want to have a real fully sized customer service department.

Phobeste
Apr 9, 2006

never, like, count out Touchdown Tom, man
MacBook with an external monitor or two is the best way to work, the awfulness of having to use your mouse every now and again is much better if the trackpad is just right there.

Phobeste
Apr 9, 2006

never, like, count out Touchdown Tom, man

CPColin posted:

Edit: T-25 minutes until my weekly one-on-one. Currently getting antsy for no reason!
This is a great feeling

When I quit my last job I tried to pull the old “meeting request with no specific agenda” on my boss and he ended up being free slightly earlier and saying hey want to meet now and I had to rush to print out my resignation in an incredibly unsubtle way.

It owned and I hope you have fun

Phobeste
Apr 9, 2006

never, like, count out Touchdown Tom, man
Somebody appears to have started talking about vim so I’d like to just say that emacs is the light and the way

Phobeste
Apr 9, 2006

never, like, count out Touchdown Tom, man

leper khan posted:

You will never convert the darkness in my heart. Hail Satan.

my friend, we're so open and inclusive we even have evil-mode. You too can be saved!

Phobeste
Apr 9, 2006

never, like, count out Touchdown Tom, man
Yeah, mind you I've never experienced it but I think bullpens or offices with shared space seems like a really nice intermediate. I've only worked in open offices and while it definitely was nice to be able to talk to other people, it could grate on you a little to just never be alone.

I tend a lot more towards Blinkzorz' side of things but that's also because I'm a firmware developer, and a lot of the hardest things I have to do involve not only talking with other programmers but also with hardware engineers, a really wide group of people that it gets hard to just drop in on unless the office is fully open.

Phobeste
Apr 9, 2006

never, like, count out Touchdown Tom, man

B-Nasty posted:

I prefer to base my reports' performance reviews on their changes in acceleration (the third derivative of velocity.)

The coders that aren't constantly increasing the rate that they are increasing the rate that they are increasing the rate of getting stories done are "jounced out" of my team.

I dunno sounds like you’re selecting for jerks

Phobeste
Apr 9, 2006

never, like, count out Touchdown Tom, man
Most of NYC transit is based around getting people to lower manhattan so that’ll be ok. Don’t live in jersey. I started out living in bushwick making 54k and that was fine (not that it would be fine in bushwick now, probably). Expect a 45 minute commute but it’s a lot different when you’re not driving.

Phobeste
Apr 9, 2006

never, like, count out Touchdown Tom, man

He fucks to cum

Phobeste
Apr 9, 2006

never, like, count out Touchdown Tom, man

BurntCornMuffin posted:

And that's his investment in Jenkins.

I mean, maybe there's a plug-in that works with one of those robotic fleshlights to reward good commits that he developed?

the emacs plugin that speeds up a usb connected vibe with nesting depth except for lines of groovy code or number of plugins

Phobeste
Apr 9, 2006

never, like, count out Touchdown Tom, man
Hell yeah welcome to nyc post in the thread and look for a job after a year because you can make a lot more than 80k once you’re established enough to job hunt without caring about relocation

Phobeste
Apr 9, 2006

never, like, count out Touchdown Tom, man
Don’t freaking post or pm it lmao

Phobeste
Apr 9, 2006

never, like, count out Touchdown Tom, man

that link in baquerds bio posted:

No one's saying slaveowners were better than that, just that slaveowners that didn't take care of their slaves got sub-par returns over the long run. If you look at the most successful slave-owners, you would expect to see a general pattern of excellent treatment of well-behaved slaves.

Phobeste
Apr 9, 2006

never, like, count out Touchdown Tom, man

comedyblissoption posted:

no one should be allowed to feel superior about their keyboard shortcut capabilities in an editor

unless that editor is emacs of course :smugbird:

Also yeah I’m one of those people that gets really twitchy while pairing with someone who has to hunt and click every god damned menu

Phobeste
Apr 9, 2006

never, like, count out Touchdown Tom, man

Portland Sucks posted:

Sometimes I type google into the search bar in chrome

Thats fine as long as you do it FAST

Phobeste
Apr 9, 2006

never, like, count out Touchdown Tom, man
So are the projects Jawn is talking about, stand on the shoulders of giants, etc. they still take that long

Phobeste
Apr 9, 2006

never, like, count out Touchdown Tom, man

Janitor Prime posted:

Having the IDE tell me about a convention I'm breaking is a lot more useful while I'm editing the file.

That doesn’t conflict though. The important thing to the organization is that no code that breaches the agreed upon style is committed. If you feel it’s useful to have your IDE remind you, set up your IDE to do so (and probably if other people in your org use the same IDE they’ll have findings they can share)

That said I don’t see the problem with having something cross platform like an editorconfig checked in

Phobeste
Apr 9, 2006

never, like, count out Touchdown Tom, man

Wibla posted:

"future you will hate yourself for this ugly hack"

If every commit has the same message what's the point

Phobeste
Apr 9, 2006

never, like, count out Touchdown Tom, man
Did you know there's an option in your user settings in travis ci to make the website use comic sans throughout. Is this self harm

Phobeste
Apr 9, 2006

never, like, count out Touchdown Tom, man

Hollow Talk posted:

It didn't say human historians...

(*An oversized cockroach continues to struggle with Emacs shortcuts while trying to decipher somebody's golfed FizzBuzz*)

They wouldn’t have any trouble, you know how many legs they have

Phobeste
Apr 9, 2006

never, like, count out Touchdown Tom, man

ultrafilter posted:

You'd think with all the smart people working there that someone would have a clue about designing incentive schemes to promote behavior that's good for the company.

Sounds like something that won't get you promoted

Phobeste
Apr 9, 2006

never, like, count out Touchdown Tom, man

Hollow Talk posted:

I've played around with Kafka and Kafka Streams in Clojure, just using Java Interop to use the Kafka libraries directly, and it's been quite nice.

I wouldn't mind a LISP job more generally, but most Clojure jobs I see are in writing e-commerce and web microservices, which I care little about. I'm actually still surprised how much of data integration and data science settled on Python, given its lovely threading model, typing model, and mutability.

:saddowns:

I have a suspicion it was numpy and matplotlib early on and that was pretty much all she wrote

Phobeste
Apr 9, 2006

never, like, count out Touchdown Tom, man

SurgicalOntologist posted:

For general company docs coda.io looks like an interesting option, though I guess making "smarter docs" isn't necessarily the same as organizing them. I wonder if these "smart tables" type platforms will also be too difficult for our non-tech people.

We've started using coda a lot and it's really good for the kind of general-purpose sometimes prose, sometimes tables, sometimes random embeds from other web based saas stuff that in other contexts ends up being like a page of links, or a half google doc and half google sheet, etc etc.

The only thing I can really say it's missing is a robust change tracking system and other multi-party-editing nice to haves. Like the comment system isn't great, you don't have the kind of versioning information that google docs does, you don't have a "suggesting" input mode, that sort of thing. Other than that though it's really good.

Phobeste
Apr 9, 2006

never, like, count out Touchdown Tom, man

Pedestrian Xing posted:

What if we made a language where you could like, write the code in comment style and it would just work? I think that would be pretty cool.

Ah, a Donald Knuth parachute account

Phobeste
Apr 9, 2006

never, like, count out Touchdown Tom, man

Sagacity posted:

NOJIRA: WIP

Tokyo really got it in this one before gamera managed to take him down

Phobeste
Apr 9, 2006

never, like, count out Touchdown Tom, man

Cyril Sneer posted:

At my company we have some FW that runs on an MCU as part of an IoT device. This FW must support the commercial application, but also R&D functionality and production functionality. Is there any general best practices regarding either maintaining a "single" FW that just supports everything, vs. separate commercial, R&D, and production builds/releases?

Keep them separate you'll have to do insane bullshit in your qc support tests or whatever that you don't want to be in the wild. the r&d stuff is a little more open but probably same. if you really want to you can use cmopiler flags for different build profiles in your CI I guess.

Phobeste
Apr 9, 2006

never, like, count out Touchdown Tom, man

Armauk posted:

Missing detail: Used exclusively in Emacs.

it is imo good enough you could justify installing emacs just for magit and using it for nothing other than magit

Phobeste
Apr 9, 2006

never, like, count out Touchdown Tom, man

Armauk posted:

I use Emacs, and there are 100 additional reasons why one should use it ;)

Me too but you can't tell them that up front it'll scare them away!!

Phobeste
Apr 9, 2006

never, like, count out Touchdown Tom, man
it’s another software development practice in the category of “anything works well when there’s 10 total devs and they’re all good at their job and friendly and we make a thing where if it breaks it’s a minor inconvenience and also we have zero cost to the user updates”

Phobeste
Apr 9, 2006

never, like, count out Touchdown Tom, man

Apoffys posted:

But why are these instructions not in the README.md file at the root of the repository?
Always document these steps, however trivial they seem, but put them somewhere people will instantly find them when they open the project.

yeah this. get these instructions in a text file of some kind in the place that the instructions apply to. IMO, the instructions should have

- Explicit instructions with copy-pastable commands to install the language runtime(s) you need or version managers (nvm, asdf, whatever) to install the language runtimes you need
- Explicit instructions with copy-pastable commands to install the dev dependencies

And you should strongly consider having those copy-pastable commands in a script especially if it's a multi-language setup.

Adbot
ADBOT LOVES YOU

Phobeste
Apr 9, 2006

never, like, count out Touchdown Tom, man

M31 posted:

This is some coping mechanism in action right?

As someone who works in a lot of different languages and dev contexts I always really appreciate it. Sure, duh, package.json = run npm, but if I've been off in c++ land for a while i have to rerail my brain to think of that, and then of course keep in mind that if theres a yarn.lock in addition to package.json actually it's a yarn project, if it's a desktop setup thing there may need to be some other setup, maybe there's actually a docker environment for this, etc etc

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