April 11, 2011
On 4/11/11 10:30 AM, Kagamin wrote:
> Jonathan M Davis Wrote:
>
>> Every place that I've ever worked
>> at has gone for spaces only, and I've only ever heard of one place where it
>> was required that tabs be used for indentation. I'm sure that there are
>> others, but it's rare that I've heard of anyone thinking that using tabs in
>> code was a good idea.
>
> People often follow wrong traditions blindly.

That is actually very true about tab. It's a straight carryover from typing machines that has no justification today.

Andrei
April 11, 2011
> One of the reasons to switch to FreeBSD was to spend less time
> tinkering with the OS and "just use it".
>
> I?m not familiar enough with FreeBSD, but the message from the subject
> is what one gets when attempting to install DMD-2 on x86_64, so I
> believe that 32bit executable on 64bit OS is not the right combo on
> FreeBSD.
Let me address this, since I wrote the ldc, dmd, and dmd2 Makefiles in FreeBSD ports, after getting permission from Walter.  I simply marked the port as i386 since I read that there wasn't a 64-bit binary: I never tried building dmd as 64-bit.  32-bit binaries will run on FreeBSD amd64, but they might require a bit more work.  I read that some people simply compile i386 packages in a 32-bit system or jail and then install them in the 64-bit system.  So I'd guess that you should be able to use dmd2 on FreeBSD amd64, but it might take a bit more work.
April 11, 2011
Andrei Alexandrescu Wrote:

> That is actually very true about tab. It's a straight carryover from typing machines that has no justification today.

If it's useful, it doesn't matter, where it came from.
April 11, 2011
On 04/11/2011 05:31 PM, Adam D. Ruppe wrote:
> bearophile:
>> It's a module theoretically meant for Phobos, and the Phobos coding
>> standard are spaces.
>
> Yeah, that's all that matters in the end. "When in Rome..."
>
> But it's trivial to do a find and replace all before submitting so
> really, it's just not a big deal.

Smart editors actually differentiate between indentation and spacing elsewhere (meaning they won't mess up with spacing inline / in comments / docs / strings).

Denis
-- 
_________________
vita es estrany
spir.wikidot.com

April 11, 2011
On Mon, 11 Apr 2011 03:26:26 -0700
Ruben <chromium@hybridsource.org> wrote:

> Let me address this, since I wrote the ldc, dmd, and dmd2 Makefiles in FreeBSD ports, after getting permission from Walter.

Thank you for your work.

> I simply marked the port as i386 since I read that there wasn't a 64-bit binary:

That's fair.

> 32-bit binaries will run on FreeBSD amd64, but they might require a bit more work.  I read that some people simply compile i386 packages in a 32-bit system or jail and then install them in the 64-bit system.  So I'd guess that you should be able to use dmd2 on FreeBSD amd64, but it might take a bit more work.

I understand that "it might work"...today I've installed wine on my x86_64, but I simply expect to run 64bit compiler on 64bit OS and therefore hope that gdc2/ldc2 will fill the hole.


Sincerely,
Gour

-- 
“In the material world, conceptions of good and bad are all mental speculations…” (Sri Caitanya Mahaprabhu)

http://atmarama.net | Hlapicina (Croatia) | GPG: 52B5C810




April 11, 2011
Smart editors also allow you to unindent with a single backspace regardless if you're using tabs or spaces.
April 11, 2011
On Mon, 11 Apr 2011 06:17:58 -0400, spir <denis.spir@gmail.com> wrote:

> On 04/11/2011 07:51 AM, Jonathan M Davis wrote:
>> the only way that tabs work is if you use them consistently, which in my
>> experience almost never happens. And
>
> How so? If you probably set your editor, inconsistency simply cannot happen... The same is true for using spaces, anyway.

Don't want to get too much into this obviously polarized debate, but in my experience, people vary as much as editors.  And editors vary quite a bit.

In most of the editors I use, the default is to use spaces for indentation.  So what happens is someone opens a file that uses tabs for indentation, then adds some lines.  However, their editor only uses spaces *for those lines they added*, which results in a hybrid.  However, the person editing doesn't notice because it all lines up on their screen.

You may have philosophical objections to all of this, but this answers your question straightforwardly -- it happens, all the time, and this is how.

The easiest rule to follow is -- always use spaces to indent.  Almost all editors support this (and are set to this by default).  Almost all editors provide some sort of auto-indentation, or some command to indent a highlighted section of code.  The "oh crap, now I have to go back through and convert tabs to spaces" argument just isn't valid anymore.

-Steve
April 11, 2011
"Jonathan M Davis" <jmdavisProg@gmx.com> wrote in message news:mailman.3371.1302508910.4748.digitalmars-d@puremagic.com...
>> Jonathan M Davis Wrote:
>> > Personally, I think that it's _horrible_ to use tabs
>>
>> Why would one fear tabs?
>
> They change depending on your editor settings. Indenting gets screwed up
> if
> tabs and spaces are mixed. It's just plain annoying to have an indentation
> of
> multiple spaces which isn't actually multiple spaces.
>
> The biggest problem though is that it just totally screws with indentation
> if
> tabs and spaces are mixed and that invariably happens.
>

You're drawing a completely invalid conclusion from that, because it works the same both ways. If I have a bunch of code indented with spaces, all it takes is a few things to be indented with tabs instead to create the *exact same screwup*. You've chosen tabs as the villian completely arbitrarily.

Also I find your argument that the mixup is significantly more likely when tabs are used for indentation to be extremely questionable. You admit yourself that you've rarely come across situations where tabs are the default. So how would you know? Based on that *one* piece of anecdotal evidence? And even that can be suspect, because if you were involved, we know you're accustomed to using spaces for indentation, so that could very well have been the reason for the mixup.

I have worked with code that used spaces as indentation on various occasions, and I always did wind up accidentally sticking some tabs in there. So I know first hand that the idea of the mixups not happening with space-indentation is a load of crap. They're equally likely.

And as far as needing to use spaces in code anyway: That's not remotely a problem. People know damn well the difference between a space and indentation. Fuck, if MS Word users can figure it out, so can programmers.

> Tabs serve no useful purpose IMHO.
>

Well, IMO, using spaces for indentation serves no useful purpose. At least tabs actually *mean* alignment and indentation. Spaces don't and never have. Plus, what's the use of being able place the cursor at arbtrary points within the "4 spaces" (or 8 spaces, or whatever)? All it does is make me have to press left/right-arrow-key a whole hell of a lot more (which I really do find to be a PITA). And makes it easier to accidentally end up with a messed up indentation of +/- 1 space somewhere. Spaces for indentation is just a misuse and a kludge to force on each other the idiologies of how large indentation should be.



April 11, 2011
"Kagamin" <spam@here.lot> wrote in message news:inv6q0$1hmi$1@digitalmars.com...
> Jonathan M Davis Wrote:
>
>> Every place that I've ever worked
>> at has gone for spaces only, and I've only ever heard of one place where
>> it
>> was required that tabs be used for indentation. I'm sure that there are
>> others, but it's rare that I've heard of anyone thinking that using tabs
>> in
>> code was a good idea.
>
> People often follow wrong traditions blindly.

Especially in corporations.


April 11, 2011
"Andrej Mitrovic" <andrej.mitrovich@gmail.com> wrote in message news:mailman.3396.1302548836.4748.digitalmars-d@puremagic.com...
> Smart editors also allow you to unindent with a single backspace regardless if you're using tabs or spaces.

In other words, *some* editors handle space-indentation intelligently (and do so by reinventing *tabs*), while *all* editors handle tab-indentation intelligently.