There have been multiple accounts created with the sole purpose of posting advertisement posts or replies containing unsolicited advertising.

Accounts which solely post advertisements, or persistently post them may be terminated.

programmer_humor

This magazine is from a federated server and may be incomplete. Browse more on the original instance.

spamspeicher , in Movies vs life

And every little thing on the screen makes a noise.

greendakota99 ,

I’m surprised more people do not talk about this. Its easily the most annoying trope for me. Could you imagine hearing your machine beep through processing for 8-10 hours at a time each day? Its asinine to even consider anyone in these technology roles would deal with that.

nicerdicer ,

I think this is because it is pretty boring to film a computer in action, because it does noting - it doesn’t move for example. So beeping sounds were added for every action a computer would do: opening or closing windows, transferring files to a disk, calculating,…

These sounds were added at a time computers were not that common in every household and to emphazise that the computer is doing something. In recent movies, computers are more silent.

Another thing film makers did to show interaction with a computer is the constant usage of the keyboard. Every thing is done with the keyboard. Open a window: type 5 sceonds on the keyboard. Transferring a file onto a disk: type the whole bible on the keyboard. This was done because it would be pretty boring to show someone use the mouse or drag-and-drop files.

It its somehow compareable to the movie trope of constantly reloading a gun. You can see this often in older movies: the protagonist is going inside a building and he is reloading his gun. Then he stops a the corner of a hallway and is reloading the gun again - despite no shot has been fired. This was also done to show the audience that a gun will be involved.

droans ,

Don’t forget. If you have a server and it’s been penetrated, there needs to be a monitor which displays “SERVER HACKED” in giant, red, blinking text.

SomeRandomWords ,

Man, imagine how useful that would actually be though? You’d save a lot of money and headache a few months down the line…

SendMePhotos , (edited ) in wait what

But like… Correct me if I’m wrong but in my experience tab does not always equal 4 spaces.

E: thanks all. I didn’t fully understand.

KairuByte ,
@KairuByte@lemmy.dbzer0.com avatar

You’re misunderstanding. In this case it means “one tab character” instead of “four space characters”.

dan ,
@dan@upvote.au avatar

That’s one of the benefits of using tabs. Some people might like 4 spaces for indentation, whereas others like 2 spaces. If you use tabs, you can configure your editor to use whatever tab size you want, and they’re just stored as tab characters in the file.

Tabs for indentation, spaces for alignment (eg for ASCII art).

gitamar ,

That’s why it’s also a big accessibility feature. With big font sizes, four spaces are distracting but you can configure tabs to show up as one character, which is way more reasonable with font sizes larger than usual

Waraugh ,

I had a colleague that is legally blind in my second real job. The dude is brilliant (and hilarious) but these things would significantly enable or screw up his productivity. I have always felt fortunate to have had direct butt in seat exposure to the importance of accessibility at such a young age.

MadBob ,

Four? Uh oh…

abucci , in White House weighing in on the big issues
@abucci@buc.ci avatar

@andrew I know exactly one vi command. :q!

Illecors , in It's kahoot time

What’s Martin Fowler a pun for?

Isoprenoid ,

I don’t think it’s a pun. It’s an actual person.

en.wikipedia.org/…/Martin_Fowler_(software_engine…

I don’t get:

Reed Hucks (“Redics”? What does that mean?) Ann Vars Heather Net

noli ,

Reed hucks = redux Heather net = ethernet

prettybunnys ,

I think Ann Vars is ENV_VARS or similar.

camr_on , in White House weighing in on the big issues
@camr_on@lemmy.world avatar

He’s got my vote

histic , in I need this....

Help! It didn’t change my code at all it’s just the same!

devilish666 OP ,

Congrats then…

InnerScientist ,

Can’t Improve Upon Perfection

anarchyrabbit , in C++ Moment

Story time. Back at uni I had a c++ subject. Me being lazy as fuck I didn’t attend many classes and let alone do the practicals during the semester. Exam time comes around. I realise I can’t cram in a whole semester’s learning in a week. Luckily it’s open book exam. Big brain time, I print the whole c++ documentation to take into the exam. I frantically page through the hundreds of pages in my lever arch file looking for answers. I pretty much copy and write example code to questions. Very sad when I failed.

JoMiran , in White House weighing in on the big issues
@JoMiran@lemmy.ml avatar

Finally, a president I can get behind.

NegativeLookBehind , in White House weighing in on the big issues
@NegativeLookBehind@lemmy.world avatar

Agreed

JATtho , in C++ Moment

<span style="color:#323232;">gdb> break before it crashes
</span><span style="color:#323232;">gdb> record full
</span><span style="color:#323232;">gdb> continue
</span><span style="color:#323232;">(segfault)
</span>

gdb> set exec-direction reverse

Traister101 , in wait what

Tabs are objectively the better choice as it allows each dev individually to decide tab width in their editors. Spaces in contrast don’t allow this same flexibility as they are used for much more than simply indentation, for example you likely put a space after each argument or operator IE func(arg1, arg2) or 1 + 2.

zea_64 ,

Also, a lot of editors won’t unindent on backspace of spaces indentation, so I end up messing up the indentation with a 3/4 indent

coloredgrayscale ,

Autoformatter should fix that, unless you use python. (but even then they might fix it to the closest proper indentation level)

Traister101 ,

Sometimes. I love auto formatting, I spam the shit out of it more than I spam save but it’s definitely not perfect. It gets real confused with inconsistent indention like that. Especially with Python it’ll fuckup

mexicancartel ,

Yeah you need an auto formatter, which is worse than not needing it. Also yes its terrible in python like languages

expr ,

That just sounds like a shitty editor, tbh. Pretty basic functionality.

driving_crooner ,
@driving_crooner@lemmy.eco.br avatar

Too much waste of space imo, func(arg1,arg2) or 1+2 is faster to write and to read.

andnekon ,

Stilltoomuchwasteofspace

I_am_10_squirrels ,

Whyusemanywordwhenfewworddotrick?

expr ,

Code can be viewed in more than just an editor. It might be in a terminal, rendered in a browser, etc. Sometimes you might even have to view it in an environment you don’t control. I am very disinterested in configuring each and every tool to have sensible tabstops, if such a tool can even be configured.

Traister101 ,

Then don’t? The whole reason nearly all the spaces guys do 4 spaces is cause that’s the nearly universal tab width. You won’t like this but the same exact argument can be made for spaces yet I’d bet you haven’t even once configured the width of those.

I don’t actually change tab width, it’s the default 4 spaces equivalent for me but just because I don’t take advantage of the ability doesn’t mean I should prevent others from doing so.

lemmyng ,
@lemmyng@lemmy.ca avatar

The whole reason nearly all the spaces guys do 4 spaces is cause that’s the nearly universal tab width.

That is provably wrong. The default tab width in vim is 8 spaces, and the default indentation in yaml is two spaces.

Traister101 ,

What’s yaml have to do with anything? It’s like python with syntactic whitespace which is unrelated to this discussion. The Tab vs Space debate is entirely around non syntactic whitespace which doesn’t effect how the code is parsed. And yes Python technically does both tabs and spaces but it’s all sorts of fucky.

Terminal editors while still used a ton aren’t really what I was referring to. Newer terminal editors such as Helix have tab width configured per language most of which default to a width of 4 spaces but toml/yaml both default to 2 spaces. I was mainly referring to GUI editors as frankly that’s just what most people use nowadays. JetBrains IDEs, Visual Studio, Eclipse, VS Code, Notepad++ were primarily what I was thinking of as I’ve used all of them and they all default to a tab width of 4 hence why I said nearly universal. Also I said nearly terminal editors being the only editors I’ve used that don’t default to a width of 4 seems like a fair usage of the term.

lemmyng ,
@lemmyng@lemmy.ca avatar

Now you’re just shifting the goalpost.

expr ,

This is simply false, many systems have them configured by default to 8, particularly most CLI tools. Git, for example, is 8, and btw, changing it is not readily done and requires you to hack around it by using a custom pager command. In fact, all core gnu utils (and even bash itself) default to 8, as well vim, emacs, nano, gedit, etc.

I use 2 spaces since I work in Haskell, which is a significant whitespace language where you want certain syntactic constructs to exist at a different level of indentation from your main code block. So yes, I have configured it. 2 spaces is also exceedingly common for HTML (browser Dev tools renders HTML with 2 spaces, even).

There is not a universal indentation width, though it is almost always universal within a particular language or perhaps project, in which case it’s much better to have everything standardized. Code formatters enforced on a project are the norm, and those are way more impactful on how the code is read. But they are valuable because consistency is valuable. And yet, somehow you don’t have huge scores of developers complaining about being forced to format their code in a way they don’t like.

As I said, you don’t necessarily control the environment in which you are viewing code. A common example is reading code over a shared screen. So you can easily end up reading code in a way you don’t like anyway, so it may as well be some reasonable (if not preferable) standard that everyone is using.

Traister101 ,

Looking at code on somebody else’s screen is entirely missing the point of using tabs over spaces. The entire point is that mine looks like how I want and theirs looks like how they want even though the file is identical. We can each have wildly different tab width yet it’ll look wildly different to each of us when we program. That’s again the point.

Code formatters are great! I love them. Using tabs over spaces is objectively a better formatting option. One of my favorite features in code formatters is that they’ll swap out spaces to tabs for you insane people who insist on mashing the space bar to indent.

lemmyng ,
@lemmyng@lemmy.ca avatar

No, it’s not missing the point. The premise that you’re always looking at code on the same screen is false, and you don’t always have control over how all screens are configured.

expr ,

Umm, you do realize no one manually enters all of the spaces, right? Basically all editors support an expandtab feature which inserts the amount of spaces you want whenever you hit the tab key.

Code formatters behave exactly the same regardless if you’re using tabs or spaces, so not sure what you’re talking about.

I did not miss the point. I fully understand that’s why people want tabs. I just think it’s a pretty stupid and petty reason to make for a worse experience when viewing code in places you don’t control. I still don’t know why using spaces is an issue when we enforce standards in literally every other facet of contributing to a codebase. We enforce coding styles. Indentation is part of the coding style.

mindbleach , in wait what

Tabs exist specifically for spacing out stops. They’re viewer-configurable, avoiding holy wars about 4 or 8 or that one idiot suggesting 3.

I do not give a shit if your seventeen-argument function has the overflow variables line up exactly with the paren. Just put them one step further in.

mindbleach ,

I just remembered the dumbest argument I’ve ever suffered about this - someone insisting the “length” of one tab changed, depending on what’s before it. As in, is it eight spaces, or seven? Or six! It only goes up to eight spaces! No. It goes one stop. The same way a newline goes one line, and cannot by measured by how many times you’d slap the spacebar to get text to wrap around to the next line.

kogasa ,
@kogasa@programming.dev avatar

Err, why would there ever be something besides a tab before a tab? Are we doing ASCII art?

dan , (edited )
@dan@upvote.au avatar

They mean if you insert a tab after some other text.

Word processors and desktop publishing apps tend to have tab stops (sometimes visible in a ruler at the top of the page) and pressing tab goes to the next tab stop. They’re about an inch apart (assuming letter or A4 paper) by default, and you can usually also add your own tab stops. For example, you might have text like this:


<span style="color:#323232;">Hi
</span><span style="color:#323232;">Hello
</span>

Assuming the next tab stop is to the right of both words, pressing tab at the end of each one would actually bring you to the same indentation level:


<span style="color:#323232;">Hi      |
</span><span style="color:#323232;">Hello   |
</span>

Text editors and IDEs don’t do that, and instead make all tabs the same size regardless of where they are.

Some people want the word processor implementation in text editors though. The comment you replied to is saying that’s dumb, and I agree with them.

kogasa ,
@kogasa@programming.dev avatar

I understand… In a programming environment 99.999% of tabs aren’t after any other text.

pohart ,

Your ide should align things how you configure them to be aligned. Nothing says all my tabs need to be the same length.

mokus , in C++ Moment

cries in verilog

hakunawazo , in wait what

Let’s just avoid indentation at all (jk).
Always remember:
https://lemmy.world/pictrs/image/a621c906-0552-4ebb-b983-597b3d7ff938.jpeg

hansl ,

“He’s me.” - Obi Wan Kenobi

laurelraven , in wait what

No.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • [email protected]
  • random
  • lifeLocal
  • goranko
  • All magazines