April 11, 2011
Nick Sabalausky wrote:
> "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.
> 
	I have seen editors that would convert a tab to spaces and only
delete one space when hitting backspace ;)

		Jerome
-- 
mailto:jeberger@free.fr
http://jeberger.free.fr
Jabber: jeberger@jabber.fr



April 11, 2011
On 4/11/11 1:51 PM, "Jérôme M. Berger" wrote:
> Nick Sabalausky wrote:
>> "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.
>>
> 	I have seen editors that would convert a tab to spaces and only
> delete one space when hitting backspace ;)
>
> 		Jerome

Eclipse, I'm looking at you!
April 11, 2011
On Fri, 08 Apr 2011 20:26:07 +0000, Adam D. Ruppe wrote:

> We discussed this first in the GUI library thread, but since it meandered so much, I decided to split off into a new subject. Much of what I say here will be old to anyone who saw the previous thread. There's some new stuff nearer to the bottom though.
> 
> I, with input from others, have started writing a little module for simple uses of a display. You can write to a bitmap, display it to a window, and handle events all in an easy way. The basics are cross platform, but you can use native function calls too.
> 
> http://arsdnet.net/dcode/simpledisplay.d
> 

I admit I didn't read the whole thread...

I just wanted to point out the following:
- XCB (http://xcb.freedesktop.org/) - aims to replace Xlib
- Wayland (http://wayland.freedesktop.org/) - aims to replace the X server

A quick look at the source code shows that you are targeting the X server, which might not be the best idea.

Please ignore my post, if the above is well known and has already been discussed.
April 11, 2011
teo wrote:
> XCB (http://xcb.freedesktop.org/) - aims to replace Xlib

I've heard of it, but never used it before. Since I wanted to write this quickly I stuck to what I knew (xlib on linux and gdi on windows).

Replacing it later, if necessary, won't be hard (the target specific code is only about 300 lines, all straightforward. We were considering changing to DirectX / OpenGL a bit later anyway, so the xlib might actually be secondary in any case).

But I doubt xlib is going anywhere any time soon. It's older than I am!
April 11, 2011
"teo" <teo.ubuntu@yahoo.com> wrote in message news:io00gq$5rc$1@digitalmars.com...
> On Fri, 08 Apr 2011 20:26:07 +0000, Adam D. Ruppe wrote:
>
>> We discussed this first in the GUI library thread, but since it meandered so much, I decided to split off into a new subject. Much of what I say here will be old to anyone who saw the previous thread. There's some new stuff nearer to the bottom though.
>>
>> I, with input from others, have started writing a little module for simple uses of a display. You can write to a bitmap, display it to a window, and handle events all in an easy way. The basics are cross platform, but you can use native function calls too.
>>
>> http://arsdnet.net/dcode/simpledisplay.d
>>
>
> I admit I didn't read the whole thread...
>
> I just wanted to point out the following:
> - XCB (http://xcb.freedesktop.org/) - aims to replace Xlib
> - Wayland (http://wayland.freedesktop.org/) - aims to replace the X server
>
> A quick look at the source code shows that you are targeting the X server, which might not be the best idea.
>
> Please ignore my post, if the above is well known and has already been discussed.

Even the Wayland site says that it's not going to replace X server anytime soon and that they're going to co-exist for the forseeable future. Don't know anything about XCB though.



April 12, 2011
Am 11.04.2011 17:25, schrieb Kagamin:
> Jonathan M Davis Wrote:
> 
>> So, if you do use tabs, you will end up with mixed tabs and spaces unless everyone involved is very careful, which isn't going to happen.
> 
> If no one is careful, you end up with mixed tabs and spaces, no matter what policies you're trying to enforce.

This is a good point.
April 12, 2011
Am 11.04.2011 23:03, schrieb David Gileadi:
> On 4/11/11 1:51 PM, "Jérôme M. Berger" wrote:
>> Nick Sabalausky wrote:
>>> "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.
>>>
>>     I have seen editors that would convert a tab to spaces and only
>> delete one space when hitting backspace ;)
>>
>>         Jerome
> 
> Eclipse, I'm looking at you!

By default Eclipse doesn't convert tab to spaces, though.
April 12, 2011
DigitalMarsTV Headlines:
"Newlines: Why is Microsoft still ignoring the public's demand to
eliminate the carriage return?"
"Breaking News: Police investigators are on the lookout for the
monster lunatic who originally designed the number system layout for
PC-keyboards. As a reminder for the viewers just tuning in, the
suspect is charged with felonies in regards to the following Laws: 1.
By Law, numbers shall always start from digit zero. 2. By Law,
Function Keys shall be vertically aligned against number keys, so as
to have the same order as the number keys. The authorities are asking
for anyone with information on the suspect to come forward and send an
e-mail to protect_our_GNUFreedom@gnu.org"
April 12, 2011
> On 04/11/2011 10:01 AM, Jonathan M Davis wrote:
> >> 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.
> 
> That's precisely what they are meant for... unlike space-indentation,
> tab-indentation respects you :-)
> Using spaces for indent is using *content* to describe *display*. It's
> messing up model with view, just like using <b> instead of <strong>.

I don't believe that the model-view issue really applies to code. For that to work, the model and view would have to be truly separate, and they aren't. Editors would have to understand the language and be able to format it based on what you wanted, then you could format code however you liked without affecting anyone else. But things just don't work that way. So, how you format your code matters. Using tabs screws with that unless you're completely consistent, and while a single developer may be consistent, groups of developers rarely are.

- Jonathan M Davis
April 12, 2011
> On 04/11/2011 08:13 AM, Jonathan M Davis wrote:
> > They mix tabs and spaces. On some lines, they use spaces and on others they use tabs.
> 
> Never seen this, not even once. Messing can only happen when one copy-pastes from modules using spaces.

As Steve pointed out, it frequently happens when you have multiple developers working on the same code. It may work with one developer who likes using tabs, but as soon as you get a mix of developers, you invariably get a mix of spaces and tabs unless _everyone_ involved is really careful, and that rarely happens. It's just too easy to use spaces without realizing that someone else used tabs or even that you yourself are using spaces, depending on your editor's settings.

Using only spaces and no tabs avoids the entire issue and is one of the major reasons (if not _the_ major reason) why it is incredibly common for coding standards to require spaces and prohibit tabs. Obviously, you _can_ use tabs if you're careful - especially if you're the only programmer involved - but it's just simpler to disallow tabs when you're dealing with a group of developers.

- Jonathan M Davis