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
Pavlov
Oct 21, 2012

I've long been fascinated with how the alt-right develops elaborate and obscure dog whistles to try to communicate their meaning without having to say it out loud
Stepan Andreyevich Bandera being the most prominent example of that
I learned vim because I was doing a lot of editing through ssh sessions. It's nothing particularly special, it's just the one I happened to learn.

A lot of unix-y programs have vim-like keybinds though, or a vim-like mode. So at least now I don't have to learn those control schemes from scratch.

Adbot
ADBOT LOVES YOU

Dessert Rose
May 17, 2004

awoken in control of a lucid deep dream...

NihilCredo posted:

I also get the impression that 3/4ths of the fancy stuff vim users brag about can usually be done just as fast with a regex ("I can type a command to replace all the text between braces!").

And becoming fluent with regex is both easier and far, far more applicable than becoming comfortable with vim.

Learning regex is sort of a prerequisite for being good at vim, given that one of the location commands is "regex", so you can say "change everything up to the nth match of this regex" if you want.

As for your example, I dunno, "ci}" and start typing is pretty fast. I think I'm pretty fluent in regex and it would take a little thought to come up with the equivalent regex, not to mention that I probably need to pull down a menu and go into a separate dialog for it in another editor, and I haven't encountered any editors other than vim/emacs (with evil-mode, natch) that let me see a live preview of the results of my selection/replacement in the text itself. When Sublime was my primary editor I frequently found myself hitting rubular and pasting a chunk of text in there to try things out.

The classics aren't for everyone, to be sure, but I feel like once I had the foundation pieces (understanding vim commands as a fluent language rather than isolated key sequences was a big one) each additional thing I learned was more like a multiplier, enhancing all the things I already knew rather than just adding on.

But people who just cargo cult it because they heard a lot of famous hackers use them, and then never actually learn the parts that make it rewarding, are just wasting everyone's time.

VikingofRock
Aug 24, 2008




NihilCredo posted:

I also get the impression that 3/4ths of the fancy stuff vim users brag about can usually be done just as fast with a regex ("I can type a command to replace all the text between braces!").

And becoming fluent with regex is both easier and far, far more applicable than becoming comfortable with vim.

Vim uses regexes a ton (especially for stuff like search and replace), so you are partially right in that it is equally fast to use a regex. But to my knowledge "do stuff between this set of braces" is actually impossible for most regex engines if there might be arbitrary nested braces within the braces. With vim it's usually just a few keystrokes to handle this, depending on the specific problem at hand.

In any case, the real reason I think most people like vim isn't for the speed per se, but because the modal editing style matches their thought process. That alignment means vim is less disruptive to their train of thought than other editors, making it more pleasant to use.

jony neuemonic
Nov 13, 2009

Dessert Rose posted:

As for your example, I dunno, "ci}" and start typing is pretty fast. I think I'm pretty fluent in regex and it would take a little thought to come up with the equivalent regex, not to mention that I probably need to pull down a menu and go into a separate dialog for it in another editor, and I haven't encountered any editors other than vim/emacs (with evil-mode, natch) that let me see a live preview of the results of my selection/replacement in the text itself. When Sublime was my primary editor I frequently found myself hitting rubular and pasting a chunk of text in there to try things out.

The classics aren't for everyone, to be sure, but I feel like once I had the foundation pieces (understanding vim commands as a fluent language rather than isolated key sequences was a big one) each additional thing I learned was more like a multiplier, enhancing all the things I already knew rather than just adding on.

Yeah, Vim is a fantastic tool for working with text and absolutely worth the time to learn. I don't use it for programming anymore (graphical debuggers are, you know, nice) but I still keep it around for text munging.

brap
Aug 23, 2004

Grimey Drawer
as long as you don't nest the braces, sure
e:f,b

Pavlov
Oct 21, 2012

I've long been fascinated with how the alt-right develops elaborate and obscure dog whistles to try to communicate their meaning without having to say it out loud
Stepan Andreyevich Bandera being the most prominent example of that

I too sometimes forget I'm not typing in vim. But why name a file ',b' ?

feedmegin
Jul 30, 2008

Some of us manage commercial Unix boxen where vi (not vim) is the only fullscreen text editor that is guaranteed to be on there. :corsair:

TheresaJayne
Jul 1, 2011

feedmegin posted:

Some of us manage commercial Unix boxen where vi (not vim) is the only fullscreen text editor that is guaranteed to be on there. :corsair:

Thats what i learned with back in college (many moons ago) we had a Unix SysV mini for the computing department, and there were backdoors a plenty meaning that when i left the junior group took over from the senior group "hackers" and the server went down 4-7 times a day as people went in as root and types kill -9 -1.

I cannot get emacs or the other editors they try to hit us with, specially on ubuntu - the first thing i do is make sure that Vi(m) is installed.

sarehu
Apr 20, 2007

(call/cc call/cc)
I looked at my old Boolfuck interpreter that I wrote 10 years ago, and...

code:
boolpit &
boolpit::operator=(const boolpit & assignee)
{
	delete [] beg_;
	copy(assignee);
}
Yeah, a bad assignment operator.

Also poo poo like

code:
	unsigned char * p = beg_ + offset;

	if (p < beg_  ||  end_ <= p) {
		grow_and_accommodate(p);
	}

	/* This magical line assigns to the bit. */
	(*p |= ((i != 0) << setter))
		&= ~((i == 0) << setter);
But wait, surely by the last line p could be invalidated! Nope, grow_and_accommodate took the pointer by reference and wrote to it. (Never mind the undefined behavior in the pointer arithmetic, and the oh-I'm-so-clever bit assignment.)

Boolpit, more like, cesspit.

I got so mad that I rewrote the whole thing.

Bognar
Aug 4, 2011

I am the queen of France
Hot Rope Guy

jony neuemonic posted:

Yeah, Vim is a fantastic tool for working with text and absolutely worth the time to learn. I don't use it for programming anymore (graphical debuggers are, you know, nice) but I still keep it around for text munging.

Vim plugins for IDEs give you the best of both worlds.

csammis
Aug 26, 2003

Mental Institution

Bognar posted:

Vim plugins for IDEs give you the best of both worlds.

Unless the plugin is incomplete and some basic commands aren't implemented and then you fork the plugin repo and you spend all your time figuring out how it works so you can JUST TURN OFF SEARCH HIGHLIGHTING :saddowns:

Pavlov
Oct 21, 2012

I've long been fascinated with how the alt-right develops elaborate and obscure dog whistles to try to communicate their meaning without having to say it out loud
Stepan Andreyevich Bandera being the most prominent example of that

Bognar posted:

Vim plugins for IDEs give you the best of both worlds.

I code a lot on a netbook, so IDEs take up too much screen space.

Xarn
Jun 26, 2015

Pavlov posted:

I code a lot on a netbook, so IDEs take up too much screen space.

All my non job related work is done on FHD x250 (12.5") and the space taken is well worth it. (I also took some time to configure things like windows sizes, positions, to work for me)

All my job related work is done on two 24" dells. :getin:

sarehu posted:

I looked at my old Boolfuck interpreter that I wrote 10 years ago, and...

code:
boolpit &
boolpit::operator=(const boolpit & assignee)
{
	delete [] beg_;
	copy(assignee);
}
Yeah, a bad assignment operator.
...

We have the exact same error (well, delete[] is called inside different function :v:) in production code at work.

I am not allowed to fix it, because the guy who wrote it was the local template guru...

Xarn fucked around with this message at 20:02 on Nov 16, 2015

xzzy
Mar 5, 2009

I used to be all about multi-monitors and for some types of work it definitely makes sense, but for straight up typing into an editor all day a single screen is a lot more comfortable to me. Especially with the way modern desktops have gotten pretty good at window management and finding what you need quickly. Microsoft is still lagging though they are getting better, and OSX's mission control is pretty drat great.

So to me, having a single big screen is the way to go.. something in the 26 inch to 30 inch range.

I'd love to convince my employer to get me a 4k screen but it's probably a ways off.

Internet Janitor
May 17, 2008

"That isn't the appropriate trash receptacle."
If your employer balks at spending $500 to $1000- hopefully a tiny sliver of your yearly salary- on equipment that will make you happier and more productive it sounds like they don't have their priorities straight.

Karate Bastard
Jul 31, 2007

Soiled Meat
I've tried and tried to not use PyDev, to use emacs like the big boys, but in the end I always come crawling back.

I do love me that hot F3 action. That Ctrl-space for docs and param names.

xzzy
Mar 5, 2009

It's not the money that's the problem, it's the regulations that control purchases and certifications that devices need to make. Government loves bureaucracy!

My boss has flat out stated he'd love to buy me any tiny little thing I could ask for if it weren't for the rules.

Karate Bastard
Jul 31, 2007

Soiled Meat

xzzy posted:

My boss has flat out stated he'd love to buy me any tiny little thing I could ask for if it weren't for the rules.

*pfffft* hahaha oh my sweet child.

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

I'm not sure 4K is what I want for coding. Either I'm far enough back that I need to scale up and lose the benefit, or I'm close enough that I have to turn my head.

b0lt
Apr 29, 2005

Subjunctive posted:

I'm not sure 4K is what I want for coding. Either I'm far enough back that I need to scale up and lose the benefit, or I'm close enough that I have to turn my head.

A 3440x1440p screen is the best for coding (although I don't have one at work :()

JawnV6
Jul 4, 2004

So hot ...
I'm currently fighting my VM & guest OS to make editing not a giant pain. The current stalemate has a giant 1" top bar and text I need a microscope for, but on the plus side each function fits on a "page"

b0lt posted:

A 3440x1440p screen is the best for coding (although I don't have one at work :()
With 3 or 4 other pieces of context this number might mean something.

Xarn
Jun 26, 2015
If I could, I would take my two monitors and have them rotated 90 degrees (effectively making them 9:16). Sadly, their mount does not support this and Id rather not jury rig something.

NihilCredo
Jun 6, 2011

iram omni possibili modo preme:
plus una illa te diffamabit, quam multæ virtutes commendabunt

I'll take four comparatively cheap 23" 1080p screens over a single 30"-40" 4K screen, personally.

I need lots of screen real estate, but I don't particularly need to have it on the same screen. Having several cheaper screens will provide the same total real estate for the same or probably less money, and will display it in a bigger size = easier on the eyes.

Currently I'm using a 26" screen, a 17" laptop screen, and a 15" touchscreen. It works well enough - IDE / SQL on the main screen, email / browser on the laptop, our program on the touchscreen (it's the smallest size we support). I may end up grabbing another screen from the storage at some point, if I can be bothered to deal with the huge red tape involved*.



* by which I mean "ask the warehouseman if there's any monitors I can grab that won't be needed for a few months". Small companies have generally poo poo pay, but there's some silver linings.

xzzy
Mar 5, 2009

A coding failure: a programmer I know of has three 1920x1200 monitors on his desk, each about 27" in size. It makes a really cool looking arc around his chair.

Whenever I walk past? He's hunched over, banging away on his laptop.

I've decided the monitors are just there to show off his awesome wallpapers.

Deep Dish Fuckfest
Sep 6, 2006

Advanced
Computer Touching


Toilet Rascal

xzzy posted:

A coding failure: a programmer I know of has three 1920x1200 monitors on his desk, each about 27" in size. It makes a really cool looking arc around his chair.

Whenever I walk past? He's hunched over, banging away on his laptop.

I've decided the monitors are just there to show off his awesome wallpapers.

Well, hell, if they're really awesome wallpapers then it's worth it.

Anyhow, I found one of my favorite coding horror some time back while debugging a C++ codebase. I tracked down the problem to a singleton (not unexpected since that codebase had literally hundreds of them), and noticed it had virtual functions in it. And after a quick search, it turned out that there was actually another class deriving from it. I tried to figure out how that would even work, conceptually, but just couldn't. In practice, though, it didn't. The singleton object itself was held by a pointer in the base class, and depending on which version of the static "GetInstance" method (base or derived) was called first, the singleton would be instantiated with the matching type. And on subsequent calls, "Derived::GetInstance" would gleefully static_cast to the derived type because type safety is for pussies (although that obviously wasn't the main horror here). The entire thing relied on no one adding a call to "Base::GetInstance" at the wrong place in order not to blow up. I think it was used in some multithreaded code, too.

To this day, I still have no idea how this could happen by accident. I think that maybe I'm the horror here, and the only reason I think this was horrid is because it was written by someone so much smarter than I am that I can't even begin to understand the reasoning behind it. Like a monkey trying to understand neurosurgery or something.

raminasi
Jan 25, 2005

a last drink with no ice

YeOldeButchere posted:

Well, hell, if they're really awesome wallpapers then it's worth it.

Anyhow, I found one of my favorite coding horror some time back while debugging a C++ codebase. I tracked down the problem to a singleton (not unexpected since that codebase had literally hundreds of them), and noticed it had virtual functions in it. And after a quick search, it turned out that there was actually another class deriving from it. I tried to figure out how that would even work, conceptually, but just couldn't. In practice, though, it didn't. The singleton object itself was held by a pointer in the base class, and depending on which version of the static "GetInstance" method (base or derived) was called first, the singleton would be instantiated with the matching type. And on subsequent calls, "Derived::GetInstance" would gleefully static_cast to the derived type because type safety is for pussies (although that obviously wasn't the main horror here). The entire thing relied on no one adding a call to "Base::GetInstance" at the wrong place in order not to blow up. I think it was used in some multithreaded code, too.

To this day, I still have no idea how this could happen by accident. I think that maybe I'm the horror here, and the only reason I think this was horrid is because it was written by someone so much smarter than I am that I can't even begin to understand the reasoning behind it. Like a monkey trying to understand neurosurgery or something.

That just sounds like somebody was cargo-culting inheritance and did it on the wrong thing for a bad reason.

TheresaJayne
Jul 1, 2011

xzzy posted:

I used to be all about multi-monitors and for some types of work it definitely makes sense, but for straight up typing into an editor all day a single screen is a lot more comfortable to me. Especially with the way modern desktops have gotten pretty good at window management and finding what you need quickly. Microsoft is still lagging though they are getting better, and OSX's mission control is pretty drat great.

So to me, having a single big screen is the way to go.. something in the 26 inch to 30 inch range.

I'd love to convince my employer to get me a 4k screen but it's probably a ways off.

At work i started a trend, we have Dell wide screen 24" monitors, i always have one vertical to allow me to see more of the code on one page (coding standards limits us to 120 characters wide)
All of a sudden nearly everyone in my vicinity is using vertical screen.....

sarehu
Apr 20, 2007

(call/cc call/cc)
When I was in college, I was a whore that had summer job money so when there was a sale on 20" 1680x1050 FW-something-something Dell monitors, I got one. And then, I put it in vertical mode. And my roommate didn't even notice! I was so mad.

Dessert Rose
May 17, 2004

awoken in control of a lucid deep dream...

sarehu posted:

When I was in college, I was a whore that had summer job money so when there was a sale on 20" 1680x1050 FW-something-something Dell monitors, I got one. And then, I put it in vertical mode. And my roommate didn't even notice! I was so mad.

I am pretty sure you got the same one I did - 2008FPW. They were using the same LCD elements as the Apple Cinema Display and there was some sale or other that made them fantastically cheap.

I still have mine. It still works, although the color is kind of faded when you put it next to current tech, and if it hasn't had a real signal sent to it for a while it takes a while to warm up (no, seriously, it has massive screen jitter until it's been used for 20 minutes or so).

I can't throw it out though because it still basically works fine. Best 400 bucks or whatever it was I spent.

FlapYoJacks
Feb 12, 2009
I have quad 24 inch monitors at work. Two vertical, two horizontal. I use one exclusively for Spotify. :smug:

Polio Vax Scene
Apr 5, 2009



Outlook - Tickets - IDE - Testing Environment

HFX
Nov 29, 2004
Not a code horror, but a code related horror.

Use the local artifact cache to limit a list of artifacts to only approved ones: Not great. Have to get new versions approved: Worse. Breaking the build system because you didn't even bother to approve the default maven build / test / assemble plugins: Words cannot describe.

The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer
I have 2 monitors + my laptop screen. I have one straight ahead of me in the traditional position. I just throw Outlook and a couple other "glance at a couple times an hour" type things on the laptop screen and throw any documents or other reference material on the other monitor. All the actual coding and testing happens on the primary monitor. The others exist mostly to avoid the inconvenience of having to find poo poo I need to reference underneath my active window.

Deep Dish Fuckfest
Sep 6, 2006

Advanced
Computer Touching


Toilet Rascal

GrumpyDoctor posted:

That just sounds like somebody was cargo-culting inheritance and did it on the wrong thing for a bad reason.

I guess that's as sensible an explanation as can be. It's just that it had to pass code review at some point, so it's not just a matter of finding one person with a questionable understanding of inheritance, you need to find at least two of them. Maybe the "cult" part of cargo-cult needs to be emphasized here. I think the other reason why I was bothered by this so much is that this isn't some complex pattern that relies on subtle details to work properly. It's a loving singleton. There's some pitfalls to getting it right in C++, but conceptually it's kind of straightforward as far as design patterns go, I'd say.

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



Someone here has apparently given up fighting to get the lovely intel garbage fire graphics these things come with to use both external monitors connected to the base station because one monitor has filled up with post-it notes. Also both external monitors are on one of those nice, fully-adjustable arm mounts, so there's a monitor and a mount turned into an expensive bulletin board.

Hughlander
May 11, 2005

Munkeymon posted:

Someone here has apparently given up fighting to get the lovely intel garbage fire graphics these things come with to use both external monitors connected to the base station because one monitor has filled up with post-it notes. Also both external monitors are on one of those nice, fully-adjustable arm mounts, so there's a monitor and a mount turned into an expensive bulletin board.

Meh. Guy at work writes on his MBP screen with a sharpie for important notes.

FlapYoJacks
Feb 12, 2009
Coding horror of the day.

code:
$i = 0;
while($i < 2)
{
    $i = $i + 1;

    DO STUFF
}

xzzy
Mar 5, 2009

Maybe the author intends to run the loop a thousand times once they perfect the DO STUFF algorithm!

Deep Dish Fuckfest
Sep 6, 2006

Advanced
Computer Touching


Toilet Rascal
And if not it'll totally go away Soon(tm) when we're done with that new replacement thing.

The oldest "we'll do this real soon" comment I've personally seen was a year or two ago in the PostgreSQL code base, dated early 1991.

Adbot
ADBOT LOVES YOU

The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer

YeOldeButchere posted:

And if not it'll totally go away Soon(tm) when we're done with that new replacement thing.

The oldest "we'll do this real soon" comment I've personally seen was a year or two ago in the PostgreSQL code base, dated early 1991.

I've seen "we should do <thing>" comments as old as 1985 in our codebase. I wonder how many of them are actually still relevant.

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