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
hackbunny
Jul 22, 2007

I haven't been on SA for years but the person who gave me my previous av as a joke felt guilty for doing so and decided to get me a non-shitty av
I use SciTE

Adbot
ADBOT LOVES YOU

Volte
Oct 4, 2004

woosh woosh

Dessert Rose posted:

Imagine if, instead of hunting through menus to find the option for "open debugger window" (was that in View, or Window, or Debug? Which submenu of those menus might it be in?) you just typed "debug window" and every command that contained those words showed up.
I would rather use the menu, or at least have access to it. I have no reason to assume that emacs even has a concept of a "debug window" in its documentation so the process you mentioned would generally be referred to by me as "hunting", rather than "discovering". At least if there's a Window menu, I can discover which windows there are to open. In emacs I have to know what I want to do before I can do it (or even know if it's possible), which is not discovery. That's just reading the documentation. Plus the C-h keybinds are so numerous that I have to look up how to look stuff up more often than not. The appeal of "not having to leave the editor" to do Y went away when you could have a second window beside your editor that does Y natively rather than as an ad-hoc script that runs in the UI thread.

I've used vim for probably 1000+ hours and emacs for a few hundred, and I can use either one to be productive, but I probably still do better in a GUI-based IDE with vim keybindings enabled. The longest stretch I've even mained emacs was the 4 months I took a course on Agda (emacs agda-mode is an inextricable part of the Agda development process, there's no escaping it) and found it to be a competent editor, but no moreso than any other really, and when I ran into issues making it work, it was always a time-waster. I didn't hate it but after 4 months of using it I still had not found any particularly compelling reason to keep it as my main editor. Vim has the keybindings (being able to type 55ggf"ci" to go to line 55, clear the contents of the first double-quoted string, and put the cursor inside it in insert mode is definitely a game changer) which hooked me fairly instantaneously. I never found anything similar in emacs, and I inevitably moved back to other things. If I had to use it again I would be able to do so, make it work, and not complain too hard, but I remain unconvinced of emacs' godliness. Spacemacs is cool though, I want to give it a serious go sometime. Also org-mode, but I feel I am not disciplined enough as an individual to make use of that properly.

Beef
Jul 26, 2004
M-x is the discoverabilty keybind in emacs.

Volte
Oct 4, 2004

woosh woosh
Are we seriously considering a literal command-line interface to be "discoverable" now? Bash is equally discoverable by this logic (man -k). CLIs are usually mentioned as the antithesis of discoverability when it comes to HCI.

Volte fucked around with this message at 13:22 on Jan 23, 2016

Athas
Aug 6, 2007

fuck that joker
Emacs has fairly densely populated traditional menus. Have you people ever actually used it? The reason few people use the Emacs menus (or the toolbar) is that Emacs has better alternatives available.

That said, there are also stupid things in Emacs. I am personally quite upset that the rectangle editing commands are named delete-rectangle, kill-rectangle, copy-rectangle-as-kill, yank-rectangle, insert-rectangle, open-rectangle and so forth. If they all started with 'rectangle-' instead it would make command completion easier.

Also, the rectangle editing implementation itself (rect.el) is some very old and very nasty code. When people speak about the elegance of Lisp, they sure are not talking about Emacs Lisp.

Volte
Oct 4, 2004

woosh woosh

Athas posted:

Emacs has fairly densely populated traditional menus. Have you people ever actually used it? The reason few people use the Emacs menus (or the toolbar) is that Emacs has better alternatives available.

That said, there are also stupid things in Emacs. I am personally quite upset that the rectangle editing commands are named delete-rectangle, kill-rectangle, copy-rectangle-as-kill, yank-rectangle, insert-rectangle, open-rectangle and so forth. If they all started with 'rectangle-' instead it would make command completion easier.

Also, the rectangle editing implementation itself (rect.el) is some very old and very nasty code. When people speak about the elegance of Lisp, they sure are not talking about Emacs Lisp.
It has menus for sure, but they aren't all that densely populated and are basically just a list of basic commands, some of which seem as though they haven't been relevant since the dark ages (Read Net News? Compose Mail? Who the gently caress uses emacs for those things except RMS?). It's a programmer-designed interface thru-and-thru. I can "Browse the Web" inside emacs using the menu, but there's no "Replace in Files" (there's "Replace in Tagged Files" but I don't know what that means without reading about it). I can "Enable Lisp Debugger on C-g" or "Encrypt Region with GPG", but there's no "Close Other Buffers" (in fact the latter requires several lines of elisp to achieve). Some of these things obviously may come with minor or major modes, but I just opened a bunch of different file types and none of the major-mode menus had much other than a few basic snippets or system interactions (launch interpreter, etc). The menus are essentially just cheat sheets for common (or not-so-common) operations, and do not reflect Emacs' capabilities in any real way.

In PyCharm I can use the menu to learn what PyCharm is capable of, and generally I can learn how to use it from there too (i.e. clicking on a menu item will bring up a dialog with further instructions, as opposed to Emacs switching the minibuffer to Enter name: or whatever). In Emacs, I can look to the menu in hopes of enlightenment about a particular task but ultimately it is indicative of nothing much and the only real way to discover Emacs is to read about it in the documentation and live in it for an extended period of time and hope that it jibes with your personal workflow style. Personally, it did not.

edit: I realizing I'm comparing an editor and an IDE, but the point is that nothing much about Emacs is truly "discoverable" in the sense that a truly discoverable interface is.

Volte fucked around with this message at 15:30 on Jan 23, 2016

TooMuchAbstraction
Oct 14, 2012

I spent four years making
Waves of Steel
Hell yes I'm going to turn my avatar into an ad for it.
Fun Shoe
:ughh: You guys all know that you should be using ed, right? It's the standard text editor.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

Dessert Rose posted:

Imagine if, instead of hunting through menus to find the option for "open debugger window" (was that in View, or Window, or Debug? Which submenu of those menus might it be in?) you just typed "debug window" and every command that contained those words showed up.


I don't have to imagine it. Jetbrains IDE's already do this!

FamDav
Mar 29, 2008

Subjunctive posted:

Sure, I just mean that you can't really give it an AST expression like the one described above, meaning something like "calling B with a parameter of the member X of type Y". It will search for certain kinds of symbols, but not syntax patterns AFAICT. I haven't looked at the intellij source to see what it uses to back that operation up, but I'd naively have guessed that it was just a set of indexes rather than an AST. That's interesting.

(I don't know what "granular control" actually means.)

granular just meant "able to write abitrary AST replacements".

and intellij usually has you implement a lexer and a parser to an AST (or use your languages SDK if they are kind enough to support that) which is then converted into PSI, the common AST format within intellij and what plugins operate on. i think eclipse also does similar?

lord funk
Feb 16, 2004

Literally writing a paper now in LaTeX. Don't have to worry about formatting!

(spends an hour trying to fix line breaks, build errors, and Greek letters)

Soricidus
Oct 21, 2010
freedom-hating statist shill

lord funk posted:

Literally writing a paper now in LaTeX. Don't have to worry about formatting!

(spends an hour trying to fix line breaks, build errors, and Greek letters)

Don't forget to use the microtype package, it makes line breaks way better

Hammerite
Mar 9, 2007

And you don't remember what I said here, either, but it was pompous and stupid.
Jade Ear Joe

lord funk posted:

Literally writing a paper now in LaTeX. Don't have to worry about formatting!

(spends an hour trying to fix line breaks, build errors, and Greek letters)

LaTeX is the weirdest thing because although it produces very nice output if you're prepared to put in the time to get everything just right, it is incredibly unfriendly to the user - especially when poo poo goes wrong. It's a real nerd piece of software. There was a study from a while back where some group measured how productive users of word processors were versus proficient LaTeX users, and the result that came out was IIRC that the word processor users were more productive, but not by much. But the reaction from LaTeX users that i saw was basically to dismiss the study out of hand, because how dare anyone say anything that doesn't flatter LaTeX?

The thing is that while it is good at what it does it's basically a dinosaur. TeX is actually implemented in some hugely obscure language that I don't remember the name of, and as a language it's a nightmare to program in, not least because it's basically impossible to effectively debug or understand what it's doing when something goes wrong, because by the time an error condition has been met it's converted all the code you actually wrote into primitives but without giving you a way to understand the process by which it did so. It should be possible to come up with something better that is still effectively a programmable typesetting engine, still gives high-quality customisable output... but LaTeX has such inertia I guess it won't happen.

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
LuaTeX mostly solves the foundational problems with TeX by adding an API for the core typesetting primitives written in WEB and then replacing all of the higher-level functionality built on top of that with much saner and easier to extend code written in Lua. It's actually in a pretty good state these days, so maybe twenty years from now it'll have successfully replaced the other implementations.

Soricidus
Oct 21, 2010
freedom-hating statist shill

Hammerite posted:

There was a study from a while back where some group measured how productive users of word processors were versus proficient LaTeX users, and the result that came out was IIRC that the word processor users were more productive, but not by much. But the reaction from LaTeX users that i saw was basically to dismiss the study out of hand, because how dare anyone say anything that doesn't flatter LaTeX?

Sure, if by "productive" you mean "produce something quickly" rather than "produce something that looks good and soothes my typography autism".

Word's output looks like poop from a butt. It's twenty loving sixteen and it still doesn't even kern fonts by default. Hardly anyone knows how to use styles and it's not surprising because if you try to use styles then Word fights you every step of the way and does everything it can to make your formatting inconsistent and sometimes you have to have Latex-level wizard skills to figure out why it's hosed up and how to fix it. Word's ubiquity has trained people to accept horrible typesetting.

Latex goes too far the other way and encourages people to spend hours fiddling with hyphenation patterns, of course.

Hammerite posted:

The thing is that while it is good at what it does it's basically a dinosaur. TeX is actually implemented in some hugely obscure language that I don't remember the name of

The hugely obscure language called Pascal, which has long since been abandoned in favour of the hugely obscure language called C?

(yeah I know you're referring to web, the weird literate programming thing, but it's just C inside)

Hammerite posted:

It should be possible to come up with something better that is still effectively a programmable typesetting engine, still gives high-quality customisable output... but LaTeX has such inertia I guess it won't happen.

LuaTex is looking promising. Retain LaTex compatibility on the front end, let the back end be extended in a sane language.

HappyHippo
Nov 19, 2003
Do you have an Air Miles Card?
The relevance of that study really hinges on how they measured "productivity." I know some people in the humanities who use Word a lot and just the amount of time they spend fiddling with poo poo like citations and numbering is mind boggling. Yes I know there are features and programs which supposedly handle these things but they don't always work and when they break it becomes a huge time sink. Especially because Word is transforming the underlying file in an opaque way so when something breaks it's basically impossible to get back to the state in which it was working.

LaTeX is a real 80-20 thing though, you can get most of what you want with little effort, but getting it "just right" can take much longer. Thank god for the times when you'll be submitting your paper to a journal. I can make it "good enough" and leave the irritating details like line breaks, figure placement and two-column equation placement to the copy-editor.

One big advantage of LaTeX is that you can put it in version control and use the diff features. If you stick to a rule of "one sentence per source line" (which is weird at first but you get used to it) then this makes it really easy to keep track of changes. Me and my supervisor did this for our most recent paper and it was incredible. He would push his revisions and I could see every single changed sentence with ease.

Volte
Oct 4, 2004

woosh woosh
Given that TeX amounts to a glorified box packing algorithm and the source code (much of which is no longer useful in this day and age) is documented in PDF form to an excruciating degree, I'm surprised nobody has ever re-implemented it. The code isn't even that long, since much of it is either obsolete encoding-related stuff or just verbosity brought on by Pascal's lack of general data structures or abstraction patterns. It's something I'd like to experiment with if I get some free time

HappyHippo
Nov 19, 2003
Do you have an Air Miles Card?
All that said LaTeX is real ugly and bears a lot of warts from it's evolution over the years. It would be nice to see something cleanly designed with the same functionality replace it but it's hard to imagine that happening with all the inertia behind it.

Sarcophallus
Jun 12, 2011

by Lowtax
There's not enough bad code here.

I will share this arbitrate costs method, which is one of my favorite terrible things ever, and one of the steps from it:

code:
private void arbitrateCosts() {
        logMatrix(0);

        stepOne();
        stepTwo();

        // if stepThree returns true, done.
        // if stepThree returns false, do the process again
        while (!stepThree()) {

            // if stepFour returns true, go to step 6
            // if stepFour returns false, go to step 5
            while (stepFour()) {
                stepSix();
            }

            stepFive();
        }
    }

    /**
     * STEP 1.
     * 
     * For each row of the matrix, find the smallest element and subtract it from
     * every element in its row. Go to Step 2. We can define a local variable
     * called minval that is used to hold the smallest value in a row. Notice
     * that there are two loops over the index j appearing inside an outer loop
     * over the index i. The first inner loop over the index j searches a row
     * for the minval. Once minval has been found this value is subtracted from
     * each element of that row in the second inner loop over j. The value of
     * step is set to 2 just before stepone ends.
     * 
     */
    private void stepOne() {
        for (int i = 0; i < n; i++) {
            double minVal = Double.MAX_VALUE;

            for (int j = 0; j < m; j++) {
                minVal = Math.min(minVal, costMatrix[i][j].cost);
            }

            if (minVal > 0) {
                for (int j = 0; j < m; j++) {
                    costMatrix[i][j].cost -= minVal;
                }
            }
        }

        logMatrix(1);
    }

Linear Zoetrope
Nov 28, 2011

A hero must cook

HappyHippo posted:

All that said LaTeX is real ugly and bears a lot of warts from it's evolution over the years. It would be nice to see something cleanly designed with the same functionality replace it but it's hard to imagine that happening with all the inertia behind it.

To be honest, it'd probably just be easier to move to a web format. You gain benefits like having database-driven and interactive figures. You can still get most of the equations with things like MathJax, and the ecosystem is probably ultimately more friendly for making things like graph display packages than the TikZ-based stuff, even if would take some up front work to get everything ported.

You lose some benefits of offline viewing and printability, but individual journals could require "printer friendly" versions to be available without interactive bells and whistles.

Web formats also have the benefit of already being well supported outside the academic community.

Jabor
Jul 16, 2010

#1 Loser at SpaceChem

Jsor posted:

You lose some benefits of offline viewing and printability, but individual journals could require "printer friendly" versions to be available without interactive bells and whistles.

So how do you write the printer-friendly version?

Linear Zoetrope
Nov 28, 2011

A hero must cook

Jabor posted:

So how do you write the printer-friendly version?

Wherever there's an interactive bit you provide a static figure you feel is representative.

TooMuchAbstraction
Oct 14, 2012

I spent four years making
Waves of Steel
Hell yes I'm going to turn my avatar into an ad for it.
Fun Shoe

Jsor posted:

Wherever there's an interactive bit you provide a static figure you feel is representative.

The point was more that a printer-friendly version, to not look like poo poo, needs proper typesetting, so you're back to square 1.

Linear Zoetrope
Nov 28, 2011

A hero must cook

TooMuchAbstraction posted:

The point was more that a printer-friendly version, to not look like poo poo, needs proper typesetting, so you're back to square 1.

Eh, I don't see a reason to need a really good printer friendly version. The only point would be to make it the bare minimum of readable in case you can't access the web for whatever reason.

Soricidus
Oct 21, 2010
freedom-hating statist shill
You're saying ... that in fact, it's silly to care about paper typesetting so much in an age when the vast majority of information is accessed on a screen?!!

You're clearly crazy. Please get help.

HappyHippo
Nov 19, 2003
Do you have an Air Miles Card?
I see the argument a lot but just I don't see web based formats as the panacea its presented as. Most web based typesetting is much worse than a mediocre LaTeX document, the output is less consistent than PDFs, and its not like html+CSS+js is more consistent or more user friendly than LaTeX.

Linear Zoetrope
Nov 28, 2011

A hero must cook

HappyHippo posted:

I see the argument a lot but just I don't see web based formats as the panacea its presented as. Most web based typesetting is much worse than a mediocre LaTeX document, the output is less consistent than PDFs, and its not like html+CSS+js is more consistent or more user friendly than LaTeX.

Well, full HTML+CSS+JS is probably going to be hell, but we have so many user-friendly ways of inputting text and making them into webpages that would work for the vast majority of cases. Hell, for a lot of computer science and math you're probably 75-80% of the way to "sufficient" by using Math Overflow's flavor of markdown (Math Overflow because it has MathJax).

Nippashish
Nov 2, 2005

Let me see you dance!
I would be very happy to never write latex again but I haven't been able to find an alternative that doesn't make typeset math either ugly or more painful than writing latex so I keep coming back to it. Markdown+mathjax can look nice but ends up being a lot of effort for stupid reasons like there being no way to \newcommand long symbols into short names.

duck monster
Dec 15, 2004

Not quite a coding horror, but I just stumbled across this horrorshow of a comment on some blog for some random NoSQL vendor;-
gently caress this guy

quote:

The elephant in the room here is that SQL is not suitable for any situation where data input is from unregulated sources, owing to its vulnerability to malicious code injection. The issue arises because SQL, unlike most other database languages, has no concept of variables. Therefore, all input has to be in the form of commandlines containing a mix of instructions and literal values. Slip a suitable command into submitted data, and you have control of the database server.

Major websites have gone down like a line of dominoes to code injection hacks over the last couple of years, leading to extensive thefts of personal information, the need for mass password changes and reissue of bank cards, etc. It's getting to the point where the public confidence in the security of online trading is at an all-time low. If confidence is to be restored in ecommerce, then the use of SQL on the Web needs to be deprecated. Or better, forbidden by the banks for any site wishing to handle card payments. The sooner the better.

*cues up webscale.mov*

And this is why our database with our info will continued to be owned forever, because mouthbreather hipsters like this keep being allowed to use computers....

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
I guess it's his fault he's never read enough blog posts to learn about prepared statements.

qntm
Jun 17, 2009
Prepared statements don't help that much when you want to choose columns, predicates or limits dynamically. Really there should be SQL query builders if there aren't already and the process of manually building SQL query strings should be axed entirely as a liability.

xzzy
Mar 5, 2009

I'd like to see their defense of MongoDB's default configuration of zero access controls.

duck monster
Dec 15, 2004

Suspicious Dish posted:

I guess it's his fault he's never read enough blog posts to learn about prepared statements.

The irony is half the nosql json databases out there dont actually support prepared statements, as your just POSTing json into a store, and that means you can insert all sorts of crazed poo poo into there, including javascript statements on certain engines.

I could rant for hours about the cargo cult nonsense I've seen on some jobs regarding the NoSQL databases, invariably from young coders who flunked out on database theory and couldnt tell an INNER JOIN from a DROP TABLE to save their arse. Like serious, No ACID guarantees a good thing? Fuuuuuuck that.

sunaurus
Feb 13, 2012

Oh great, another bookah.
Here's a horror story from an internship I did a few years ago relevant to MongoDB:

I worked in a small company built around a single project. We were hired to build an online game with a very heavy focus on real money transactions. The first horror for me was that the overall architecture of the back-end was ridiculous - they didn't really use any single software stack, some of their code ran on linux and some ran on windows, so they had to have a lot of different servers for the back-end. There was no good justification for this other than "we use what we know". Also, they didn't use dvcs because "it's too complicated for our needs" :v:.

Soon after I started working there, our CEO revealed that our client wants us to use MongoDB. He told us that we need to figure out how to integrate it with everything. The idea was to keep financial records in the mongo database and the rest of the game stuff in some other database which they already had up and running. My job was to figure out the hardware we needed for our mongo servers, and how to set it up so that it could handle some massive amount of operations per minute.

I worked through all the mongo documentation and quickly found out that you have to choose between performance and actually guaranteeing that your data is written to the database - you can't have both. Here's the second horror story: When telling our CEO about this, he told me that it's not really a problem, just go for maximum performance. The CTO was pissed, because he realized that financial data was actually important, but he was pretty much the only one who understood this and the CEO didn't care.

A short while later I had created a short overview of how many servers we needed for automatic failover (basically you need at least 3 different servers to ensure high availability). Third horror story: I showed this document to our sysadmins, and they told me "good work, but you're obviously new at this, we can do this much more efficiently by just getting one server and having the 3 databases run in virtual machines on that server".

Obviously this project didn't have much of a future. My internship was supposed to last until the end of summer, the idea was that I would be hired at that point. Near the end of summer, our client hired somebody to review our progress and our architecture. Among other things, we found out from this auditor that there actually had been no requirement to use MongoDB, this was made up by our CEO. A week after the audit, everybody got fired and my internship was over. Also, our CTO had a stroke shortly before the audit. The CEO actually blamed him for our failure when firing everybody, I don't know if he was sincere or just acting, but he seemed extremely angry at the CTO.

Vanadium
Jan 8, 2005

Illegal Move posted:

Obviously this project didn't have much of a future.

Well, at least the story has a happy ending.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe

qntm posted:

Prepared statements don't help that much when you want to choose columns, predicates or limits dynamically. Really there should be SQL query builders if there aren't already and the process of manually building SQL query strings should be axed entirely as a liability.

Regardless, you should not really have literals in a SQL statement. I would like SQL a lot better if it allowed me to omit literals entirely and required me to build a prepared statement with separate values.

rarbatrol
Apr 17, 2011

Hurt//maim//kill.

xzzy posted:

I'd like to see their defense of MongoDB's default configuration of zero access controls.

There's a fun article by Brian Krebs where he mentions the Shodan search engine, and how you can search for the default ports for just about any NoSQL database and come up with pages and pages of results.

http://krebsonsecurity.com/2015/12/13-million-mackeeper-users-exposed/

New Yorp New Yorp
Jul 18, 2003

Only in Kenya.
Pillbug

Illegal Move posted:

. Also, they didn't use dvcs because "it's too complicated for our needs" :v:.

And? DVCS is absolutely overcomplicated for what some teams are doing. If the team doesn't need to work offline and rarely branches and their existing VCS tools work for them with no pain or angst, why should they change to DVCS? There's way too much DVCS cargo culting happening and it drives me crazy.

jony neuemonic
Nov 13, 2009

fleshweasel posted:

IDEs and GUI text editors have keyboard shortcuts. Lots of them have pretty powerful keyboard based text manipulation. Visual debugging is a tremendous quality of life improvement over command line debugging as well.

I live in Vim + Tmux, but I still keep an IDE around for debugging because doing it on the command line is balls.

KaneTW
Dec 2, 2011

Ithaqua posted:

And? DVCS is absolutely overcomplicated for what some teams are doing. If the team doesn't need to work offline and rarely branches and their existing VCS tools work for them with no pain or angst, why should they change to DVCS? There's way too much DVCS cargo culting happening and it drives me crazy.

In the vast majority of software dev cases, offline history and lightweight branching are really good practice. Asset repos in game dev are about the only thing I can think of where you wouldn't want offline history.

Adbot
ADBOT LOVES YOU

return0
Apr 11, 2007

Ithaqua posted:

And? DVCS is absolutely overcomplicated for what some teams are doing. If the team doesn't need to work offline and rarely branches and their existing VCS tools work for them with no pain or angst, why should they change to DVCS? There's way too much DVCS cargo culting happening and it drives me crazy.

Here are the cases when DVCS is inappropriate:

  • Large, frequently modified binaries in source control.

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