The Joys Of Programming

fenomas wrote:

I've just realized that half my personal projects are indented by two spaces, and half are indented by four spaces, and I can't decide which to align on. Somehow they now both look wrong.

Is three spaces out of the question? That's crazy talk right?

Yes, only psychopaths use 3 spaces.

Add a tidier and never think about it again

absurddoctor wrote:

Add a tidier and never think about it again ;)

I use an auto formatter of course, I'm taking about what setting to use for it.

That said, I spent a good ten seconds and couldn't think of a reason not to use 3. So far it looks nice!

fenomas wrote:
absurddoctor wrote:

Add a tidier and never think about it again ;)

I use an auto formatter of course, I'm taking about what setting to use for it.

That said, I spent a good ten seconds and couldn't think of a reason not to use 3. So far it looks nice!

Mixolyde wrote:

Yes, only psychopaths use 3 spaces.

kazar wrote:

Tabs vs spaces ...... Fight!

I create new files using tabs, but then eventually devolve into using two-space indentation. Or arbitrary-space indentation in some cases, if it makes the blocks line up nicer.

There is no such thing as tabs vs. spaces. It's "tabs AND spaces" vs spaces. Nobody makes a source file with tabs as the only whitespace character.

If tabs didn't already exist, nobody would invent them today. And anyone hell-bent on having their own pet indention levels could achieve it with a tiny bit of Vimscript to re-indent the file to their preferred level on open, then back to the original level on disk write, all without having to introduce another whitespace character type to the file.

The answer to all development questions is to just use Vim.

*Legion* wrote:

If tabs didn't already exist, nobody would invent them today.

So because it wouldn't be invented today, your conclusion is that we shouldn't use them. Then I challenge you to remove/disable the tab key on your keyboard (and not remap it to another key).

kazar wrote:
*Legion* wrote:

If tabs didn't already exist, nobody would invent them today.

So because it wouldn't be invented today, your conclusion is that we shouldn't use them. Then I challenge you to remove/disable the tab key on your keyboard (and not remap it to another key).

My tab key gets use, but never for anything associated with inserting a tab character into a document. It's navigation via tabstop, alt-tabbing, win-tabbing, etc.

Yeah we'd invent the Next button on computer keyboards

Shift+Next would be previous. Alt+Next would switch apps, etc.

kazar wrote:

So because it wouldn't be invented today, your conclusion is that we shouldn't use them. Then I challenge you to remove/disable the tab key on your keyboard (and not remap it to another key).

If you read closely, you’ll note that the only thing I explicitly made a statement about what shouldn’t or should be used is Vim.

Also, tab key != tab character. And if you think scripting a key to insert 2 spaces in the absence of having the Tab keystroke would be a burden, allow me to once again say Vim Vim Vim Vim Vim.

Vim is trash.

Nano 4ever.

"Honey! One of the kids stepped in an argument about editors and code formatting, and now they've tracked it all over the house!"

[rolls up a newspaper menacingly]

*Legion* wrote:

There is no such thing as tabs vs. spaces. It's "tabs AND spaces" vs spaces. Nobody makes a source file with tabs as the only whitespace character.

Therein lies madness. We're talking about indentation. Of course you'll be using spaces once actual code starts on a given line.

Kurrelgyre wrote:
*Legion* wrote:

There is no such thing as tabs vs. spaces. It's "tabs AND spaces" vs spaces. Nobody makes a source file with tabs as the only whitespace character.

Therein lies madness. We're talking about indentation. Of course you'll be using spaces once actual code starts on a given line.

I'mnotsurewhatyoumean?

imNotSureWhatYouMean

im_not_sure_what_you_mean

IImNotSureWhatYouMeanControllerFactory

IMAGE(https://i.imgflip.com/86wotb.jpg)

Seriously: I only made 2 Python scripts in my entire life. One to change the default browser to Firefox instead of Edge on my admin restricted work PC, and another to convert plain text to .csv ready format.

Hah yeah we have this admin request tool for a while now, and they changed everyone's access to not be admins on their own PCs. But my teammate needed to copy a file to one of the restricted folders (wwwroot for IIS I think). So there was no way to open Windows Explorer as admin. But... we could open Command Line or Power Shell as admin, and then use text commands to create, copy, etc.

So mostly it just makes thing a pain in the ass without really stopping us from doing whatever.

You forget it also increases the probability of errors!

My win 11 machine forgets 2 things every time I restart
- Resets my default browser to Edge
- Resets my mouse sensitivity to default (way too low)

I am an admin on my machine and nothing I have done has fixed it. It also does nothing Win 10 didn't do that I want, except not nag me about upgrading to 11.

I had a mouse that always reset its mouse sensitivity on reboot. No other mice did that, so I assume it was a hardware thing.

Stele wrote:

Hah yeah we have this admin request tool for a while now, and they changed everyone's access to not be admins on their own PCs. But my teammate needed to copy a file to one of the restricted folders (wwwroot for IIS I think). So there was no way to open Windows Explorer as admin. But... we could open Command Line or Power Shell as admin, and then use text commands to create, copy, etc.

So mostly it just makes thing a pain in the ass without really stopping us from doing whatever.

What a strange oversight to not lock down cmd or powershell -- if you can open those as admin, you can do anything.

Edit -- also, as someone who takes on some IT support duties when help is needed at my job, I fully support completely locking down everyone's computer. Sure, having to help someone install something that can't be installed via one of the automated processes is a pain in the ass, but it beats having to re-image their entire system because the internet told them that playing around in regedit would fix whatever problem they were having. This is doubly so with servers, where I've had the SAME f*ckING SCIENTIST overwrite libc on two separate occasions. The second time resulted in me being able to convince mgmt that locking down servers was worth it.

billt721 wrote:

Edit -- also, as someone who takes on some IT support duties when help is needed at my job, I fully support completely locking down everyone's computer.

As a developer, if I have no admin access, I literally can't do my job.

A couple years ago, our new company took away admin access from our normal accounts, but gave us each a network account that had admin rights on our own laptops. That means I can run nearly any app as administrator, just not Windows Explorer.

They recently took away our ability to use USB drives on any computer.

But we all still have access to the administrator account on any of our development/test VMs!

Quintin_Stone wrote:
billt721 wrote:

Edit -- also, as someone who takes on some IT support duties when help is needed at my job, I fully support completely locking down everyone's computer.

As a developer, if I have no admin access, I literally can't do my job.

Devs get admin access here.

If I ever interview for a job again, “do developers have root access to their own workstations?” will be one of my questions.

That was one of my starter questions, as I recently went through interviews (as I think I posted a few months back). But without exception, everyone I asked gave a confused "why wouldn't they?" look.

My team has some flavor of admin rights but we still need to make sure our Python interpreters are located inside a special DMZ folder hierarchy or we get permission denied errors trying to run the Python we write.

Don't know about you lot, but I'm getting ready for this years Advent of Code! Not that I'm doing a lot, mind you, but I am dusting off my copy of Visual Studio to get ready. Going to use Python again this year.

While dusting off Visual Studio, I was reminded of a project I started that transforms STL files. No details on the actual transformation but I'd like to simplify the running of the program and I'm hoping you'll be able to help.

The program takes a series of parameters (6) - all of which have default values and can be optional. It uses these parameters to transform the STL and write it to a new file while outputting various debug and progress messages to STDOUT (using print). I'd like to give myself a simple UI to enter the parameters; have a button I can push to run the program with the displayed parameters; and have the messages output to a window (can be a simple CMD window).

Any ideas?