New around here? Register your SA Forums Account here!

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 $10! We charge money because it costs us money per month for bills alone, and since we don't believe in shady internet advertising, we try to make the money back through forum registrations.
 
  • Post
  • Reply
eschaton
Mar 7, 2007

the knowledge knower. a wisdom imparter. irritatingly self-assertive. odorous.
LOL yeah everyone just loves an Amiga clone of a 70s screen editor hack atop a teletype line editor for a rather dumb terminal that lacked independent arrow keys

it’s totally not just cooler-than-thou hipsterism to use vim instead of a modern editor that follows your platform’s human interface conventions

at least emacs users are amenable to modernization

Adbot
ADBOT LOVES YOU

eschaton
Mar 7, 2007

the knowledge knower. a wisdom imparter. irritatingly self-assertive. odorous.
it’s the programmer equivalent of the guy with the handlebar mustache who wears vintage threads and carries an underwood portable typewriter into the cafe to do his writing

eschaton
Mar 7, 2007

the knowledge knower. a wisdom imparter. irritatingly self-assertive. odorous.
like don’t get me wrong I’m also not one to use GitHub (a Microsoft company) Atom or Microsoft Atom (VSCode) since web pages aren’t apps, they’re for displaying information, but they try to be at least somewhat modern even as they reimplement the world in JavaScript

Achmed Jones
Oct 16, 2004



but you making GBS threads on people about their text editor is different because you called them hipsters oh dear dolores call the police

redleader
Aug 18, 2005

Engage according to operational parameters
"the web is only for documents" - an equal hipster

Nomnom Cookie
Aug 30, 2009



eschaton posted:

LOL yeah everyone just loves an Amiga clone of a 70s screen editor hack atop a teletype line editor for a rather dumb terminal that lacked independent arrow keys

it’s totally not just cooler-than-thou hipsterism to use vim instead of a modern editor that follows your platform’s human interface conventions

at least emacs users are amenable to modernization

i use vim because :s and :v are useful and i can't be bothered to learn replacements. also vi is everywhere

very good for editing text. totally rear end for writing code

and i think you will find that the hipsters have moved on to neovim, atom and vscode

Workaday Wizard
Oct 23, 2009

by Pragmatica

Kevin Mitnick P.E. posted:

i use vim because :s and :v are useful and i can't be bothered to learn replacements. also vi is everywhere

very good for editing text. totally rear end for writing code

and i think you will find that the hipsters have moved on to neovim, atom and vscode

vscode is normie as hell and that’s why it’s the best one out of these

ssergE
Sep 9, 2001

No longer a stupid baby. Now a stupid teenager.

gonadic io posted:

one of the things I really like about Rust is that without an implicit self/this, it makes you think about (and clearly mark your methods) for if they are stateful, rely on state, mutate state, etc etc. It breaks down in the context of globals/mutexes but it's still v nice to have.

Hopefully not to be too dense here, but I got around to trying what you suggested and have a couple of follow up questions. Here's a playgound with most of what I have:
https://play.rust-lang.org/?gist=915186065b07ee90e3d84a6d2ce53d0c&version=stable&mode=debug&edition=2015

My main two questions are:
How can I pass in and call the static method DateAdjustment::adjust easily (such as in the AdjustForBusinessDays for NaiveDate?

I'm guessing it needs to be wrapped in something (Box?) that knows what the passed in object is and where the method would be, but I was hoping to have something more like in my Scala version where there were singleton object instances that made it easy - is there a way to have a static lifetime instance of each DateAdjustment that can just be pulled in and used by whoever?

Xarn
Jun 26, 2015

Shinku ABOOKEN posted:

vscode is normie as hell and that’s why it’s the best one out of these

comedyblissoption
Mar 15, 2006

i like emacs b/c i think it has a legit better UI and philosophy for editing text for whatever than flavor of the month editors

its anachronism has ironically made it make better UI decisions. a text-based interface has lots of pros over guis

comedyblissoption fucked around with this message at 11:29 on Sep 24, 2018

gonadic io
Feb 16, 2011

>>=

ssergE posted:

Hopefully not to be too dense here, but I got around to trying what you suggested and have a couple of follow up questions. Here's a playgound with most of what I have:
https://play.rust-lang.org/?gist=915186065b07ee90e3d84a6d2ce53d0c&version=stable&mode=debug&edition=2015

My main two questions are:
How can I pass in and call the static method DateAdjustment::adjust easily (such as in the AdjustForBusinessDays for NaiveDate?

I'm guessing it needs to be wrapped in something (Box?) that knows what the passed in object is and where the method would be, but I was hoping to have something more like in my Scala version where there were singleton object instances that made it easy - is there a way to have a static lifetime instance of each DateAdjustment that can just be pulled in and used by whoever?

is it a requirement that somebody outside this file needs to make their own DateAdjustments? If it's not then the enum version is easier all around imo.

one way to bypass the lifetime issue in the trait version is to pass around the type in generics:
code:
pub trait AdjustForBusinessDays {
    fn adjust<D: DateAdjustment>(self, cal: &Calendar) -> NaiveDate;
}

impl AdjustForBusinessDays for NaiveDate {
    fn adjust<D: DateAdjustment>(self, cal: &Calendar) -> NaiveDate {
        D::adjust(self, cal)
    }
}
since the struct DateAdjustment is empty there's no point actually creating them when you only want to use the types to select which method to call

mystes
May 31, 2006

Isn't it kind of overkill to add a generic type parameter that you don't really use just to select which function to call anyway? It seems like there should be a better way to do this. I don't know if using a function pointer would be better, though.

mystes fucked around with this message at 13:31 on Sep 24, 2018

Captain Foo
May 11, 2004

we vibin'
we slidin'
we breathin'
we dyin'

hoboman did u rewrite teh forum yet

gonadic io
Feb 16, 2011

>>=

mystes posted:

Isn't it kind of overkill to add a generic type parameter that you don't really use just to select which function to call anyway? It seems like there should be a better way to do this. I don't know if using a function pointer would be better, though.

yep, use the enum. The issue is having it being extensible in which case the function pointers might be okay.
using function pointers though ends up being basically the same thing as the trait: https://play.rust-lang.org/?gist=f7fa45e938afcb499a071d72bd546004&version=stable&mode=debug&edition=2015
which makes sense because the trait is wrapping a single function

Finster Dexter
Oct 20, 2014

Beyond is Finster's mad vision of Earth transformed.

Captain Foo posted:

hoboman did u rewrite teh forum yet

what happened with hoboman? did he move to belize?

Finster Dexter
Oct 20, 2014

Beyond is Finster's mad vision of Earth transformed.

mystes posted:

Isn't it kind of overkill to add a generic type parameter that you don't really use just to select which function to call anyway? It seems like there should be a better way to do this. I don't know if using a function pointer would be better, though.

A normal way would just be creating a function that takes each type as an argument or something, which in my mind seems like a wash in terms of API clarity. Maybe it's better to do separate functions because it's explicit about exactly which types are allowed? In c# you'd use an interface, maybe, and then that would enforce a certain contract while allowing someone to bring their own thingy, but I don't know what you would do in Rust for that.

prisoner of waffles
May 8, 2007

Ah! well a-day! what evil looks
Had I from old and young!
Instead of the cross, the fishmech
About my neck was hung.
I'm not going to contradict anyone who wants to poo poo on vim because yes, there's always someone overhyping the old beardy editors.

vim is Okay assuming that you have a couple of years over which to gradually learn its ins and outs and what it can do for you. (I'm assuming that emacs is kind of the same thing, but even more so due to easier programmability etc.)

sometimes it helps me do some lesser Magic but I'd argue it's not worth trying to learn unless you've got a while to learn it, in the midst of doing other important things.

if this makes vim sound utterly useless to you, you've got my blessing: continue ignoring vim

bob dobbs is dead
Oct 8, 2017

Peeps are idiots, Leslie.
Nap Ghost
learning a greybeard text editor is one of the technical investments that will actually be reasonably guaranteed to pay dividends for at least the next few decades

emacs is 40 years old and still going, vim is 30 years old, still going, and that was a relatively smooth switchover from vi, which is 40 years old

there will be peeps who are writing poo poo in vim when we all die

Shaggar
Apr 26, 2006
vim and emacs are dumb garbage that provide no benefit to anyone. their obtuse UIs were stupid even when they were established and were abandoned for modern editors like 30 years ago. nobody should still be using Linux text editors.

Captain Foo
May 11, 2004

we vibin'
we slidin'
we breathin'
we dyin'

edit.com supremacy

Finster Dexter
Oct 20, 2014

Beyond is Finster's mad vision of Earth transformed.

Shaggar posted:

vim and emacs are dumb garbage that provide no benefit to anyone. their obtuse UIs were stupid even when they were established and were abandoned for modern editors like 30 years ago. nobody should still be using Linux text editors.

rip anyone who has to git rebase -i

gonadic io
Feb 16, 2011

>>=

Finster Dexter posted:

rip anyone who has to git rebase -i

EDITOR=code supremacy

bob dobbs is dead
Oct 8, 2017

Peeps are idiots, Leslie.
Nap Ghost

Finster Dexter posted:

rip anyone who has to git rebase -i

shaggar would unironically recommend a different vcs

CRIP EATIN BREAD
Jun 24, 2002

Hey stop worrying bout my acting bitch, and worry about your WACK ass music. In the mean time... Eat a hot bowl of Dicks! Ice T



Soiled Meat
people who struggle with basic text editors have no business touching computers professionally, and probably should be sterilized, just like people who fail to use turning signals when driving a car.

mystes
May 31, 2006

CRIP EATIN BREAD posted:

people who struggle with basic text editors have no business touching computers professionally, and probably should be sterilized, just like people who fail to use turning signals when driving a car.
Can we agree to disagree about whether emacs is a "basic" "text editor"?

Shaggar
Apr 26, 2006
they're both basic in functionality but terrible in usability. of the two vim is definitely worse. modal editing is the dumbest possible idea which is why its only found on or promoted by linuxes.

prisoner of waffles
May 8, 2007

Ah! well a-day! what evil looks
Had I from old and young!
Instead of the cross, the fishmech
About my neck was hung.
the market can stay irrational longer than I can stay solvent
shaggar can be wrong longer than I can give a poo poo, longer than the sun can burn, longer perhaps than mankind's whole existence

Shaggar
Apr 26, 2006
what are the benefits of spending years to learn a bad tool like vim?

The_Franz
Aug 8, 2003

CRIP EATIN BREAD posted:

people who struggle with basic text editors have no business touching computers professionally, and probably should be sterilized, just like people who fail to use turning signals when driving a car.

basic text editors like emacs, which requires you to write a bunch of lisp scripts to make it usable, and vim, which just sits there beeping at you while you wonder why the letters you are pressing aren't appearing and half of the document just disappeared

CRIP EATIN BREAD
Jun 24, 2002

Hey stop worrying bout my acting bitch, and worry about your WACK ass music. In the mean time... Eat a hot bowl of Dicks! Ice T



Soiled Meat

The_Franz posted:

basic text editors like emacs, which requires you to write a bunch of lisp scripts to make it usable, and vim, which just sits there beeping at you while you wonder why the letters you are pressing aren't appearing and half of the document just disappeared

that's the exact kind of person who shouldn't be touching computers

CRIP EATIN BREAD
Jun 24, 2002

Hey stop worrying bout my acting bitch, and worry about your WACK ass music. In the mean time... Eat a hot bowl of Dicks! Ice T



Soiled Meat
help i cut my fingers off with this tool because i lacked the basic understanding of how it works, and i spent no effort to learn it. the tool must be bad!

AggressivelyStupid
Jan 9, 2012

CRIP EATIN BREAD posted:

help i cut my fingers off with this tool because i lacked the basic understanding of how it works, and i spent no effort to learn it. the tool must be bad!

this is me and accurev right now and i'm not sorry

Shaggar
Apr 26, 2006
"what do you mean you don't want to use the tool that stabs you in the dick every time you use it? you shouldn't be using computers!"

prisoner of waffles
May 8, 2007

Ah! well a-day! what evil looks
Had I from old and young!
Instead of the cross, the fishmech
About my neck was hung.
i'd tell u shagger if u watned to know

bob dobbs is dead
Oct 8, 2017

Peeps are idiots, Leslie.
Nap Ghost
unironic editor wars in tyool 2018

not that i didn't help start it but lol

Main Paineframe
Oct 27, 2010

CRIP EATIN BREAD posted:

help i cut my fingers off with this tool because i lacked the basic understanding of how it works, and i spent no effort to learn it. the tool must be bad!

i love deliberately wasting my own time by choosing the tool that's far more difficult to learn and use well because of its insanely bad interface, even though it's not really faster or more powerful than any of the other choices

like, vim is fine. if you're good at it and already used to it, it's probably comparable to any other text editor. but there's no reason to go out of your way to learn it in 2018

The_Franz
Aug 8, 2003

CRIP EATIN BREAD posted:

help i cut my fingers off with this tool because i lacked the basic understanding of how it works, and i spent no effort to learn it. the tool must be bad!

no, "basic" text editors shouldn't require you to read a manual just to figure out how to move the cursor, make a simple change and save the file

nano and edit.com are basic text editors. vim and emacs are not.

CRIP EATIN BREAD
Jun 24, 2002

Hey stop worrying bout my acting bitch, and worry about your WACK ass music. In the mean time... Eat a hot bowl of Dicks! Ice T



Soiled Meat
if you consider that stuff complex, hoo boy, you must be a web dev

prisoner of waffles
May 8, 2007

Ah! well a-day! what evil looks
Had I from old and young!
Instead of the cross, the fishmech
About my neck was hung.
the only person who might be getting heated is sh*gg*r, but categorical denials that anyone could possibly derive utility from X are his normal mode of disagreement soo---

Adbot
ADBOT LOVES YOU

TheFluff
Dec 13, 2006

FRIENDS, LISTEN TO ME
I AM A SEAGULL
OF WEALTH AND TASTE
proponents of vim/emacs will claim that learning them properly lets you edit that much faster by learning keyboard shortcuts for everything and that anyone who wants to be good at touching computers should spend time to learn proper tools for it. these people also tend to be very mad about things like tab order in forms in various applications, etc. there also tends to be a strong overlap between these and people who complain about modern computers being slow.

and sure, they have a point. if you learn an unintuitive keyboard interface well, you can get very fast at doing whatever it is designed to do. however, very few people actually want to spend a lot of time imprinting shortcuts for a very specific editor (probably with a very specific config too) into muscle memory, not even people who spend most of their work time with a single tool. in user interfaces, flexibility and intuitiveness has turned out to be far more important than how efficient you can get at using the interface if you spend a lot of time training with it.

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