Using tabs instead of spaces in the Propeller Tool
Fake-Name
Posts: 7
I realise this is a bit of a religious topic among programmers, but I've recently been learning to work with the propeller MCUs, and the IDE is driving me nuts!
Please, Parallax, add an option to use tabs instead of spaces (and expanding tabs to spaces doesn't count). I realize it's a little thing, but it seems I'm constantly chasing errant spaces in my code. The propeller is an awesome product, and really easy to work with, however writing code for it is a bit of an ordeal.
Also, would it be possible to make \n characters wrap? The window full of spaces thing is a bit annoying too. It's really nice to be able to tap the right arrow key at the end of a line to jump back to the first column.
I realise these seem like fairly petty annoyances, bit the prop tool seems to be the only IDE I've ever worked with that treats spaces the way it does, and having to switch between it and ofther environments when working on other projects is really difficult.
Please, Parallax, add an option to use tabs instead of spaces (and expanding tabs to spaces doesn't count). I realize it's a little thing, but it seems I'm constantly chasing errant spaces in my code. The propeller is an awesome product, and really easy to work with, however writing code for it is a bit of an ordeal.
Also, would it be possible to make \n characters wrap? The window full of spaces thing is a bit annoying too. It's really nice to be able to tap the right arrow key at the end of a line to jump back to the first column.
I realise these seem like fairly petty annoyances, bit the prop tool seems to be the only IDE I've ever worked with that treats spaces the way it does, and having to switch between it and ofther environments when working on other projects is really difficult.
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
--Steve
Propalyzer: Propeller PC Logic Analyzer
http://forums.parallax.com/showthread.php?p=788230
Uh... What? There isn't any option to change the font in the editor.
Incidentally, I've found another good reason to fix the non-linewrapping behavior of the editor. I opened up a .spin file in an external editor, and it looks like the prop tool is appending spaces onto the right hand of many lines. It wouldn't suprise me if some source code file sizes are half again as large as the actual code content due to extraneous spaces.
It seems if you're moving from one line to another, and click to the right of the line, and type anything, the Prop tool thinks you want all the spaces between whatever you typed and the beginning of the line. However, if you delete whatever you typed, the spaces persist. If you're working on a piece of code a lot, more and more lines begin sprouting invisible extensions.
Now, a little additional file size shouldn't be a problem, but I personally use a SVN server to track my projects, so every little space conservation helps.
Incidentally, the propeller tool automatically expands all tab to 8(!) spaces on loading a file, and if you then save it it overwrites the tabs with spaces.
This is the only easy way to manage the variable tab stops that the tool implements. You can't easily translate a file with fixed tab stops to the variable spacing used in the IDE.
Personally I normally use vim with a TS of 4, but I've gotten used to the Propeller way of doing it.
I'm surprised you are seeing the trailing spaces on the end of lines. That's pretty bletcherous behaviour on the part of the IDE if its actually doing that.
I routinely swap between an IDE which tries to mimic the Propeller Tool behavior, gedit and vim and I don't have too many problems. Maybe the mixes between tabs and spaces juct become second nature, but as long as you remember that the IDE (and the compiler incidentally - if you have tabs in your source it will treat them as an 8 space indent) always translates a \t to 8 spaces you'll do ok.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"VOOM"?!? Mate, this bird wouldn't "voom" if you put four million volts through it! 'E's bleedin' demised!
switch over to the propellent.dll combined with any editor you like.
As INDENTION is used to identify structural details of the sourcecode
there might be problems when using tabs. If your editor indent let's say 3 columms per tab
and the propellent.dll tranlates a tab into 8 spaces this could change the structure of the sourcecode
anyway: how do you jump through lines of code ?
I do it by using ctrl-cursor-right or END + ctrl-cursor-left to jump from word to word
what's so difficult about typing space space to indent ?
more than two spaces moves indented parts of the sourcecode too fast out of sight
and the cursor ist set to the colum from the line above
so where at all is the problem ?
best regards
Stefan
Hm... I'm really not familliar with windows .dlls, but the propellant idea is interesting. I'll look into it
As long as the translation is consistant, it'll be fine.
Fancy. I generally just use the arrow keys.
Tabs are much cleaner, and that way, I don't have to fight the IDE when it decided to indend one line by 2 spaces when pressing tab, and another by 4 (yes, it does this to me regularly).
What? You actually have line wrapping problems? What resolution is your screen? My normal editor window is 210 chars wide. (@ 1920 x 1200) 4 spaces vs 2 makes very little difference.
It's mostly convenience. If an application decides that Ctrl+V should be cut, and Ctrl+C should be paste, it shakes things up, and gets on your nerves, no? If you work in multiple languages regularly, little things really get on your nerves, particularly if programming gets on your nerves enough as it is.
Post Edited (Fake-Name) : 6/7/2009 10:26:49 AM GMT
Ahh, that is the variable tab stop feature. Check out the IDE preferences and you can set your tab stops to whatever you like. It works that way as it tries to make a relatively good prediction about how it thinks you might best indent your code.
Each section has a different configuration for the tab stops as each section is generally structured differently.
It's pretty neat once you get used to it.
I would not bother with propellent.dll. Just use propellent as a command line compiler if you are using windows. It does run on WINE under Linux i386 also.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"VOOM"?!? Mate, this bird wouldn't "voom" if you put four million volts through it! 'E's bleedin' demised!
So what are the rules in Spin for interpretation of spaces and tabs into logical indentation levels?
This is also a pain when using tools like diff to compare different versions. Often I go around "neatening" code by lining up tables and comments etc. With no semantic changes.
That's OK in C for example as I can tell diff to ignore white space only changes and show me what has really changed. In Spin I end up with a huge diff output most of which is irrelevant but I have to check every change in case it's an important white space change.
Is the a good way to handle that?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
For me, the past is not over yet.
Post Edited (heater) : 6/7/2009 12:59:48 PM GMT
According to some discussions, it looks like SVN uses compression in the repository, but not the working copy of course. So the size argument for needing tabs with SVN does not appear valid. Even CVS uses compression. Old habits are just hard to break.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
--Steve
Propalyzer: Propeller PC Logic Analyzer
http://forums.parallax.com/showthread.php?p=788230