1513: "Code Quality"

This forum is for the individual discussion thread that goes with each new comic.

Moderators: Moderators General, Prelates, Magistrates

Mental Mouse
Posts: 67
Joined: Tue Mar 18, 2008 1:31 pm UTC

Re: 1513: "Code Quality"

Postby Mental Mouse » Fri Apr 17, 2015 2:06 pm UTC

hovertext: "I honestly didn't think you could even USE emoji in variable names. Or that there were so many different crying ones."

No, those were inserted by the IDE.

TECO: That was actually an editor. IIRC, "vi" was developed to be more comprehensible and less modal. There used to be a parlor game of typing your name into TECO and see what it does.

User avatar
ahammel
My Little Cabbage
Posts: 2135
Joined: Mon Jan 30, 2012 12:46 am UTC
Location: Vancouver BC
Contact:

Re: 1513: "Code Quality"

Postby ahammel » Fri Apr 17, 2015 2:09 pm UTC

hdhale wrote:My first question regarding any bit of code is: does it yield the results you want? If yes, then everything else is just about efficiency. Only Computer Science instructors give credit of code that looks pretty but doesn't work.

If the code is clean and it has a bug, I can fix the bug. And then I can test it and make sure they the bug didn't crop up again. If the code us terrible, but doesn't have a bug, then don't be ridiculous, of course it has bugs. Even if by some miracle this person who writes terrible code is somehow able to write a bug-free program on the first try, you can bet your ass that the spec is going to change eventually, and then it will become my job to unpick an intractable mass of mutable state, jumps of flow control to different threads, SQL abuse, and calls to nasty library functions with names like '_____omgSoUnsafeNeverCallThis'. I will have to do this without such niceties as unit tests, useful documentation, or variables with names longer than one character. This will become a Vietnam-style quagmire into which the company will continue to pour extremely valuable dev time until it goes out of business. But hey, the code "worked"!

Maybe I wouldn't care about a horrible, unmaintainable bundle of ugly hacks of a) somebody proved it was correct and b) I could be sure the spec is never going to change. I have never worked with code that met either of those conditions.
He/Him/His/Alex
God damn these electric sex pants!

KarenRei
Posts: 287
Joined: Sat Jun 16, 2012 10:48 pm UTC

Re: 1513: "Code Quality"

Postby KarenRei » Fri Apr 17, 2015 3:10 pm UTC

orthogon wrote:Interestingly, I hadn't heard or read the word emoji until perhaps a month ago, but now suddenly everyone is using it as though they'd always known it. I presume it was coined in Japanese some time ago - when and why did it suddenly make the leap into English? Google ngrams finds no instances at all, but admittedly only goes up to about 2010


Wikipedia says that the first emoji were created in 1998 or 1999, although that doesn't mean that the word came then. Of course, the text equivalent, emoticons, had been around much longer. While emoji is a perfectly reasonable word in Japanese (picture-characters), I can't help but wonder if the choice of word was inspired by the already long-extant word emoticon. If so then now English speakers would be borrowing back their own word ;) We've seen that sort of situation in reverse - for example, the japanese "etchi", meaning sort of "playfully sexual". They took the word for perverted ("hentai"), wrote it out in English and shortened it ("H"), and then pronounced H as it sounds in Japanese ("etchi").

Story
Posts: 78
Joined: Wed Aug 26, 2009 9:03 pm UTC

Re: 1513: "Code Quality"

Postby Story » Fri Apr 17, 2015 3:13 pm UTC

MidSpeck wrote:Regarding the alt text: it is possible to use emoji in some languages. For example, Swift. Search "swift emoji" for a nice example.


Or basically any language which allows unicode identifiers. Which is most of them nowadays.

hdhale wrote:My first question regarding any bit of code is: does it yield the results you want? If yes, then everything else is just about efficiency. Only Computer Science instructors give credit of code that looks pretty but doesn't work.


For anything other than personal scripts you write and run once, that's a horrible approach. In the real world you care about stuff like code being bug-free and maintainable. I think the way you learn this when you're self-taught is the first time you go back to a project you wrote 6 months ago and realize you have no idea how to fix or make changes to it.

User avatar
orthogon
Posts: 3099
Joined: Thu May 17, 2012 7:52 am UTC
Location: The Airy 1830 ellipsoid

Re: 1513: "Code Quality"

Postby orthogon » Fri Apr 17, 2015 3:24 pm UTC

KarenRei wrote:Wikipedia says that the first emoji were created in 1998 or 1999, although that doesn't mean that the word came then. Of course, the text equivalent, emoticons, had been around much longer. While emoji is a perfectly reasonable word in Japanese (picture-characters), I can't help but wonder if the choice of word was inspired by the already long-extant word emoticon. If so then now English speakers would be borrowing back their own word ;) We've seen that sort of situation in reverse - for example, the japanese "etchi", meaning sort of "playfully sexual". They took the word for perverted ("hentai"), wrote it out in English and shortened it ("H"), and then pronounced H as it sounds in Japanese ("etchi").


Ah, in that case I was missing the important distinction between emoticon and emoji: the former are a string of ASCII characters and the latter are the dedicated glyphs. There's an ambiguity in situations (like this forum) where emoticons are converted automatically to emoji. And also I'd assumed that the emo- part was from emoticon and the -ji was the same ending as in kanji, romaji etc.; it sounds like one of those interesting cases where the etymology is "influenced" by multiple factors (like "orange", where the French or, gold, probably encouraged the reanalysis une narange -> une orange)

I vaguely remember now that e is a Japanese word for "picture", which was one of the things that made me doubt I could make any further progress with learning the language. A single short vowel sound just doesn't seem to have enough entropy to mean something that specific!
xtifr wrote:... and orthogon merely sounds undecided.

origimbo
Posts: 41
Joined: Fri Jun 21, 2013 4:16 pm UTC

Re: 1513: "Code Quality"

Postby origimbo » Fri Apr 17, 2015 4:35 pm UTC

Story wrote:
hdhale wrote:My first question regarding any bit of code is: does it yield the results you want? If yes, then everything else is just about efficiency. Only Computer Science instructors give credit of code that looks pretty but doesn't work.


For anything other than personal scripts you write and run once, that's a horrible approach. In the real world you care about stuff like code being bug-free and maintainable. I think the way you learn this when you're self-taught is the first time you go back to a project you wrote 6 months ago and realize you have no idea how to fix or make changes to it.


The important thing to note being that for most single node jobs, your salary is usually higher than the depreciation cost of the machine you're running on.

ps.02
Posts: 378
Joined: Fri Apr 05, 2013 8:02 pm UTC

Re: 1513: "Code Quality"

Postby ps.02 » Fri Apr 17, 2015 5:16 pm UTC

orthogon wrote:Interestingly, I hadn't heard or read the word emoji until perhaps a month ago, but now suddenly everyone is using it as though they'd always known it.

Same here. I still don't really know what they are, I guess it's a font kinda like Dingbats? I hope I never have to use it. The pictures I've seen that seem to be emoji don't carry much semantic information, at least to me; I can't really tell most of them apart.
Story wrote:Or basically any language which allows unicode identifiers. Which is most of them nowadays.

Well, that's like saying any language that allows ASCII for variable names must let you use :-] in a variable name. The lexer can still impose restrictions on the classes of characters used in an identifier, or any other grammatical element.
In the real world you care about stuff like code being bug-free and maintainable. I think the way you learn this when you're self-taught is the first time you go back to a project you wrote 6 months ago and realize you have no idea how to fix or make changes to it.

Yep. Also, if I ever doubt the Dunning-Kruger effect, all I have to do is look at code I wrote 15 years ago. Because at the time I thought I was pretty good.

FireandAir
Posts: 18
Joined: Mon Feb 24, 2014 6:16 pm UTC

Re: 1513: "Code Quality"

Postby FireandAir » Fri Apr 17, 2015 6:20 pm UTC

I can't tell you what the code behind my first perl-driven website looked like (well okay, I can: GORDIAN KNOT), but over the years that I've repeatedly grabbed it and reimplemented it with "only a few" changes, those changes added up to create a fairly decent blob of code.

Methinks the correlation between clean code and experience might just have to do with the fact that I've actually opened and nitpicked that code enough times to get it right. Personal experience is part of it, but I think a LOT of it is just the same as with prose: if you want it to be clean, clear, and work well, EDIT YOUR WORK. Just because it compiled doesn't mean you're done.

Sadly, most of us are so overworked that that's precisely what it means, and until we need to grab that code to solve another problem, we simply don't have the time to open functioning code and pretty it up once it's doing what we need it to do. It's onto the next housefire.

commodorejohn
Posts: 1197
Joined: Thu Dec 10, 2009 6:21 pm UTC
Location: Placerville, CA
Contact:

Re: 1513: "Code Quality"

Postby commodorejohn » Fri Apr 17, 2015 6:26 pm UTC

FireandAir wrote:Methinks the correlation between clean code and experience might just have to do with the fact that I've actually opened and nitpicked that code enough times to get it right. Personal experience is part of it, but I think a LOT of it is just the same as with prose: if you want it to be clean, clear, and work well, EDIT YOUR WORK. Just because it compiled doesn't mean you're done.

Nailed it. If there's one thing I've learned over the years, it's that it's never, ever a bad idea to go back and reassess your old code. (Provided that you understand the value of "if it ain't broke..." Otherwise you turn into George Lucas.) Even if you're not using it anymore, the insights you get are extremely valuable.
"'Legacy code' often differs from its suggested alternative by actually working and scaling."
- Bjarne Stroustrup
www.commodorejohn.com - in case you were wondering, which you probably weren't.

User avatar
ManaUser
Posts: 284
Joined: Mon Jun 09, 2008 9:28 pm UTC

Re: 1513: "Code Quality"

Postby ManaUser » Fri Apr 17, 2015 7:14 pm UTC

commodorejohn wrote:The reason is that .COM files have no header or validation information - they're simply a binary dump of a program. DOS loads the entire file into a single 64KB segment starting at address 0x100 within that segment, then calls the procedure that it assumes must start at address 0x100. (This is a holdover from CP/M, which did the exact same thing.)

An interesting factoid to expand on that: It is possible to write a not only valid but working .COM file from the keyboard.

Code: Select all

X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*

When executed all it does is print the text in the middle, but apparently many antivirus programs were designed to catch it as a test (at least if it's named EICAR.COM). This was still true when I first learned about it years ago, but I'm not sure if many of them do nowadays when COM files are so seldom used.

User avatar
Copper Bezel
Posts: 2426
Joined: Wed Oct 12, 2011 6:35 am UTC
Location: Web exclusive!

Re: 1513: "Code Quality"

Postby Copper Bezel » Fri Apr 17, 2015 7:37 pm UTC

ps.02 wrote:Same here. I still don't really know what they are, I guess it's a font kinda like Dingbats? I hope I never have to use it. The pictures I've seen that seem to be emoji don't carry much semantic information, at least to me; I can't really tell most of them apart.

The glyphs are "like" Dingbats in that they're, well, dingbats, "a part of a font that isn't text," and cover some of the same ground as the symbols in the Dingbats set, but it's not a font. It was a subset of this spec that was a subset of this other spec that got inherited into Unicode. So they're a part of the Unicode set and have to be rendered through a font, so there's a position in the Unicode set assigned to "two pigeons having a birthday party" or what the hell ever, and you only see the pigeons if you have a font and browser inclined to support them. You, too, can create your own emoji font to be never seen anywhere by anyone.
So much depends upon a red wheel barrow (>= XXII) but it is not going to be installed.

she / her / her

Phasma Felis
Posts: 175
Joined: Thu May 22, 2008 3:42 am UTC

Re: 1513: "Code Quality"

Postby Phasma Felis » Fri Apr 17, 2015 8:06 pm UTC

Mental Mouse wrote:TECO: That was actually an editor. IIRC, "vi" was developed to be more comprehensible and less modal.

I am equally fascinated and terrified by the concept of an interface less comprehensible than vi.

Phasma Felis
Posts: 175
Joined: Thu May 22, 2008 3:42 am UTC

Re: 1513: "Code Quality"

Postby Phasma Felis » Fri Apr 17, 2015 8:11 pm UTC

orthogon wrote:Interestingly, I hadn't heard or read the word emoji until perhaps a month ago, but now suddenly everyone is using it as though they'd always known it. I presume it was coined in Japanese some time ago - when and why did it suddenly make the leap into English?


I assume it's the same reason people say "the cloud" when they mean "the internet" (this accounts for 100% of tech-related uses of "the cloud"). It's the hip new jargon, and using it makes you feel like you're on the cutting edge of something or other.

commodorejohn
Posts: 1197
Joined: Thu Dec 10, 2009 6:21 pm UTC
Location: Placerville, CA
Contact:

Re: 1513: "Code Quality"

Postby commodorejohn » Fri Apr 17, 2015 8:13 pm UTC

Phasma Felis wrote:I am equally fascinated and terrified by the concept of an interface less comprehensible than vi.

Oh, by the standards of antique text editors, vi is downright sensible. (I'll take Wordstar-alikes any day, though.) Even before you descend into the maelstrom of insanity that is TECO, you've got clunkers like the standard "line editor" program (ed in *nix, EDLIN in DOS) that were necessary back when there was no guarantee that the user's terminal wasn't just a "glass TTY" (or, indeed, an actual TTY) printing everything it was sent, including control codes.
"'Legacy code' often differs from its suggested alternative by actually working and scaling."
- Bjarne Stroustrup
www.commodorejohn.com - in case you were wondering, which you probably weren't.

User avatar
Copper Bezel
Posts: 2426
Joined: Wed Oct 12, 2011 6:35 am UTC
Location: Web exclusive!

Re: 1513: "Code Quality"

Postby Copper Bezel » Fri Apr 17, 2015 8:15 pm UTC

Phasma Felis wrote:
orthogon wrote:Interestingly, I hadn't heard or read the word emoji until perhaps a month ago, but now suddenly everyone is using it as though they'd always known it. I presume it was coined in Japanese some time ago - when and why did it suddenly make the leap into English?


I assume it's the same reason people say "the cloud" when they mean "the internet" (this accounts for 100% of tech-related uses of "the cloud"). It's the hip new jargon, and using it makes you feel like you're on the cutting edge of something or other.

They mean "serverside," which is different from just saying "the internet." (Cloud computing = serverside processing != *the internet computing.) And emoji are a specific thing.
So much depends upon a red wheel barrow (>= XXII) but it is not going to be installed.

she / her / her

Phasma Felis
Posts: 175
Joined: Thu May 22, 2008 3:42 am UTC

Re: 1513: "Code Quality"

Postby Phasma Felis » Fri Apr 17, 2015 8:24 pm UTC

David Robinson wrote a post about this comic, A Million Lines of Bad Code. I'm inclined to agree with him. If someone asks you to look at their code, and admits that it's probably not great, then launching directly into insults makes you a useless human being. I realize Randall intended to be hyperbolic, but I've met more than a few people who actually do this, and it's taken me years to realize how much damage they've done to my learning process by making me reluctant to ask for help.

User avatar
Quercus
Posts: 1810
Joined: Thu Sep 19, 2013 12:22 pm UTC
Location: London, UK
Contact:

Re: 1513: "Code Quality"

Postby Quercus » Fri Apr 17, 2015 8:34 pm UTC

commodorejohn wrote:
Phasma Felis wrote:I am equally fascinated and terrified by the concept of an interface less comprehensible than vi.

Oh, by the standards of antique text editors, vi is downright sensible. (I'll take Wordstar-alikes any day, though.) Even before you descend into the maelstrom of insanity that is TECO, you've got clunkers like the standard "line editor" program (ed in *nix, EDLIN in DOS) that were necessary back when there was no guarantee that the user's terminal wasn't just a "glass TTY" (or, indeed, an actual TTY) printing everything it was sent, including control codes.


Don't knock vi. Vi led to Vim which is bloody wonderful. The learning curve is both steep and slippy (i.e. you start getting rusty quickly if you stop using it), but once you've got a reasonable level of competence it's as close as you can get to having a telepathic interface with your text editor. Spot a place/region in your file you'd like to go to, or move something to, or copy something from, and a few keystrokes later it's done... although I think we have a thread for this over in religious wars

Phasma Felis wrote:David Robinson wrote a post about this comic, A Million Lines of Bad Code. I'm inclined to agree with him. If someone asks you to look at their code, and admits that it's probably not great, then launching directly into insults makes you a useless human being. I realize Randall intended to be hyperbolic, but I've met more than a few people who actually do this, and it's taken me years to realize how much damage they've done to my learning process by making me reluctant to ask for help.

I see the point, and I'm sympathetic to it. However it did take me aback a bit that the comic was interpreted that way. I've come to think that cueball and ponytail are probably close friends (maybe I'm wrong about this), and as such I interpreted this as good-natured joshing between friends. I can see why the comic could easily and with validity be interpreted as mean-spirited though.
Last edited by Quercus on Fri Apr 17, 2015 8:46 pm UTC, edited 1 time in total.

commodorejohn
Posts: 1197
Joined: Thu Dec 10, 2009 6:21 pm UTC
Location: Placerville, CA
Contact:

Re: 1513: "Code Quality"

Postby commodorejohn » Fri Apr 17, 2015 8:41 pm UTC

I'll take it over emacs, that's for sure.
"'Legacy code' often differs from its suggested alternative by actually working and scaling."
- Bjarne Stroustrup
www.commodorejohn.com - in case you were wondering, which you probably weren't.

User avatar
Qaanol
The Cheshirest Catamount
Posts: 3069
Joined: Sat May 09, 2009 11:55 pm UTC

Re: 1513: "Code Quality"

Postby Qaanol » Fri Apr 17, 2015 10:30 pm UTC

orthogon wrote:Interestingly, I hadn't heard or read the word emoji until perhaps a month ago, but now suddenly everyone is using it as though they'd always known it. I presume it was coined in Japanese some time ago - when and why did it suddenly make the leap into English? Google ngrams finds no instances at all, but admittedly only goes up to about 2010:

Spoiler:
emoticon.PNG

Clearly you should’ve used Google trends instead of ngrams.
wee free kings

User avatar
San Fran Sam
Posts: 228
Joined: Tue Nov 15, 2011 5:54 pm UTC

Re: 1513: "Code Quality"

Postby San Fran Sam » Fri Apr 17, 2015 11:52 pm UTC

Alt last responses....

"Thank you."
"Those weren't complements."

or...

"Tell me what you really think. I can take it."

User avatar
ahammel
My Little Cabbage
Posts: 2135
Joined: Mon Jan 30, 2012 12:46 am UTC
Location: Vancouver BC
Contact:

Re: 1513: "Code Quality"

Postby ahammel » Sat Apr 18, 2015 1:14 am UTC

Copper Bezel wrote:
Phasma Felis wrote:
orthogon wrote:Interestingly, I hadn't heard or read the word emoji until perhaps a month ago, but now suddenly everyone is using it as though they'd always known it. I presume it was coined in Japanese some time ago - when and why did it suddenly make the leap into English?


I assume it's the same reason people say "the cloud" when they mean "the internet" (this accounts for 100% of tech-related uses of "the cloud"). It's the hip new jargon, and using it makes you feel like you're on the cutting edge of something or other.

They mean "serverside," which is different from just saying "the internet." (Cloud computing = serverside processing != *the internet computing.) And emoji are a specific thing.
They might also mean "we rent our servers from Amazon rather than maintaining our own".
He/Him/His/Alex
God damn these electric sex pants!

MrScience
Posts: 6
Joined: Fri Mar 27, 2009 4:51 pm UTC

Re: 1513: "Code Quality"

Postby MrScience » Sat Apr 18, 2015 1:43 am UTC

Khaz wrote:I'm actually really intrigued by the last panel. Anyone feel like solving that problem?


Not quite emojii, but I came across this gem just yesterday :)
What does the C ??!??! operator do?
Example usage:

Code: Select all

!ErrorHasOccured() ??!??! HandleError();
http://stackoverflow.com/questions/7825 ... perator-do

Like the author's difficulties in searching for said operator, due to the lack of indexes on pure-symbol search turms, it took me a bit to track it down again!

rmsgrey
Posts: 3653
Joined: Wed Nov 16, 2011 6:35 pm UTC

Re: 1513: "Code Quality"

Postby rmsgrey » Sat Apr 18, 2015 2:47 am UTC

Phasma Felis wrote:
Mental Mouse wrote:TECO: That was actually an editor. IIRC, "vi" was developed to be more comprehensible and less modal.

I am equally fascinated and terrified by the concept of an interface less comprehensible than vi.


I take it you've not played Dwarf Fortress then...


My first thought in response to the alt-text: "those aren't emoji - they're macro hooks for the #define statements"

User avatar
Khaz
Posts: 72
Joined: Wed Sep 03, 2008 4:20 am UTC
Location: Ontario, Canada
Contact:

Re: 1513: "Code Quality"

Postby Khaz » Sat Apr 18, 2015 3:07 am UTC

MrScience wrote:Like the author's difficulties in searching for said operator, due to the lack of indexes on pure-symbol search turms, it took me a bit to track it down again!

I have been frustrated more times than I can remember simply by being unable to search for symbols. I cannot believe that here in 2015 it is still not possible to feed a string into a search engine and have it search for that string. What is wrong with society?

User avatar
MarkGyver
Posts: 41
Joined: Sun Nov 09, 2008 6:56 am UTC

Re: 1513: "Code Quality"

Postby MarkGyver » Sat Apr 18, 2015 3:15 am UTC

neoliminal wrote:I've heard rumors of languages that, given valid ASCII, would run no matter what. That all input was valid and produced some kind of output.

Since I couldn't find such a language, I started writing one. I call it Garbage. The tagline is "Garbage in, Garbage out." because all valid programs which you input produce valid programs as output.


1. INTERCAL skips over invalid syntax, so it acts like a comment. Thus it will "run no matter what".
2. Unix scripts tend to start with something like "#!/bin/bash" to say what shell program to run them with. Changing that to "#!/bin/cat" comes pretty close to "all input [is] valid", but you can't change the first line.
Generation 0: The first time you see this, copy it into your signature and change it so that it looks like you inspired this signature. Social experiment.

User avatar
Lazy Tommy
Posts: 89
Joined: Sat Dec 15, 2007 3:55 pm UTC
Location: New Jersey, USA

Re: 1513: "Code Quality"

Postby Lazy Tommy » Sat Apr 18, 2015 11:11 am UTC

Phasma Felis wrote:
Mental Mouse wrote:TECO: That was actually an editor. IIRC, "vi" was developed to be more comprehensible and less modal.

I am equally fascinated and terrified by the concept of an interface less comprehensible than vi.


The problem with vi isn't its user interface, it's the lack of documentation. When I was in college, I was having a rough time just remembering how to exit from vi, while I saw seniors and staff use it with total confidence and ease, but when I asked them how they had acquired this wizardly skill, they mumbled something vague about some pamphlet floating around or something.

The Usenet newsgroup comp.text.editors rescued me by pointing me to the book "The Ultimate Guide To The VI and EX Text Editors," published by HP. After reading the first couple of chapters of that book, things started falling into place, and I can now see that vi is actually very thoughtfully designed, and amazingly powerful, logical, and terse, all at once. But without a decent manual, good luck finding any of that out.

User avatar
Quercus
Posts: 1810
Joined: Thu Sep 19, 2013 12:22 pm UTC
Location: London, UK
Contact:

Re: 1513: "Code Quality"

Postby Quercus » Sat Apr 18, 2015 11:29 am UTC

Lazy Tommy wrote:
Phasma Felis wrote:
Mental Mouse wrote:TECO: That was actually an editor. IIRC, "vi" was developed to be more comprehensible and less modal.

I am equally fascinated and terrified by the concept of an interface less comprehensible than vi.


The problem with vi isn't its user interface, it's the lack of documentation. When I was in college, I was having a rough time just remembering how to exit from vi, while I saw seniors and staff use it with total confidence and ease, but when I asked them how they had acquired this wizardly skill, they mumbled something vague about some pamphlet floating around or something.

The Usenet newsgroup comp.text.editors rescued me by pointing me to the book "The Ultimate Guide To The VI and EX Text Editors," published by HP. After reading the first couple of chapters of that book, things started falling into place, and I can now see that vi is actually very thoughtfully designed, and amazingly powerful, logical, and terse, all at once. But without a decent manual, good luck finding any of that out.

I learnt vim with this http://vim-adventures.com/. It's a pretty decent retro-styled adventure game that uses vim commands to interact with the game. There's a lot of puzzles where you have to move around or modify stuff in a very limited number of keystrokes (if you exceed the allowed keystrokes it boots you back to beginning of the puzzle), so you are encouraged to work out the most efficient way to do things, rather than just sticking with the commands you already know. One of the goals is to unlock new keys, so new stuff gets introduced gradually. I highly recommend it to anyone struggling with or looking to get into vim.

Phasma Felis
Posts: 175
Joined: Thu May 22, 2008 3:42 am UTC

Re: 1513: "Code Quality"

Postby Phasma Felis » Sat Apr 18, 2015 9:20 pm UTC

Lazy Tommy wrote:The problem with vi isn't its user interface, it's the lack of documentation.


The old masters would probably say I've been spoiled by GUIs, but I feel like a lack of documentation/signposting is a user interface failure. A reasonably competent person should be able to sit down with a new app and use its most basic features (in vi, entering text and moving the cursor around) immediately. More advanced features should be deducible via a simple, clear help interface built into the program. (Admittedly Google has largely taken over this role in recent times.)

Making an interactive application that is impossible to use in any capacity without reading separate, unattached documentation in advance is...well, I can't criticize the pioneers for using the tools and techniques available to them, but it's not anything that should be held up as an example of how modern designers should operate.

User avatar
Quercus
Posts: 1810
Joined: Thu Sep 19, 2013 12:22 pm UTC
Location: London, UK
Contact:

Re: 1513: "Code Quality"

Postby Quercus » Sat Apr 18, 2015 10:16 pm UTC

Phasma Felis wrote:
Lazy Tommy wrote:The problem with vi isn't its user interface, it's the lack of documentation.


The old masters would probably say I've been spoiled by GUIs, but I feel like a lack of documentation/signposting is a user interface failure. A reasonably competent person should be able to sit down with a new app and use its most basic features (in vi, entering text and moving the cursor around) immediately. More advanced features should be deducible via a simple, clear help interface built into the program. (Admittedly Google has largely taken over this role in recent times.)

Making an interactive application that is impossible to use in any capacity without reading separate, unattached documentation in advance is...well, I can't criticize the pioneers for using the tools and techniques available to them, but it's not anything that should be held up as an example of how modern designers should operate.

Vi(m) is a bit of a special case in this area though. One of its principal design goals is to be minimalistic, which includes being small enough to run on really limited embedded systems. Vim does have text-based help, but anything beyond that would be unnecessarily bulky. It is also, by design, an advanced tool. It deliberately makes everything as easy as possible for the experienced user by accepting the cost of making the learning curve steeper.

I'm not sure how helpful a modern help interface would be in vi(m). It's not a program you can really pick up in little bits - to someone who hasn't got at least 30 commands well memorized it is, as a consequence of it's very design, slow, unintuitive and immensely frustrating. It's only when you've got all the core commands (and a feeling for the way they are commonly strung together) firmly in your head that it becomes something sublime.

For almost any other program I agree with you entirely, but for vi(m) I can't see how it would work. There should indeed be more easily accessible resources for learning it, and perhaps these should even be bundled with most installations, but it would have to be in the form of a fairly long interactive tutorial, because you simply can't do any productive work in vim until you've spend at least a couple of hours getting your head around how it works.
Last edited by Quercus on Sun Apr 19, 2015 8:10 pm UTC, edited 1 time in total.

User avatar
You, sir, name?
Posts: 6983
Joined: Sun Apr 22, 2007 10:07 am UTC
Location: Chako Paul City
Contact:

Re: 1513: "Code Quality"

Postby You, sir, name? » Sat Apr 18, 2015 11:35 pm UTC

You think ugly hacks are your ally? You merely adopted messy code. I was born in it, molded by it. I didn't see code standards until I was already a man, and by then it was nothing to me but annoying. The undefined behavior betrays you, because it belongs to me!
I edit my posts a lot and sometimes the words wrong order words appear in sentences get messed up.

narrativium
Posts: 9
Joined: Fri Sep 12, 2014 11:18 pm UTC

Re: 1513: "Code Quality"

Postby narrativium » Sun Apr 19, 2015 7:56 pm UTC

DR6 wrote:It's just a consequence of allowing Unicode. In that example, they were just saying "yes, you can actually use any unicode symbol"!

I've been using Swift pretty much since it started, and the programming guide also includes a guide to unicode - in the sense that it allows certain characters for variable names, and others for custom operators, and as far as I know there's no crossover here. I took a look at the kinds of characters Apple decided were more applicable to one kind or the other; for example, the Unicode symbols for playing cards can be used in variable names. The symbols for chess pieces, oddly enough, can be used as operators. Braille characters can be used in operators. So I can't write 'five times three' in Swift - five and three might be defined as variables, but times can't be defined as an operator, only as a function - but I can write the word times in Braille and define the resulting combination as a multiplication function, and it would work.

I have no idea what the logic in this decision was.

jonat
Posts: 11
Joined: Tue Mar 26, 2013 9:08 pm UTC

Re: 1513: "Code Quality"

Postby jonat » Sun Apr 19, 2015 9:38 pm UTC

PL/C was an "error correcting" implementation of PL/I from Cornell University that always gave you a compilable program no matter how badly you screwed up the syntax. Unfortunately, its corrections were rarely "correct' - while it could add missing semicolons and insert a * if you typed "a b" (assuming that you meant to type "a*b", most of the time its changes were not what the programmer intended and typically it just threw away the entire statement, saying "PL/C uses ;"

I lost track of the number of students who blindly followed the compiler's advice and wondered why their program didn't work. But at least it ran...

User avatar
Eternal Density
Posts: 5588
Joined: Thu Oct 02, 2008 12:37 am UTC
Contact:

Re: 1513: "Code Quality"

Postby Eternal Density » Mon Apr 20, 2015 1:10 am UTC

Mental Mouse wrote:hovertext: "I honestly didn't think you could even USE emoji in variable names. Or that there were so many different crying ones."

No, those were inserted by the IDE.

TECO: That was actually an editor. IIRC, "vi" was developed to be more comprehensible and less modal. There used to be a parlor game of typing your name into TECO and see what it does.

Programmers had terminals in their parlours?
Play the game of Time! castle.chirpingmustard.com Hotdog Vending Supplier But what is this?
In the Marvel vs. DC film-making war, we're all winners.

User avatar
ucim
Posts: 6888
Joined: Fri Sep 28, 2012 3:23 pm UTC
Location: The One True Thread

Re: 1513: "Code Quality"

Postby ucim » Mon Apr 20, 2015 4:18 am UTC

Eternal Density wrote:Programmers had terminals in their parlours?
How else would they access the mainframe in the boudoir?

Jose
Order of the Sillies, Honoris Causam - bestowed by charlie_grumbles on NP 859 * OTTscar winner: Wordsmith - bestowed by yappobiscuts and the OTT on NP 1832 * Ecclesiastical Calendar of the Order of the Holy Contradiction * Heartfelt thanks from addams and from me - you really made a difference.

User avatar
orthogon
Posts: 3099
Joined: Thu May 17, 2012 7:52 am UTC
Location: The Airy 1830 ellipsoid

Re: 1513: "Code Quality"

Postby orthogon » Mon Apr 20, 2015 11:27 am UTC

Khaz wrote:
MrScience wrote:Like the author's difficulties in searching for said operator, due to the lack of indexes on pure-symbol search turms, it took me a bit to track it down again!

I have been frustrated more times than I can remember simply by being unable to search for symbols. I cannot believe that here in 2015 it is still not possible to feed a string into a search engine and have it search for that string. What is wrong with society?

Thanks to StackOverflow, I just found out about SymbolHound, a search engine that aims to address exactly this issue. (I haven't tried it so can't say if it's any good).

I like vi and use it all the time, but I think it's a bit like driving a manual (=stick shift) car. There's a certain amount of machismo associated with it, in that in theory you can get much better performance but it requires training and skill to achieve this. If you don't know what you're doing you're going to be grinding the gears all the time and will quite possibly have an accident. And the automatic is probably more comfortable to drive for long journeys, just like a word processor/IDE is probably better for large documents/software projects.
xtifr wrote:... and orthogon merely sounds undecided.

dalcde
Posts: 173
Joined: Fri Apr 06, 2012 5:49 am UTC

Re: 1513: "Code Quality"

Postby dalcde » Mon Apr 20, 2015 11:34 am UTC

orthogon wrote:just like a word processor/IDE is probably better for large documents/software projects.


I'm yet to see a word processor that handles large documents.

User avatar
Neil_Boekend
Posts: 3220
Joined: Fri Mar 01, 2013 6:35 am UTC
Location: Yes.

Re: 1513: "Code Quality"

Postby Neil_Boekend » Mon Apr 20, 2015 11:41 am UTC

dalcde wrote:
orthogon wrote:just like a word processor/IDE is probably better for large documents/software projects.

I'm yet to see a word processor that handles large documents.

Hey, the MS word error where it crashed during saving on large documents (and render the file on disk unreadable) learned me to back up properly. Who are you to deny future generations that learning experience?
Mikeski wrote:A "What If" update is never late. Nor is it early. It is posted precisely when it should be.

patzer's signature wrote:
flicky1991 wrote:I'm being quoted too much!

he/him/his

User avatar
Quercus
Posts: 1810
Joined: Thu Sep 19, 2013 12:22 pm UTC
Location: London, UK
Contact:

Re: 1513: "Code Quality"

Postby Quercus » Mon Apr 20, 2015 12:14 pm UTC

orthogon wrote:
Khaz wrote:
MrScience wrote:Like the author's difficulties in searching for said operator, due to the lack of indexes on pure-symbol search turms, it took me a bit to track it down again!

I have been frustrated more times than I can remember simply by being unable to search for symbols. I cannot believe that here in 2015 it is still not possible to feed a string into a search engine and have it search for that string. What is wrong with society?

Thanks to StackOverflow, I just found out about SymbolHound, a search engine that aims to address exactly this issue. (I haven't tried it so can't say if it's any good).

I like vi and use it all the time, but I think it's a bit like driving a manual (=stick shift) car. There's a certain amount of machismo associated with it, in that in theory you can get much better performance but it requires training and skill to achieve this. If you don't know what you're doing you're going to be grinding the gears all the time and will quite possibly have an accident. And the automatic is probably more comfortable to drive for long journeys, just like a word processor/IDE is probably better for large documents/software projects.


The most important things about vi are the keybindings and modal editing - there's plenty of plugins for IDEs that will give you these to use alongside all the other nice doo-dads you get in an IDE (e.g. Vrapper for Eclipse). Extending the analogy, I guess that would be like a semi-auto gearbox in that you get the added control of manual combined with most of the comfort of an automatic.

moops
Posts: 10
Joined: Thu Aug 11, 2011 10:03 pm UTC

Re: 1513: "Code Quality"

Postby moops » Mon Apr 20, 2015 9:13 pm UTC

hdhale wrote:My first question regarding any bit of code is: does it yield the results you want? If yes, then everything else is just about efficiency. Only Computer Science instructors give credit of code that looks pretty but doesn't work.


Lots of code works for a narrow range over which is was tested. This is not just about efficiency. Well written code is easier to debug, extend, refactor, etc.

User avatar
Coyoty
Posts: 195
Joined: Wed Jun 06, 2012 5:56 pm UTC

Re: 1513: "Code Quality"

Postby Coyoty » Tue Apr 21, 2015 1:09 am UTC

I had a supervisor who was very upset that my code WASN'T a glimpse into the mind of Cthulhu. He demanded I drop the tidy programming and turn my programs into Goto Hell. I think gotos were his hatchet.


Return to “Individual XKCD Comic Threads”

Who is online

Users browsing this forum: Google [Bot], Google Feedfetcher and 107 guests