![](/i/fill.gif) |
![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
>> Even the free version of VS has a GUI for setting up and accessing local
>> and remote databases from your code
>
> Even the Java version from 10 years ago?
Dunno, I'm using the ones you can download from here:
http://www.microsoft.com/express/Windows/
> Well, it was an old version of Max. But, as far as I could tell, it only
> renders triangles. (There's probably a way to move the points around; I
> didn't look too hard for it.) The texturing options seemed pretty
> extensive though...
>
> As for VS, it was a struggle to figure out how to make it compile Hello
> World and run it. You would have expected this to be the most trivial
> thing, but no... Given the difficulty of doing this, I didn't exactly hunt
> around for the button that embeds SkyNet into your program.
In VS C# I can just go to "File -> New Project -> Console Application", up
pops a "Program.cs" source code file with about 10 lines of code, a class
containing an empty "Main" method. I write "Console.WriteLine("Hello
World!");" and press F5. Job done.
Note that as I typed Con the autocomplete list popped up and Console was
highlighted so I just pressed enter, then when I pressed "." the next list
popped up of methods/properties of "Console", after I typed "W" it
highlighted "Write", but then I saw that "WriteLine" was below so I pressed
down arrow and enter again, then I typed "(" and I was given a list of
overloaded methods I could call, I just ignored that and entered my string,
assuming there would be one that took a string. Also if I made any mistake
(or paused for too long typing before completeing the statement) it got
underlined in red...
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
>> As for VS, it was a struggle to figure out how to make it compile
>> Hello World and run it. You would have expected this to be the most
>> trivial thing, but no... Given the difficulty of doing this, I didn't
>> exactly hunt around for the button that embeds SkyNet into your program.
>
> In VS C# I can just go to "File -> New Project -> Console Application",
> up pops a "Program.cs" source code file with about 10 lines of code, a
> class containing an empty "Main" method. I write
> "Console.WriteLine("Hello World!");" and press F5. Job done.
As I recall, with VS J++, if you do "console application", it generates
a Java class file with about 30 lines of JavaDoc comment stubs, argument
parsing and exception handling, and so on. (E.g., main() parses the
argument list, and if it sees "--help", it calls a stub method named
help() which you're supposed to fill in.)
Now you could sit there and delete all this crap, or you could select
"empty project". That way, you get to decide what to name your class,
and you can write Hello World quite easily. You then have to configure
VS to know which class is the "main" that you want it to run. (And
whether you want it to run in normal mode or debug mode, and a whole
bunch of other stuff.) And THEN you can actually run it.
Seemed like a whole lot of work, but once you've spent an hour puzzling
out how to do it, it's reasonably easy the next time around.
Oh, and do NOT try to delete or rename classes. VS apparently doesn't
like this at all.
All of this happened a while ago, but my recollection is that when you
remove or rename a source file, the compiled class files hang around,
littering up the place. And trying to figure out where VS stores them is
nontrivial, given that there are normal and debug versions of them. In
the end, I decided that the easiest way to refactor was to create a
brand new, empty project, and import the files from the old project one
at a time. It was just the least painful way to get the job done.
(Again, this seems like a lot of work just to keep VS happy. If I were
just using Notepad and javac, I wouldn't have to do it.)
> Note that as I typed Con the autocomplete list popped up and Console was
> highlighted so I just pressed enter, then when I pressed "." the next
> list popped up of methods/properties of "Console", after I typed "W" it
> highlighted "Write", but then I saw that "WriteLine" was below so I
> pressed down arrow and enter again, then I typed "(" and I was given a
> list of overloaded methods I could call, I just ignored that and entered
> my string, assuming there would be one that took a string. Also if I
> made any mistake (or paused for too long typing before completeing the
> statement) it got underlined in red...
That sounds about right - except, as I say, whenever I pressed enter, it
would move to the next line as well as entering the selected text, so
I'd have to hit backspace to get back to where I was.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
scott wrote:
> BTW this is with VS C# express edition (it's free), your experience with
> other IDEs may vary :-)
Well, maybe they've fixed it since I used VS J++ a few years ago. Who knows?
(Some to think of it, I don't recall VS attempting to do any
autocomplete when I did that C++ stuff last year... Maybe it did and I
just don't remember. Hmm.)
>> After the horror of building a GUI the hard way, I always use a GUI
>> designer if I have a choice. (Like I've said, you don't need an IDE
>> for that necessarily.)
>
> It's helpful that it's integrated though, apart from the obvious reasons
> of not having to load and switch programs and save etc, it means if you
> for example rename one of the icons or something it can update the
> references to it in all your other code files.
Now that actually sounds useful.
> Also when you add an
> event handler the IDE can automatically auto-insert the method skeleton
> into your code and register it to be called for that event, so all you
> need to type is actually what you want to be done for that event.
As does that, assuming it does it properly. (IME, VS usually prefers to
have all autogenerated code perform its function in the most
over-complicated way feasible.)
>>> 4) The red underlining of compiler errors as you're typing (in MS C#
>>> IDE)
>>
>> That's useful IF IT WORKS CORRECTLY, which it doesn't always do IME.
>
> Which IDE? in VS C# Express it works flawlessly IME.
Maybe the parsing rules for C# are simpler than Java or something? Or
maybe they've just ironed out the bugs now... As I recall, it *usually*
worked OK, but not always.
>>> 6) "Template" projects for a Windows app
>>
>> What does that do?
>
> You can go "File -> New -> Windows App" and it generates all the
> necessary code and resource files for a ready-to-compile form
> application. You then simply add in whatever extra bits you need. I
> guess you could do the same by creating all the files by hand first, and
> then copying&pasting in explorer and renaming everything everytime you
> wanted to start a new project.
I think this is perhaps part of the reason for the "you only need an IDE
if your language sucks" argument.
When you say it "generates all the necessary code and resource files",
what do you mean exactly? How much stuff do you need to make a form
application that opens one blank form? I would have thought you only
need to write a handful of lines of code - in which case, having it
autogenerated isn't saving you much effort.
In Haskell, I can fire up Glade, paint my UI, save it, and then write
maybe 6 lines of code in Haskell, hit compile, and I've got a GUI
application.
(Unfortunately if you want the application to *do* something, you start
having to write boilerplate code. For each button, you write one line of
code that says what function to run if somebody clicks it. That's pretty
much as minimal as boilerplate can *get*, but it's still tedious for a
complex UI.)
In something like Java, you end up writing miles and miles of
housekeeping boilerplate code just to get the thing to work. And that's
probably why people see an IDE as "necessary" when writing Java code.
The language itself is so unhelpful that you need an IDE to make the
task tractable.
I'm not saying IDEs are unecessary. I'm saying this is probably where
the "only pathetic languages need an IDE" argument comes from.
> I remembered another one:
>
> 7) Code refactoring.
Now that does sound potentially useful.
> Like if a function is getting a bit long, you can
> select a block of code and say "extract this to another function". All
> parameters and return values will be handled automatically.
So, what, it passes everything in scope as parameters? Or just
everything referenced?
> Or if you
> type a function name that doesn't exist yet, you can click and say
> "generate the boilerplate code for this function".
What's to generate? I'm presuming it just makes a one-line function
stub... unless you mean it does something more complex than that?
> Or you can go to
> "Insert -> New Class" and it will create a new file with the new class
> template in it.
Again, shouldn't an empty class be trivial to write in the first place?
> Or rename a variable and get the option to rename all
> instances of it in all files.
OK, now does it blindly rename it *everywhere*? Like just a find &
replace? Or does it actually apply scoping rules so that it knows it's
renaming "the same" variable throughout?
Smalltalk VisualWorks had a feature to rename a method, but
unfortunately it was a blind find & replace. If you wrote a class and
discovered that one of your method names as the same as some other
random class and you wanted to make it different, *all* the method calls
would get renamed. (Then again, Smalltalk doesn't have static class
information, so it's hard to do any better than that. Something
statically typed should be able to do this right.)
> Sure, each of the above are fairly small things, but in total it makes
> programming way faster.
I can see how that might work...
It's also quite nice having the property pane that tells you what's in
your source file at a glance. (Especially if you're working with
something like JavaDoc that forces you to put unrelated junk in amoungst
the working code.)
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
>> BTW this is with VS C# express edition (it's free), your experience with
>> other IDEs may vary :-)
>
> Well, maybe they've fixed it since I used VS J++ a few years ago. Who
> knows?
Most likely it's been improved a lot.
> As does that, assuming it does it properly. (IME, VS usually prefers to
> have all autogenerated code perform its function in the most
> over-complicated way feasible.)
In C# to handle events you register the method you want called with the
event, it's 1 line:
button1.Click += new System.EventHandler(MyMethod);
The GUI automatically adds this line to the Form Design source file when you
tell it to (usually you don't need to open this file, it is just called from
the main source file). But of course you can write that line yourself
anywhere to add/remove event handlers at runtime.
> When you say it "generates all the necessary code and resource files",
> what do you mean exactly? How much stuff do you need to make a form
> application that opens one blank form?
Well there's a "Form designer" file that holds any GUI elements you add,
that starts life as a pretty empty class definition (it just sets the class
name, Form title text and so on). The main code file is again just an empty
class definition with an initialisor method that calls the form definition
file (about 10 lines total). It also adds references to the project for the
assemblies you are likely to need (System.Windows.Forms, System.Drawing
etc), and a few settings for Windows forms.
> I would have thought you only need to write a handful of lines of code -
> in which case, having it autogenerated isn't saving you much effort.
You're right it doesn't save that much effort, but it's certainly easier to
start with that nice organised template rather than starting from scratch
each time.
>> Like if a function is getting a bit long, you can select a block of code
>> and say "extract this to another function". All parameters and return
>> values will be handled automatically.
>
> So, what, it passes everything in scope as parameters? Or just everything
> referenced?
Everything that is used/needed by the code you selected that isn't
accessible from outside the original function is passed as parameters. It
"just works" if you click it and then compile.
>> Or if you type a function name that doesn't exist yet, you can click and
>> say "generate the boilerplate code for this function".
>
> What's to generate? I'm presuming it just makes a one-line function
> stub... unless you mean it does something more complex than that?
eg if I type in "bool result = NewFunction(width,height);" and tell it to
make the stub, it will insert this immediately below the existing function:
private bool NewFunction(double width, double height)
{
throw new NotImplementedException();
}
Again, not a huge timesaver, but it's so easy to use and it comes up so
often it's worthwhile.
>> Or you can go to "Insert -> New Class" and it will create a new file with
>> the new class template in it.
>
> Again, shouldn't an empty class be trivial to write in the first place?
Sure, but it's something so common to do that even saving 30 seconds is a
benefit, especially if you want it in a new file, and that file to be saved,
added to the current project and opened in the IDE.
> OK, now does it blindly rename it *everywhere*? Like just a find &
> replace? Or does it actually apply scoping rules so that it knows it's
> renaming "the same" variable throughout?
Of course it applies scoping rules, it would be a bit useless if it didn't.
> Smalltalk VisualWorks had a feature to rename a method, but unfortunately
> it was a blind find & replace. If you wrote a class and discovered that
> one of your method names as the same as some other random class and you
> wanted to make it different, *all* the method calls would get renamed.
That wouldn't really work in .net, as the same common variable names and
methods are used repeatedly in a huge number of classes (eg the "Value" or
"Text" property, or the ToString() method). Of course people continue these
same conventions in their own code.
> It's also quite nice having the property pane that tells you what's in
> your source file at a glance. (Especially if you're working with something
> like JavaDoc that forces you to put unrelated junk in amoungst the working
> code.)
Oh one more:
8) Right click and "Go to definition" on a method. And of course the
View -> Navigate Back button afterwards :-)
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
>>> Or if you type a function name that doesn't exist yet, you can click
>>> and say "generate the boilerplate code for this function".
>>
>> What's to generate? I'm presuming it just makes a one-line function
>> stub... unless you mean it does something more complex than that?
>
> eg if I type in "bool result = NewFunction(width,height);" and tell it
> to make the stub, it will insert this immediately below the existing
> function:
>
> private bool NewFunction(double width, double height)
> {
> throw new NotImplementedException();
> }
>
> Again, not a huge timesaver, but it's so easy to use and it comes up so
> often it's worthwhile.
It actually throws an exception to remind you that you need to implement
it, rather than just silently doing nothing? Oh, that's nice...
Is there some way to quickly find all the stubs you haven't filled out
yet? (Other than just running the program and hoping it throws an
exception so you can see the stack trace.)
>>> Or you can go to "Insert -> New Class" and it will create a new file
>>> with the new class template in it.
>>
>> Again, shouldn't an empty class be trivial to write in the first place?
>
> Sure, but it's something so common to do that even saving 30 seconds is
> a benefit, especially if you want it in a new file, and that file to be
> saved, added to the current project and opened in the IDE.
OK, fair enough. I don't know about C#, but an empty class file in Java
is 2 lines. You tell VS what the class name is, and (hence the file name
MUST match the class name) it automatically saves it in the right place
with the right name. But sure, why not have it type the class
declaration as well? I guess it all helps. (Just so long as it doesn't
try to "help" by writing the entire application for you...)
>> OK, now does it blindly rename it *everywhere*? Like just a find &
>> replace? Or does it actually apply scoping rules so that it knows it's
>> renaming "the same" variable throughout?
>
> Of course it applies scoping rules, it would be a bit useless if it didn't.
OK, good.
>> Smalltalk VisualWorks had a feature to rename a method, but
>> unfortunately it was a blind find & replace. If you wrote a class and
>> discovered that one of your method names as the same as some other
>> random class and you wanted to make it different, *all* the method
>> calls would get renamed.
>
> That wouldn't really work in .net, as the same common variable names and
> methods are used repeatedly in a huge number of classes.
Yah, that's kind of the problem. ;-)
As I say, in Smalltalk, you can't tell which class a given variable is,
so you can't tell if you're calling #reset on a network socket or a
customer object. Which means if you want to rename the customer class's
#reset method... yeah, good luck with that.
With a statically typed language, an IDE ought to be able to do better.
(And from the sound of it, VS does.)
> Oh one more:
>
> 8) Right click and "Go to definition" on a method. And of course the
> View -> Navigate Back button afterwards :-)
So it's not just me who occasionally forgets where the **** I actually
defined the matrix inversion method? :-D
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Invisible wrote:
> a Java class file with about 30 lines of JavaDoc comment stubs, argument
> parsing and exception handling, and so on. (E.g., main() parses the
> argument list, and if it sees "--help", it calls a stub method named
> help() which you're supposed to fill in.)
Right. Because most people actually want that when writing code complicated
enough to need an IDE.
That said, you're aware that Java sucks in this regard, right? :-)
> Oh, and do NOT try to delete or rename classes. VS apparently doesn't
> like this at all.
You have to do it right. In my versions, renaming the file also renames the
class and all references to it.
> And trying to figure out where VS stores them is
> nontrivial,
Everything generated is in obj or bin, depending on whether it's
intermediate files or final executables. Does "nontrivial" mean "I had to
actually go take a look or read some documentation"?
--
Darren New, San Diego CA, USA (PST)
The question in today's corporate environment is not
so much "what color is your parachute?" as it is
"what color is your nose?"
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Invisible wrote:
> If you're
> trying to invoke a method of the current class, no matter what you do it
> won't populate the list.
I dunno. Just tried it, and "this." brought up the list of methods.
> "please use the currently selected alternative to complete what I'm
> typing",
Tab. Just like every other auto-complete system in existence.
> (And then there's the fact that every IDE I've seen refuses to let you
> indent your code correctly... but that's nothing to do with
> auto-complete as such.)
Edit->Advanced->Reformat entire document
Dude, maybe rather than bitching that IDEs suck, you should give it a rest
until you've tried one written this millenium.
>> 4) The red underlining of compiler errors as you're typing (in MS C# IDE)
>
> That's useful IF IT WORKS CORRECTLY, which it doesn't always do IME.
>
>> 5) Auto compile/link/run with one keypress
>
> I usually leave a CLI window open. To compile, just press the up arrow
> and enter. But sure, I'm certainly not *against* such a feature! ;-)
You know, that works pretty poorly if you have anything other than code
involved. If you're doing a video game and you need to import the audio,
graphics, models, and animations, once command line is unlikely to do it.
OK, so you have your development environment, non-integrated. So? What's
your point?
>> 6) "Template" projects for a Windows app
>
> What does that do?
Try it! Or at least google it. :-)
--
Darren New, San Diego CA, USA (PST)
The question in today's corporate environment is not
so much "what color is your parachute?" as it is
"what color is your nose?"
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
scott wrote:
> button1.Click += new System.EventHandler(MyMethod);
Actually, button1.Click += MyMethod;
works too, because one of the compiler passes sees this and fixes it for you.
> Well there's a "Form designer" file that holds any GUI elements you add,
It also sets up all the other stuff you need in a real commercial project,
like initializing the version number, adding a copyright to the executable's
properties box, etc.
A lot of what it does assumes you're writing a real program that more than
one person might some day use.
>> Again, shouldn't an empty class be trivial to write in the first place?
>
> Sure, but it's something so common to do that even saving 30 seconds is
> a benefit, especially if you want it in a new file, and that file to be
> saved, added to the current project and opened in the IDE.
Plus, it initializes it with a bunch of namespaces you're likely to need in
that kind of class.
> 8) Right click and "Go to definition" on a method. And of course the
> View -> Navigate Back button afterwards :-)
Control minus gets you back, also, if you want the keyboard shortcut.
You can also find all references to that method or class or variable
(excluding references to other variables with the same name).
--
Darren New, San Diego CA, USA (PST)
The question in today's corporate environment is not
so much "what color is your parachute?" as it is
"what color is your nose?"
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Invisible wrote:
> Is there some way to quickly find all the stubs you haven't filled out
> yet? (Other than just running the program and hoping it throws an
> exception so you can see the stack trace.)
Of course. Search for NotYetImplemented.
(I'm kind of surprised there's no comment reading
// TODO: Implement this
to make it show up in your to-do list.)
> OK, fair enough. I don't know about C#, but an empty class file in Java
> is 2 lines.
It is in C# too, as long as you don't want to import any namespaces or have
a constructor or anything.
--
Darren New, San Diego CA, USA (PST)
The question in today's corporate environment is not
so much "what color is your parachute?" as it is
"what color is your nose?"
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Invisible wrote:
> In Haskell, I can fire up Glade, paint my UI, save it, and then write
> maybe 6 lines of code in Haskell, hit compile, and I've got a GUI
> application.
Same in C#. Actually, you don't have to write any code at all. The
boilerplate is created for you. What do you think Glade is doing, if not
generating boilerplate.
When you want to (for example) code a Windows service, or a plug-in for a
web browser, or a custom type for a SQL server, you're going to have more
boilerplate to hook those two together.
A sufficiently advanced language can turn any "boilerplate" into "library
code", but that's generally done by having the compiler running library code
at compile time. Hence, LISP macros, FORTH dictionaries, etc. An IDE does
that for languages where the syntax doesn't include running arbitrary code
at compile time.
--
Darren New, San Diego CA, USA (PST)
The question in today's corporate environment is not
so much "what color is your parachute?" as it is
"what color is your nose?"
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |