Learning C++

J

James Kanze

On Windows with its weak command-line and lack of tools, that
seems likely to be true, but the Unix development environment
I mentioned above doesn't feel very "barefoot" or manual to
me.

On Windows, you can install any number of Unix-like toolkits.
And even the native tools, like cmd.exe, are getting better.
What I can say is that it's usually a lot faster to type in a
short command than to rummage around in dozens of menus, just to
find that the particular command you need wasn't provided.

All of which explains why professional programmers in a Unix
environment regularly outperform those in a Windows environment.
What surprised me, having to use a IDE, is just how difficult it
is to do the things that were provided. Even for the simple
tasks of a beginner, an IDE just slows things down and makes
them more difficult to do correctly.
 
J

James Kanze


[...]
Pobably so -- but the alternative is to not have the whole
problem set at all.
What btw is pretty shocking. I recall Borland 3.x' exported
makefile had just the list of .c sources, and .AUTODEPEND up
front -- the dependencies were compiled into .obj and make
itself read them, if the file was present. 20 years ago.
Then in today's sytems I still see the need for separete .d
outputs and cryptic rules to make them picked up? It is
crazy.

The problem is that in most cases, the authors of make aren't
speaking with the authors of the compiler. When they do: Sun's
make has a similar feature. Which only works with Sun CC, of
course.

There is a middle road between everything graphic and in menus,
and having to write every dependency yourself, or even write
some complicated code in make to generate them automatically.

[...]
Just like you have a selection of shells on unix, you can do
the same on windows. And certainly all the unix "tools" are
available.
Just appear much less needed.

Do they? I don't know any really good programmer under Windows
who doesn't use them.
There was a good joke about ATM with unix interface. ;-)
Unfortunately the keywords are not google-friendly, but I'm
sure you can imagine it.

Yes, but the target audience isn't the same.
And the point is, that if you can carry out what you want with
a single keypress or click (sometimes with 2, other times with
0) why use more? Why re-type the info before you (or paste
it) if avoidable?

The point is that you can't. Regardless of the IDE. You can't
enter code with a single click, and you can't do any advanced
editing with a single click.
 
P

peter koch

On Windows, you can install any number of Unix-like toolkits.
And even the native tools, like cmd.exe, are getting better.
What I can say is that it's usually a lot faster to type in a
short command than to rummage around in dozens of menus, just to
find that the particular command you need wasn't provided.

All of which explains why professional programmers in a Unix
environment regularly outperform those in a Windows environment.
What surprised me, having to use a IDE, is just how difficult it
is to do the things that were provided.  Even for the simple
tasks of a beginner, an IDE just slows things down and makes
them more difficult to do correctly.

Could you exemplify? I am on of those who grew up with make-files,
entered IDE-land and ended back with make-files. But for me, the step
back to make-files was not a step forwards: I find the IDE simpler and
faster to use.

/Peter
 
N

nick

    [...]
"Jorgen Grahn" <[email protected]>
   [...]
And the point is, that if you can carry out what you want with
a single keypress or click (sometimes with 2, other times with
0)  why use more?  Why re-type the info before you (or paste
it) if avoidable?

The point is that you can't.  Regardless of the IDE.  You can't
enter code with a single click, and you can't do any advanced
editing with a single click.

Sure I can... I can enter whatever code's in my paste buffer by
clicking my middle mouse button.
 
B

Balog Pal

James Kanze said:
There is a middle road between everything graphic and in menus,
and having to write every dependency yourself, or even write
some complicated code in make to generate them automatically.

Sure. Just like many people wrote here -- make & co. is used to have "all
the power" and to suffice the "I f...ing rule" approach. While IDEs are
built around pre-thought defaults and use cases. And outrside that you're
often hosed or handicapped. But if the supported stuff is along your path,
you can sit back and enjoy.

This thread was about learning, I said that IMO in the phase one learns the
language -- or I could add, a system API, or a library/framework -- there is
no need for the excess power and customization level.

The "new project" wizards' idea of a project layout may not fit some
expert's fine-tuned layout, but I doubt it is not good to try out whatever
is subject of learning. You won't keep that stuff anyway, do you?

And while, as you told, make-writers do not speak with many
compiler-writers, the advice to use the resulting mess is IMO only good for
the lucky situation when they did. ;-)
Do they? I don't know any really good programmer under Windows
who doesn't use them.

What I wanted to say, they will be sitting there installed, almost sure, but
most time just collecting dust. (Hm, I exclude the cases when they are
invoked by specialized scripts/programs made to cover some use case...)
Yes, but the target audience isn't the same.

Do you really think that interface dexterity shall count that much in that
kind of design? So if the most common use case is "withdraw $50" it is put
on a button only for "idiots", while the experts are damned to type in the
whole command and the actual amount? Because they can, reliably? And may
want to fetch $3.1415 more often then others?
The point is that you can't. Regardless of the IDE. You can't
enter code with a single click,


I what? Thinking up and writing code was never the task of the IDE (or any
editor). It is environment to work, not replacement of the programmer.

I don't expect code written. (Though simple editors do have ability to
insert common code fractions on up to 2 clicks or keys).

But I do expect to
- have instant and easy access to most relevant information (like in code
definition windows, call/caller graphs, man/msdn pages)
- navigation around all the interesting locations (like mentioned before +
error spot from build)
- sensible management of windows and panes that present the stuff I am
working with
- easy access to most/all tools I need along the road (editors for different
kinds of sources, the build, debuggers, source control)

And I certainly welcome additional intelligent behavior, like auto-checkout
files I type into, collect TODOs, pending checkins, etc.
and you can't do any advanced editing with a single click.

What is "advanced editing" mean?

Refactoring actions? I never used such an editor yet, but would welcome --
it certainly sounds like an IDE functionality and hardly doable by atomic
tools.

Reformatting code? That is basic in most anything.
Search/replace in all project files? I can do it in IDE, not sure how it is
doable for a general case with make-build... Especially ad-hoc and without
pain.

Please give some example what case were you thinking here.
 
D

dragan

Andy Champ said:
dragan wrote:

Motors. But WTH.

No, that would be treading toward defamation of a real company. ;)
Whether this is him or not I can't say but:

http://www.utc.edu/Faculty/Harold-Climer/

The guy exists.

On the other hand...

http://www.utc.edu/Academic/ComputerScienceAndEngineering/

They have a comp sci department - why ask here, and not there?

I was just wondering why someone claiming to be a professor (in math and
comp sci no less!) would not do some basic research, but maybe I was being
to harsh, as I find it easy to just ask occassionally also (just not
usually. Rarely actually). I don't really care who the dude is, it just made
me wonder if he was trolling.
 
B

Balog Pal

James Kanze said:
Makefiles are certainly something additional that you have to
learn. And they shouldn't be necessary for a beginner. I used
to believe that IDE's were a good thing for beginners, because
they allowed deferring the learning of makefiles and such---one
thing at a time. For the last couple of months, however, I've
had to work under an IDE, and I now realize that they represent
even more complexity than make.

Please write an example.

And do you mean that the excess complexity you are discovering is something
that is genuinely present in beginner's projects, or it is tied to the
project you (as a seasoned expert) were summoned?
So until someone comes out with
something better, we're stuck with make as the simplest
solution: the easiest to learn and use.

This sounds like your bunch of make experts could manage the build of a
project that was not fit an IDE's idea. And found it easier too -- that is
hardly surprising.

But I don't see how actual easyness follow.

IMO if you come to production, and any non-trivial project, managing the
build is an expert area in its own right.

I certainly wouldn't start to rig my lamelist-candidate if put in the
situation (despite having worked with make, and have clues). But ask somene
really fit, to create the initial solution, and before gone, playing
expected scenarios of maitainance.

After all there are candidates, and why learn them all? Or why go with the
likely suboptimal system built on limited knowledge/familiarity?


Then going back to subject -- production and learnnig do not mix so well.
 
B

Balog Pal

James Kanze said:
All of which explains why professional programmers in a Unix
environment regularly outperform those in a Windows environment.

I heard that claim repeated over and over but yet to observe it in
practice...
What surprised me, having to use a IDE, is just how difficult it
is to do the things that were provided. Even for the simple
tasks of a beginner, an IDE just slows things down and makes
them more difficult to do correctly.

Please some examples. Which IDE and what tasks?
(btw as said before jsut something being 'IDE' has little relation with
'good' -- like in the old times on DOS Borland's IDEs are excellent, while
MS' Programmer's Workbench or how it was called was a simple nightmare. The
firt one could make you fly the other rather dreagged in a swamp. )
 
J

James Kanze

Sure. Just like many people wrote here -- make & co. is used
to have "all the power" and to suffice the "I f...ing rule"
approach. While IDEs are built around pre-thought defaults
and use cases. And outrside that you're often hosed or
handicapped. But if the supported stuff is along your path,
you can sit back and enjoy.

Of course, it almost never is in practice:).
This thread was about learning, I said that IMO in the phase
one learns the language -- or I could add, a system API, or a
library/framework -- there is no need for the excess power and
customization level.

That's what I generally used to think: you wouldn't really want
an IDE in a professional environment, but for learning, they
would permit you to abord one thing at a time. Now that I've
actually used one a bit, I'm less sure. (But maybe that's just
because of my frustration.)
The "new project" wizards' idea of a project layout may not
fit some expert's fine-tuned layout, but I doubt it is not
good to try out whatever is subject of learning. You won't
keep that stuff anyway, do you?
And while, as you told, make-writers do not speak with many
compiler-writers, the advice to use the resulting mess is IMO
only good for the lucky situation when they did. ;-)

Or for the situation where someone expert in make wrote the
global makefiles. At least with GNU make (and probably some
others), it's quite possible to create a situation where the
client makefile is no more than a list of sources, the name of
the binary, and a single include which does the rest.

Without such support, I guess I'd have to agree. (I was very
frustrated with the restrictions in the IDE when I wrote my
first posting.) On the other hand, can you really learn C++
effectively without some initial support?
What I wanted to say, they will be sitting there installed,
almost sure, but most time just collecting dust. (Hm, I
exclude the cases when they are invoked by specialized
scripts/programs made to cover some use case...)

I don't find that to be the case, at least not in professional
environments. Everywhere I've been before, most people worked
most of the time from the shells. Where I am now (the first
100% Windows environment for me), it's not so much the case, but
the shells are used for any number of scripts and other things.
And very often, when there's something more complicated that
needs to be done, I can get it done faster from the shell than
the Windows experts can do from the GUI.
Do you really think that interface dexterity shall count that
much in that kind of design? So if the most common use case
is "withdraw $50" it is put on a button only for "idiots",
while the experts are damned to type in the whole command and
the actual amount? Because they can, reliably? And may want
to fetch $3.1415 more often then others?

That isn't the issue. In practice, you really only want to do
one thing at an ATM. Developing software requires a large
number of different activities, from designing UML, writing HTML
documentation, writing code, compiling, setting up code reviews,
etc. Some of this is supported by the usual tools, but in
practice, you're almost always doing something a little bit
more than what they offer.
I what? Thinking up and writing code was never the task of
the IDE (or any editor). It is environment to work, not
replacement of the programmer.
I don't expect code written. (Though simple editors do have
ability to insert common code fractions on up to 2 clicks or
keys).
But I do expect to
- have instant and easy access to most relevant information (like in code
definition windows, call/caller graphs, man/msdn pages)
- navigation around all the interesting locations (like mentioned before +
error spot from build)
- sensible management of windows and panes that present the stuff I am
working with
- easy access to most/all tools I need along the road (editors for different
kinds of sources, the build, debuggers, source control)

All of which is present with a good editor/shell combination
under Unix (or Windows, with bash and gvim). I suppose that you
could call it partially integrated, but if you invoke make from
vim, it will position you on the error. Plus a lot of other
things. (I find that when restructuring code, I make a lot of
use of :argdo g/.../... for example.) In fact, what I most
dislike about Visual Studios is that it doesn't support your
third point; it presents a lot of not particularly relevant
information, but still makes it very hard to find the relevant
information.
And I certainly welcome additional intelligent behavior, like
auto-checkout files I type into, collect TODOs, pending
checkins, etc.

We're using subversion, so there is no check-out. I'm not sure
I like this aspect, however. I don't like the fact that I can
accidentally modify a file I happen to be looking at. (Of
course, in vim, I'll open it read only, so there's no problem.
If Visual Studios has this option, I'm not aware of it.) For
the rest, it's all there from a normal editor and the shell.
What is "advanced editing" mean?

Search and replace, for starters. You still have to enter the
regular expression and the replacement text. By the time you've
gotten the dialog box open and your hands back to the keyboard,
I've finished the command.

When editing (entering text), anything which requires using the
mouse is a minus, since it requires taking your hands away from
the base position on the keyboard. (When just browsing, of
course, other rules hold, and I do tend to use the mouse for
most browsing.)
Refactoring actions? I never used such an editor yet, but
would welcome -- it certainly sounds like an IDE
functionality and hardly doable by atomic tools.
Reformatting code? That is basic in most anything.
Search/replace in all project files? I can do it in IDE, not
sure how it is doable for a general case with make-build...
Especially ad-hoc and without pain.

One frequent operation for me is grepping for every place where
some function is used. Then invoking the editor on just those
files, running through the first modification, memorizing the
keystrokes in a macro as I do, then undoing it, and invoking it
on all of the files I'm editing (and only on those files---with
a bit of care in my original search string, I can only modify
specific uses of my function).
Please give some example what case were you thinking here.

As above. Or modifying all of the project files (in about
twenty different projects in the solution) in a similar way (but
the modification depends partially on the directory in which the
project file is found).
 
J

James Kanze

Please write an example.

Well, in my old home environment, a makefile was basically:

# Copywrite text...
buildRoot = whereever
sources = toto.cc titi.cc tata.cc
testSources = test1.cc test2.cc test3.cc
binary = prog
#include $(buildRoot)/Makefiles/component.mk

If there were addtional steps, of course, it would be more
complicated, but even in cases where I had to first build a
local binary to build one of the sources, 10 or 15 lines would
suffice. And most of the above would be inserted automatically
when I opened a new file named GNUmakefile.

Of course, $(buildRoot)/Makefile/component.mk is pretty
complicated, but a beginner, working in my environment, doesn't
have to deal with it.
And do you mean that the excess complexity you are discovering
is something that is genuinely present in beginner's projects,
or it is tied to the project you (as a seasoned expert) were
summoned?

To be honest, it's hard to say. I'll admit some frustration,
because I am dealing with a fairly complex environment, in which
many of the sources are either built automatically or are
modified by other programs, with several DLL's, etc. But I was
somewhat surprized at how awkward the GUI interface was, even
for simple things that might actually be part of a beginner's
project.
This sounds like your bunch of make experts could manage the
build of a project that was not fit an IDE's idea. And found
it easier too -- that is hardly surprising.
But I don't see how actual easyness follow.
IMO if you come to production, and any non-trivial project,
managing the build is an expert area in its own right.

I'd certainly agree with you there. Where I was before, we
managed for three different platforms, using the same codebase
(and the same makefile for each component), but it did take some
expert knowledge to create the build system.
Then going back to subject -- production and learnnig do not
mix so well.

Yes. And until actually using them, I always thought that IDE's
had their place in learning process. Maybe it's just my recent
frustrations, but now I'm not so sure.
 
I

Ian Collins

James said:
One frequent operation for me is grepping for every place where
some function is used. Then invoking the editor on just those
files, running through the first modification, memorizing the
keystrokes in a macro as I do, then undoing it, and invoking it
on all of the files I'm editing (and only on those files---with
a bit of care in my original search string, I can only modify
specific uses of my function).

That sounds like one case where an IDE like NetBeans or Eclipse would
have an advantage. They both can list all the uses of a function and
perform basic refactoring tasks.
 
B

Balog Pal

James Kanze said:
Well, in my old home environment, a makefile was basically:

# Copywrite text...
buildRoot = whereever
sources = toto.cc titi.cc tata.cc
testSources = test1.cc test2.cc test3.cc
binary = prog
#include $(buildRoot)/Makefiles/component.mk

If there were addtional steps, of course, it would be more
complicated, but even in cases where I had to first build a
local binary to build one of the sources, 10 or 15 lines would
suffice. And most of the above would be inserted automatically
when I opened a new file named GNUmakefile.

Now, that makes sense, but let's put it back in the original context.
A forum suggestion could go as

A) Forget the IDE's project manager, instead open http://myhome/mybuild
there I list the versions on make to install and rules file and description
where to paste your source list -- then just issue make from cmmand line and
have good life.

B) Forget the IDE and use command line with make.

The usual suggestion goes as the B) version, however out of the box make
will not have that magic rules file. And creating it in my guess is about
as easy as implement boost/type_traits.

OTOH, let's see ahead. The beginner installs that rule file and pastes the
source filenames where due, and is happy. But how is that ahead to the
alternative, where he pastes the same list in the "add files" dialog, and
press F7 or clicks on the toolbar or whatever to build?

I really miss the fundamental difference except for the "not invented here"
factor. (no pun intended)
Of course, $(buildRoot)/Makefile/component.mk is pretty
complicated, but a beginner, working in my environment, doesn't
have to deal with it.

Just like with the IDE case. Then when he wants to change the stuff to
build a GUI application instead of a console one, or a dll, he reads the
dox for your rules to define some magic symbol -- or if there is a direct
compiler option line, the compiler dox. While in the IDE he starts wit
selecting a different project in the wizard -- or opens the settings and set
the switches on UI, or on the direct line...

Is there a fundamental difference? If so, favor to which way?
To be honest, it's hard to say. I'll admit some frustration,
because I am dealing with a fairly complex environment, in which
many of the sources are either built automatically or are
modified by other programs, with several DLL's, etc.

Sure. That is the very situation, where we want fine control. Where
make -- and tools that allow you closer to the metal are too likely needed.
Or having familiarity, are picked up, even if the other systems also may
cover the case.

And you have a ton of existing stuff, that already builds somehow, also
possibly source control system with its own quirks, etc. Not the other
way around -- that you start with nothing, but components that are
compatible with the IDE, and add more sources as you go -- bending to the
preferred way of the chosen system.
But I was
somewhat surprized at how awkward the GUI interface was, even
for simple things that might actually be part of a beginner's
project.

awkward is subjective. I mostly used MSVC versions 2, 4, 5, 6, (and 1, 1,52
for 16 bit), the interfaces IIRC were different for most versions, and in
the usable category -- it is painfully easy to forget selevting "all
versions" and issue a change to jsut the active (Debug) and looking back the
special options is nearly impossible.

OTOH the settings are in a text file, that you can as easily diff in version
control, and for special tasks you can edit that... what is hardly different
to dealing with a makefile with an external rules include.

With the VS2008 the interface is changed again, I made just a few projects,
I woudn't say it was any awkward for (what I think is) normal use. If it
chokes on defining a custiom translator, well, life's a bitch.
Yes. And until actually using them, I always thought that IDE's
had their place in learning process. Maybe it's just my recent
frustrations, but now I'm not so sure.

Guess frustration comes from (among other things) that you know what you
want to do, and not how to do it. And must deliver in time too.

Learning goes another path, you're shown how-do's and what the result. Then
eventually you figure out to use the learned working ways to selct for a
particular task.

Actually people experienced in a certain way are in danger here -- and tend
to skip a vital learning-from-start phase on a new installation, instead try
to force some light mapping of what they did before. Where the new
thing may have it, or even better, just needs a different approach. Hard
to fill a cup that is already full... ,-)
 
B

Balog Pal

James Kanze said:
That's what I generally used to think: you wouldn't really want
an IDE in a professional environment

All good pragmatic methodology I read had a chapter "Sharp tools".
, but for learning, they
would permit you to abord one thing at a time.

That sounds like massive prejudice.
Now that I've
actually used one a bit, I'm less sure. (But maybe that's just
because of my frustration.)

James, please, from what you write it is evident you didn't *use* one in the
professional sense. So your conclusions are premature.

Looking back, i started quite every new thing with RTFM. Really. Before
(maybe instead :) the install. Not aiming to memorize all the details,
but make a point to read through all the all the controls and use cases.
So later I have some figure if something is or is not there.

I see many other people just jump into it, and try to pick up as it goes --
the result is ceratinly they never discover 95% of the functionality, and
loudly express what sucks -- or just stay improductive and frustrated about
it.

My experience is that doing the tutorials absolutely worth the time
investment. :)

And the usual wisdom -- never be shy to ask those who are ahead. Especially
if they gladly offer the help.

The software is full of genuine sources of frustration, why increase it
voluntarily?
Without such support, I guess I'd have to agree. (I was very
frustrated with the restrictions in the IDE when I wrote my
first posting.) On the other hand, can you really learn C++
effectively without some initial support?

I did it, so it is possible -- but no way would I suggest anyone that way :)
when by now support is easily available. Some support at least.

Certainly the ideal way is (IMO) to get into a team with a good expert
mentor. (hardly easy in practice, while getting into a WTF environment has
wide chances...)

I don't find that to be the case, at least not in professional
environments. Everywhere I've been before, most people worked
most of the time from the shells.

And that "everywhere: is mostly unix-or-like? ;-)

But sure, of course people use shells, what would they. explorer.exe in win
is a shell too. Certainly a single shell hardly good for all tasks, so we
use more than one. I use FAR manager for traditional reasons, to company to
explorer, most people I saw use Total Commander. but there is no
shortage...
And they are there to work -- though during development I'm sure spend most
of the time in an editor.
Where I am now (the first
100% Windows environment for me), it's not so much the case, but
the shells are used for any number of scripts and other things.
And very often, when there's something more complicated that
needs to be done, I can get it done faster from the shell than
the Windows experts can do from the GUI.

Of course. Different tasks ask for different tools. And a professional
development env surely use many stock ustils, and even more homegrown ones
that cover for the usual cases.

Having graphics and mouse is an ability -- not a handcuff that would deny
other ways. TMK "usable without mouse" is still an aim un UI design for
graphic desktops, wherever makes sense. (And is pretty frustrating indeed to
see that some applications did not bother to straighten the tab order or use
duplicate or missing accelerators. What doesn't need a line of code....)

What I was trying to say above in the () is that IME the atomic tools are
not executed directly from the command line all that often. But from more
specific tools.

Eg. I can't recall when I launched pkzip directly the last time. But have a
plenty of "scripts" that use it.
That isn't the issue. In practice, you really only want to do
one thing at an ATM. Developing software requires a large
number of different activities, from designing UML, writing HTML
documentation, writing code, compiling, setting up code reviews,
etc. Some of this is supported by the usual tools, but in
practice, you're almost always doing something a little bit
more than what they offer.

That is the whole point.
Deep inside the machine there sit the atomic elements, maybe that non-quoted
image that is invoked like

atm -withdraw -v:$ -amount:50

but on the face there exist a single button that can be punched to that
effect.

Like on my last unix project, how many times I issued make on command line?
Quite never. There was a script buildPackage, that asked what platform, what
target kind, label, etc, then invoked ant here, make there. How many times
I invoked buildPackage? Again quite never, I fixed it to accept answers from
command line, then has a script 'bp' that issued the params that were fixed.
And for partial builds there was 'm' that issued make in the directory with
some magic arguments and capture the output and filters it and presents me
the errors/warnings at the end.

Also there was a dozen aliases that navigated to the most used
directories -- and you could make the observation of "using the shell all
day" though it was most time sitting there and the history like

cdm
m
m
m
cdvox
bp
cdm
.... repeat ... ;-)

In my vocubulary that part in not the "work".


(I also shall mention my sad observation that some other people got stuck at
the buildPackage level and typing the answer to the 5-6 question every time;
one answer being like XXXX-64-java-linux that could be pasted from the list
of possibilities written to the terminal. And hope the problems stay within
terminal's history range, as redirection does not play with
interactivity...)


Back to the point, IME the *bulk* of the commands issued on command line.
And so could be invoked from something else -- hotkey, menu, button, etc.

All of which is present with a good editor/shell combination
under Unix (or Windows, with bash and gvim). I suppose that you
could call it partially integrated, but if you invoke make from
vim, it will position you on the error.

Will it? Interesting, my people did use vim and didn't have that feature.
Guess it is not out of the box, or is picky to something -- or they were
just ignorant. While those using IDE not really had the option to miss the
auto-navigation to errors.

OTOH, if you have your environment with all those featires, in my vocabulary
it is an IDE. And surely not "just an editor" when it actually invokes
build on one end, and processes the build's output on the other.

And we hopefully adree that professional development needs that kind of
integration, and it brings better productivity compared to really separate
editors that have no feed to or from, and have no clue about usual cases
like the compile-fix-typos cycle and the others.
Plus a lot of other
things. (I find that when restructuring code, I make a lot of
use of :argdo g/.../... for example.)

And why typing :argdo more sexy than ctrl-H (or alt-E R or hitting the
Replace button on the toolbar?)

Actually you can do it even almost that way, as the toolbar box for the
search text can invoke macros, and it is no problem to write a macro that
separates the arguments then invoke replace with the all-open-files
option=yes. Customization only goes 99.5%, so possibly it should look look
like
argdo_g(from/to)

but I'd rather keep a 1-key and try to open the regular dialog with the
option set to all-files, and type in the text. I use that operation way
to rarely to bother about the extra click.
dislike about Visual Studios is that it doesn't support your
third point; it presents a lot of not particularly relevant
information, but still makes it very hard to find the relevant
information.

My experience is different. For very long (in up to 6.0) I mostly used just
the find-in-files (the builtin grep on steroids).

In my last project, that was some 3MLOC monster with every possible and
impossible WTF put together in 15 years, starting with
"no-documentation-figure out from code", I pushed it under VS2008, and
switched to the code-browser facilities. The difference is drastic. (
Like you need all invocations of Foo::process(void) -- hopeless case for
grep )

Still not perfect, and it is really annoying that it does not present some
info it surely knows (i.e. calls of auto-generated funcitions), or that I
can't query the browser database sql-like (or just export it to text to
solve some cheesy questions myself...)

But it is tremendous help, and way superior to anything dumb and "just text"
based.

Also it actually *can* search in the files that belong to the project, as
the IDE knows the fileset -- while non-integrated tools are limited to crude
approach, like directories.

IUC your argdo g/... works on files opened in the editor -- can you do it
for the project's all files? That is just another option seletcion....

We're using subversion, so there is no check-out. I'm not sure
I like this aspect, however. I don't like the fact that I can
accidentally modify a file I happen to be looking at. (Of
course, in vim, I'll open it read only, so there's no problem.

I'm lazy to start VS to check, but for-readonly is traditionally part of the
open interface of programs.

But that is not the mainstream approach -- keep the files with read-only
flag in the filesystem. Then it will not edit, or you get prompted.

VSS works like that.

We used CVS, and I tried a free plugin that integrated it with VS, (Maybe
Iglo-something?) it worked, though I didn't like it. The source control
interface was made wth VSS in mind, and doesn't fit too well with others,
though you might find it so. As 'editors' can be used non-exclusively, and
provide info for the team. The non-free plugin was quite impressive on
its brag-sheet, I didn't try that one.
If Visual Studios has this option, I'm not aware of it.) For
the rest, it's all there from a normal editor and the shell.

If you insist that an editor that reads compiler output like ctags is
'normal'... ;)

To me having a single frame around the whole bunch of editors (like those
for resources) and the debugger is also a gain on productivity.

I'm light on debugger usage, so wouldn't die from separation, but don't see
its virtue. Like DRY in coding. ;-)
Search and replace, for starters. You still have to enter the
regular expression and the replacement text. By the time you've
gotten the dialog box open and your hands back to the keyboard,
I've finished the command.

Huh? What hands back? The box can open on any kind of trigger -- including
keyboard. And starts with the search part prepopulated with text under the
cursor or selected, that is quite usual. And history in the box, that is
the other usual case.

If something bugs me it is redundant typing. May be some fundamental viring
difference in brains -- as in the "fill-the-query" case mentioned above.

But for search I rarely use the full dialog, just the "what" box on the
toolbar (activated by ctrl-D instead of ctrl-F) or even more frequently
ctrl-F3 F3/shift-F3 that captures the selected text or the current word if
no selection. (And selection certainly does not need the mouse either, just
shift...)
When editing (entering text), anything which requires using the
mouse is a minus, since it requires taking your hands away from
the base position on the keyboard.

Yep. Now do you really think that all the zillion users of VS, or
mouse-capable systems in general are all unaware of that? instead of
using the mouse when that fits, and the keyboard otherwise?
(When just browsing, of
course, other rules hold, and I do tend to use the mouse for
most browsing.)

And the wheel is the greatest invention since sliced bread too -- I feel
like maimed ocasionally sitting on a wheel-less mouse.
One frequent operation for me is grepping for every place where
some function is used.

You can do that? How? I couln't figure a method. (unless you mean to find
every place plus all the zillion other places that is not that function call
just a textual match.)

Though the operation is indeed one really important, and I can do it with
the browse info. (that in vs2008 painfully misses to point the place where
the function is not invoked but its address stored. :-( )
Then invoking the editor on just those
files, running through the first modification, memorizing the
keystrokes in a macro as I do, then undoing it, and invoking it
on all of the files I'm editing (and only on those files---with
a bit of care in my original search string, I can only modify
specific uses of my function).

Well, macros are really count as normal function of editor. With VS you
certainly can record at will or write, all the MS palette speaks VBA for
whatever. So beyond editing you can do practically anything.
As above. Or modifying all of the project files (in about
twenty different projects in the solution) in a similar way (but
the modification depends partially on the directory in which the
project file is found).

Well, if the stock "search/replace" in whole project is no player, then
indeed you either go half-manual or write the if-logic into the macro.

but if you can do it in vim I don't see why you couldn't do it just the
same/similar way -- the 'argdo' equivalent is surely more verbose, I'd guess
some foreach in application.documents, but if it is usual task, you write it
once and can call argdo for the rest of life.

Like written on top (no offense) this story reads to me not as whet an IDE
or VS can do, just you know how to do it in X and not (yet) in Y.

Just for completeness' sake, there's no problem to bring your shell to
windows and execute the tasks in your familiar way if the whole run is not
big. After all when the text-editing is done, no one can tell how it got
in the state. (I recall myself using "ms-word for dos" for semi-automated
text reshaping waaaay long, havin a bunch of other editors that also have
macros. The one thing that counts is to do the job with least sweat.
who cares how a one-shot macro or script looked like? ;-)))
 
R

Rui Maciel

Balog said:
Should we also drop using matches and gas lighters and restrict to
"natural" methods of creating fire?

Makefile is certainnly easy to whoever already learned to use it, and does
so for a decade. For novices it just sucks. Especially compared to an IDE
with a project manager -- there all the supposed complexity is using "add
new" menu adding a new item and "add existing" otherwise...

....which means that the newbie ends up not having a clue about what he is in
fact doing or even what he is supposed to do. As a consequence, the newbie is
in effect barred from learning how to program in a certain language, as he is
actually forced to learn how to use a very specific tool (the IDE). That means
that, in his own eyes, he builds up this nonsensical idea that this particular
IDE is somehow the language.

For the other part -- if the aim of learning C++ is not an abstract one,
but to create some useful stuff, starting with an app framework that fits
that aim may be a good idea too.

Starting off with a project is a good suggestion. Nonetheless, suggesting that
the newbie starts off with a automatically generated pile of code, full of cruft
such as platform-specific components and a ton of irrelevant objects floating
around, what in the surface appears to be helping you is in fact damaging your
ability to build up the faintest understanding of what you are doing, what you
should be doing and what is really happening around you. Moreover, it builds up
the false notion of what the programming language is.

You don't get any of that by using a compiler and a text editor. If a newbie
starts off without being burdened by all that needless crap that an IDE imposes
on a user, he will be able to clearly understand what he is doing and what he is
in fact getting from the code he is writing. That is, by far, a richer learning
environment and a far faster way to competency.

It has a fair amount of dangers, but
so does going barefoot for too long.

What do you mean by "going barefoot for too long" ?


Rui Maciel
 
R

Rui Maciel

Balog said:
Please write an example.

How do you start a small command-line app project in your IDE of choice?
Without an IDE you just open a text editor and write:

<code>
int main(void){ return 0; }
</code>

Done. You don't need to click through a set of wizards, you don't need to clean
up any cruft that was automatically generated. You just code away.

If you wish to automate your build process (which you probably want) then, if
you wish to rely on plain old make and use a custom makefile then you only need
to open a text editor and save the following in a file named Makefile:

<code>
all: myapp

myapp:
g++ main.c++ -o main
</code>

Done. And as you wish to have a finer control on your project, the IDE will
become more and more of a bloated nuisance than a solution. You will be
gradually pushed to hunt obscure options in a vast sea of bloated dialogs, all
of which force you to only use the set the options that the people behind the
IDE thought were reasonable, which could easily clash with what you intend to
do.

And do you mean that the excess complexity you are discovering is
something that is genuinely present in beginner's projects, or it is tied
to the project you (as a seasoned expert) were summoned?

I believe it is easy to understand that all the options that the IDE's
interfaces push into the newbie's eyes are a terribly (and needlessly) big
source of confusion. Emphasis on the "needless".

This sounds like your bunch of make experts could manage the build of a
project that was not fit an IDE's idea. And found it easier too -- that is
hardly surprising.

But I don't see how actual easyness follow.

With an IDE you are firmly wedged into what the IDE imposes on you and what the
project templates support. On the other hand, if you rely on a text editor to
write your code then you are perfectly free from those hindrances. You don't
have any weird workflow forced on you and if you need to perform a task then you
are free to use whatever 3rd party app you wish to adopt and which lets you
easily accomplish your task in your own terms. More than that, if meanwhile you
opt to replace some tool then you are also free to do so. You don't have
anything bolted down and, in fact, you are free to fully use your system to your
own advantage.

IMO if you come to production, and any non-trivial project, managing the
build is an expert area in its own right.

If your experience is limited to what is offered by an IDE then it is only
natural that you perceive "managing the build" as being an "expert area in its
own right".


Rui Maciel
 
B

Balog Pal

Rui Maciel said:
How do you start a small command-line app project in your IDE of choice?

New project -> Console app -> 'A hello word application' -> Finish.
Then press F5 and it builds and runs.


I do it quite often.

Without an IDE you just open a text editor and write:

<code>
int main(void){ return 0; }
</code>

Done.

Extreme amoun of redundant typing if you ask me. Ok, I forgot from above to
state the name, but it is common in both versions.
You don't need to click through a set of wizards, you don't need to clean
up any cruft that was automatically generated. You just code away.

There are certainly options for 'empty project' fro those who like type
main. And you can make your own wizard if have a pattern in usual work.
The stock selection in VS IME covers about anything usually done from
scratch.
If you wish to automate your build process (which you probably want) then,
if
you wish to rely on plain old make and use a custom makefile then you only
need
to open a text editor and save the following in a file named Makefile:

<code>
all: myapp

myapp:
g++ main.c++ -o main
</code>

Done.

Is that supposed to win over 0 (as in zero) typing?

Please someone take a little time and finally explain me the vitue of that.

I understand the case where the project is a complex build or has some
special way of tuning, but these cases just beat me. Completely.

(Certainly without IDE a caring person would IMO probably have saved a first
such empty project, and merely unzip it on use, but whatever...)
And as you wish to have a finer control on your project, the IDE will
become more and more of a bloated nuisance than a solution.

Worked for me for the last ~20 years. And on my list of nuicances it is
hardly a contender. (btw all versions before the last had option to export
makefile, so there is not even a lock-in.

If something is a nuicance, solve it. Addressing the specific way. What is
the point of the preemptive strike, to tune the build system for what
believed for version 4.0, when you may never go beyond the first? And pay
up the price up front?
You will be
gradually pushed to hunt obscure options in a vast sea of bloated dialogs,
all
of which force you to only use the set the options that the people behind
the
IDE thought were reasonable, which could easily clash with what you intend
to
do.

You make this up, do you? ;-) If you know the option directly just insert
it in the special field, and it will be used -- and if has representation in
some dialog will appear there by itself.
I believe it is easy to understand that all the options that the IDE's
interfaces push into the newbie's eyes are a terribly (and needlessly) big
source of confusion. Emphasis on the "needless".

Guess those are the kind not taking the Tutorial tour.

I recall doing over the Scribble sample set that explains creating a MFC
application (with fairly fophisticated features too), along with showing
most elements of the IDE used.

All in a very thoughtful, step-by-step way.

Sun's IDE also came with that Freeway sample and tutorial on how to use the
debugger to fix a multi-threaded application, fow to profile, etc

I also encountered very fine books from Wrox tuned for all kind of public.

If a beginner just sits down and expects the IDE magically fill his head
with knowledge, no wonder he gets confused -- I mean he started pretty deep
being that way.
With an IDE you are firmly wedged into what the IDE imposes on you and
what the
project templates support.

What means if your project fits a template -- that it too often does, you're
ahead. Whjen it doesn't you are on the same square as in the alternative.
The empty project is always there. And you can download additional
templates if the case is at least so common -- or capture yours if done
once.
On the other hand, if you rely on a text editor to
write your code then you are perfectly free from those hindrances.

This resembles the argument on how much burden having a million dollar is
compared to being poor. ( Which btw have some ground, but i believe I could
deal with the expected problems ;)
You don't
have any weird workflow forced on you and if you need to perform a task
then you
are free to use whatever 3rd party app you wish to adopt and which lets
you
easily accomplish your task in your own terms.

weird workflow ===> prejudice.

While if the workflow of certain IDE does not match yours, simply chose one
which does, or forget it. Chosing the *fit* tool is part of the
development work.
More than that, if meanwhile you
opt to replace some tool then you are also free to do so. You don't have
anything bolted down and, in fact, you are free to fully use your system
to your
own advantage.

And you can write anything in assembly, why we bother with all the other
languages I wonder. ;-) Why accept restraints instead of having the
absolute freedom and power? O,O
If your experience is limited to what is offered by an IDE then it is only
natural that you perceive "managing the build" as being an "expert area in
its
own right".

I have a huge deal of experience on quite many platform and project sizes --
that statement applies to cases of big and non-trivial projects.

Also spet some time debugging the build -- it is about as easy as find the
real source of a random crash in a big C application (caused by a hidden
race condition or dangling pointer or overrun). Resembles mur black
magic than science ;-)
 
R

red floyd

New project -> Console app -> 'A hello word application' -> Finish.
Then press F5 and it builds and runs.

I do it quite often.

And how is that supposed to help someone learn C++?

[redacted]
Is that supposed to win over 0 (as in zero) typing?

Please someone take a little time and finally explain me the vitue of that.
Again, the idea is to learn the language, not how to use the IDE.
 
R

Rui Maciel

Balog said:
New project -> Console app -> 'A hello word application' -> Finish.
Then press F5 and it builds and runs.


I do it quite often.

Yet, that has absolutely nothing to do with C++ and only brings confusion,
needless confusion, to every newbie that is taking his first steps into
programming.

So, by using an IDE a newbie not only is forced to do more to perform the same
task but he will also end up understanding less. It's pretty much settled what
is the best tool here.

Extreme amoun of redundant typing if you ask me.

What? Typing in a dozen letters is "extreme amount of redundant typing"? How
many LoC do your projects usually carry?

There are certainly options for 'empty project' fro those who like type
main. And you can make your own wizard if have a pattern in usual work.
The stock selection in VS IME covers about anything usually done from
scratch.

Why should anyone waste their time writing wizards if they can perform the same
task faster, easier, cleaner and with greater understanding of what is going on
by just opening a text file and type away the code?

Is that supposed to win over 0 (as in zero) typing?

I don't understand this problem you have with keyboards, particularly when the
subject is none other than programming. If you wish to program you are forced to
use the keyboard and use it extensively. In fact, being forced to move your
hands away from the keyboard is a major hindrance in any programmer's work flow.

So, pointing out large amounts of clicks needed to pass through the multiple
wizards that you must run through in order to start off terribly basic
projects... Well, it doesn't make IDEs look good.

Please someone take a little time and finally explain me the vitue of
that.

You don't understand the virtues of being able to fine-tune your tools in order
to have full control over it and therefore make them work exactly as you want?

I understand the case where the project is a complex build or has some
special way of tuning, but these cases just beat me. Completely.

(Certainly without IDE a caring person would IMO probably have saved a
first such empty project, and merely unzip it on use, but whatever...)

That doesn't make sense, as there are quite a lot of tools which automatically
generate build scripts from the code contained in a source tree. For example,
even the autotools family, which is accused of being hard to use, provides the
autoscan script, which does just that, pain-free.

Worked for me for the last ~20 years. And on my list of nuicances it is
hardly a contender. (btw all versions before the last had option to
export makefile, so there is not even a lock-in.

If all your needs fitted neatly with all the basic features that an IDE usually
offer then congrats. Yet, as soon as you are faced with non-trivial tasks, such
as supporting 3rd party compilers or integrating 3rd party tools into your
project (automatic code generators, for example) then you are suddenly forced
with a usability barrier which is needlessly hard to work around.

On the other hand, if you aren't tied to an IDE and instead rely on a text
editor then, at worse, you can simply edit your Makefile and type in a couple of
additional targets. And you are done. Easy as that.

If something is a nuicance, solve it. Addressing the specific way. What
is the point of the preemptive strike, to tune the build system for what
believed for version 4.0, when you may never go beyond the first? And
pay up the price up front?

What are you talking about?

You make this up, do you? ;-) If you know the option directly just
insert it in the special field, and it will be used -- and if has
representation in some dialog will appear there by itself.

You fail to understand that no one was born knowing how to operate an IDE. That
means that in order to first find out that the "special field" you mention
exists, that person is forced to needlessly comb through piles of documentation
and waste their time waltzing around the IDE's menus and absurd amount of
dialogs. To add insult to injury, that pseudo-skill is rendered useless as soon
as the next IDE is released.

On the other hand, if you rely on a text editor then just open a file and tweak
your option. That's it. You are done.

Guess those are the kind not taking the Tutorial tour.

If what a newbie wants is simply to learn how to write C++ code then why on
earth should he be forced to waste time with tutorials targeting some
application's unending, bloated UI and multitude of features? It appears that
your idea of simplicity carries a heavy burden of unjustified complexity and
extra work.

I recall doing over the Scribble sample set that explains creating a MFC
application (with fairly fophisticated features too), along with showing
most elements of the IDE used.

All in a very thoughtful, step-by-step way.

And yet it got you nowhere in your knowledge of that specific API and you were
forced to waste your time learning how to handle a wizard which, if you are any
serious with your programming projects and your projects are anything beyond the
1k LoC, you only end up doing a handfull of times in a time frame of years.

Sun's IDE also came with that Freeway sample and tutorial on how to use
the debugger to fix a multi-threaded application, fow to profile, etc

That's irrelevant, as debugging isn't an exclusive domain of the IDE.

If a beginner just sits down and expects the IDE magically fill his head
with knowledge, no wonder he gets confused -- I mean he started pretty
deep being that way.

Unfortunately that is a problem which the IDE imposes on everyone, not only
newbies. If you are expected to do anything with an IDE then you are forced to
waste your time learning how to use it instead of just writing the damn code.
If, instead, you use a text editor then you just open it and code away. There
is no bloat, there are no irrelevant, distracting, useless features which end up
doing more harm than good. It's just you and the text file. And that means
being far more productive.

What means if your project fits a template -- that it too often does,
you're ahead. Whjen it doesn't you are on the same square as in the
alternative.

No, that means that if you only need to do simple, straight forward projects
then you start, at best, at the same level as if you hadn't picked an IDE to
begin with and picked a text editor instead.

Yet, you don't have any freedom, as you are kept firmly wedged between what the
IDE supports and what the IDE forces you to avoid. So if meanwhile you find
your project in need for some tool or feature which your IDE doesn't support...
Well, you are screwed. That doesn't happen if you don't work with IDEs.

The empty project is always there. And you can download additional
templates if the case is at least so common -- or capture yours if done
once.

I don't believe that being forced to waste time to try to figure a way to force
your IDE to do anything that it wasn't built to do does anyone any good. It's
still your IDE burdening you with extra work which you shouldn't be doing to
begin with and you would easily avoid by using a text editor.


This resembles the argument on how much burden having a million dollar is
compared to being poor. ( Which btw have some ground, but i believe I
could deal with the expected problems ;)

No, it's the burden of being forced to do far more to accomplish less.

weird workflow ===> prejudice.

While if the workflow of certain IDE does not match yours, simply chose
one
which does, or forget it. Chosing the *fit* tool is part of the
development work.

So you not only advocate that a person should waste their time by learning how
to work with a piece of software which pretty much ends up making you work less
efficiently but, if that wasn't enough, you also suggest that a person, on top
of that, should waste even more time learning how to work with multiple software
packages just to be able to chose one among them. And, keeping in mind the
subject of this discussion, you suggest that a person should waste all that time
doing all that as a prerequisite to simply learn how to program.

That, compared to just picking up pretty much any text editor and just hack
away.

And using an IDE is supposed to do what? Save you time? It doesn't look like
it.

And you can write anything in assembly, why we bother with all the other
languages I wonder. ;-) Why accept restraints instead of having the
absolute freedom and power? O,O

That doesn't make any sense.

I have a huge deal of experience on quite many platform and project sizes
-- that statement applies to cases of big and non-trivial projects.

Also spet some time debugging the build -- it is about as easy as find the
real source of a random crash in a big C application (caused by a hidden
race condition or dangling pointer or overrun). Resembles mur black
magic than science ;-)

And why is this relevant?


Rui Maciel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,074
Latest member
StanleyFra

Latest Threads

Top