My own IDE

Started by
8 comments, last by rogierpennink 17 years, 7 months ago
Hiya I'm trying to program PHP but I it gets frustrating looking through notepad for a certain thing, so I would like to make my own text editor/IDE. Its not going to be too complex but would: - Make TABS just two spaces long (I hate notepad making them 8 spaces). - Highlight keywords like function a certain colour. - Highlight variables a certain colour (shouldn't be too hard since they are all preceeded by a "$"). - Highlight comments in another colour. - Automatically save the file as ".php" Concidering I have some experience (plux a very big book!) on C#, I'm choosing that as the language, I have done stuff in C# before so I know about the saving thing, however I was wondering would all the text formatting stuff be hard? Also I am thinking about a feature that reduces functions to a single line when you click on them, then opens them again (like the recent Microsoft Express Editions, Netbeans, CodeBlocks and presumably other IDEs have), although I think that would be very difficult - should I try it?
Whether you think you can or think you can’t, you’re probably right – Henry Ford
Advertisement
I don't want to discourage you at all, but I see two possible interpretations for your post. Either you are really focussed on good PHP coding and you are in desperate need of a reasonable text-editor (better than notepad anyway), or you're not really into php, but rather looking for an excuse to use more fun languages like C# :P

Anyway, if your sole purpose is to get some PHP coding done I suggest you don't start on this project. There's a whole load of free text-editors on the internet that are all better than notepad. Underneath I listed a few:

- PHP Edit 2.2
- EditPlus

Both have syntax highlighting, wordwrapping and numerous other functions for other languages as well. PHP edit is pretty php specific as it will debug your PHP as well and has some more PHP features (although it also syntax-highlights other languages).

If you are not really wanting to continue with php, but rather use it as an excuse for having some fun with C# (which is quite understandable), I can only say that it depends on the level of skill you have with C#. Mind you, if you really want to continue with this prepare for a long long task. Syntax highlighting may seem easy, but just think of how many functions PHP has and how you will have to recognise them all. It's a BIG project, even for advanced coders, unless you work in a team.

Alas I can't help you with the C# as I don't know that language. I wish you lots of success though ;)
That is an extremely big project, and would require thousands of work hours to get it done well.

You might be interested in this list of PHP tools to help you with your PHP development.
Oh, I thought all it would involve was to -

-Go through the text word by word.
-If the word starts with a '$' colour it blue, a '//' or '#' colour it red or if it matches a list of phrases colour it green.

Thanks for the help, on second thoughts I'd be better using one of the two rogierpennink suggested.
Whether you think you can or think you can’t, you’re probably right – Henry Ford
I recommend a hybrid approach ...

1) find a real tool, for your real job ... don't write your own text editor, it simply has been done too many times, and good ones exist all over the place.

2) Write your own obsurdly simple text-editor, with syntax highlighting, as a great learner project for .NET / C# / GUI Coding / etc.

A SIMPLE editor is a very very easy project, a GOOD text editor is a VERY LONG project. So if you want to learn ... do it. In fact, you can build an editor like you mention in probably about 200 or so man hours while learning (20-40 man hours for a .NET expert). But like mentioned, a REAL text editor is a multi-month project. Not an efficient way to increase your PHP coding speed :)

Also, I really like SciTE as a simple multi-langauge text editor. The binary I use is the one that comes with the ruby one-click installer (cause that's how I found it), but it supports like 50 langauges out of the box, including ruby, python, perl, php, sql, c#, c++, xml, I think it even supports DOS batch files and BASH shell scripts ... best of all, each language is supported by a plugin and has a config file controlling stuff like tabs or spaces, tab size, indention style, etc ... so you can customize each languages default layout to match your preferences.

Good Luck.
Do not underestimate this project. I wrote the PHP IDE that we use here at work. I use the XDebug extension to get the information for my graphical debugger. I rolled my own textbox for autocomplete, autoindent, and syntax highlighting (highlighting works for mixed HTML, PHP, and &#106avascript). It has a built-in FTP client with automatic project deployment and direct FTP editing.<br><br>I used C# for everything but the textbox itself, where I used C++ (performance was becoming an issue in C# despite algorithmic optimizations). Fun project for me to do, but it took about a thousand hours of my spare time, and some things still aren't quite working right (can't search and replace inside the current selection, if you rename a file while it's open then saving the file will recreate the old named file, etc).<br><br>Bottom line: If you want to do it because it'll be a fun project, then go for it. I enjoyed doing it. If you really want a better PHP editor to help your web programming, get a commercial product. If you have Visual Studio, I'd recommend <a href="http://www.jcxsoftware.com/vs.php">VS.PHP</a>, which I used before I made my own. It's a great product. It costs $99 last I checked.
I'll throw my 2 cents in here.. Editplus all the way. Its great for a lot of file types and has replaced notepad on my system entirely.

Squiggly Frog - My little project place on the web. Updated as I see fit. =)

The problem with most IDEs is that they make a bunch of their own files aswell as the actual code - for example MS Visual Express whatever makes pleanty of files that are used for the IDE but not the compiler.
Another reason I was trying to create my own was so that there would only the code files and nothing else.
Whether you think you can or think you can’t, you’re probably right – Henry Ford
Well, I'm not sure if the PHP edit I mentioned makes extra files, but EditPlus only makes .bak files standardly, which are backups of your work. And even that, you can turn off ;)

This topic is closed to new replies.

Advertisement