POV-Ray : Newsgroups : povray.off-topic : Teach yourself C++ in 21 days Server Time
30 Jul 2024 04:14:07 EDT (-0400)
  Teach yourself C++ in 21 days (Message 59 to 68 of 168)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>
From: Francois Labreque
Subject: Re: Teach yourself C++ in 21 strange malfunctions
Date: 19 Apr 2012 09:00:44
Message: <4f900c7c$1@news.povray.org>

>> in any case, even humble C can do that, provided a Makefile is ready.
>> heck, Makefiles are language-agnostic even...
>
> Makefiles only work on Unix. :-P But hey, you can write a simple script
> to build your project under Windows.

WAT?

http://gnuwin32.sourceforge.net/packages/make.htm
http://msdn.microsoft.com/en-us/library/dd9y37ha%28VS.71%29.aspx

>
> The /real/ problem, of course, is that you have to open a command
> window, CD to the right folder, and type in "make program1" or whatever.
> This takes significantly longer than pressing F7 (or whatever).
>

Which you only have to do once... After that you only need to hit 
ALT-TAB and the up arrow.

> Heck, KDevelop lets you have the terminal window embedded right there in
> the text editor, and it /still/ takes longer switching back and forth
> between windows than it would to just jab a key.
>

Starting notepad++ and a command prompt take significantly less time 
than starting any IDE.  So you still have quite a few 
"F7-is-faster-than-alt-tab" to do before you catch up...

>>> - Easily launch your application.
>>
>> like ./out ?
>
> Sure, once you take your hands off the keyboard and onto the mouse to
> switch from the text editor window to the command prompt window. :-P
>

As mentioned previously,  ALT-TAB.  Much faster - and a lot easier on 
your elbow and shoulder tendons - than lifting your right hand going 
over the numeric keypad and using the mouse.


-- 
/*Francois Labreque*/#local a=x+y;#local b=x+a;#local c=a+b;#macro P(F//
/*    flabreque    */L)polygon{5,F,F+z,L+z,L,F pigment{rgb 9}}#end union
/*        @        */{P(0,a)P(a,b)P(b,c)P(2*a,2*b)P(2*b,b+c)P(b+c,<2,3>)
/*   gmail.com     */}camera{orthographic location<6,1.25,-6>look_at a }


Post a reply to this message

From: Invisible
Subject: Re: Teach yourself C++ in 21 strange malfunctions
Date: 19 Apr 2012 09:21:54
Message: <4f901172$1@news.povray.org>
>>> in any case, even humble C can do that, provided a Makefile is ready.
>>> heck, Makefiles are language-agnostic even...
>>
>> Makefiles only work on Unix. :-P But hey, you can write a simple script
>> to build your project under Windows.
>
> WAT?

To tell you the truth, I don't even /like/ Make all that much. (I think 
it's the tab characters. Or the slightly clunky way it deals with 
targets that aren't files.) I only really use it for building C, because 
it's either that or work out how to invoke the compiler manually...

But as I say, a tiny amount of shell scripting will automate most tasks, 
without the need for Make.

>> The /real/ problem, of course, is that you have to open a command
>> window, CD to the right folder, and type in "make program1" or whatever.
>> This takes significantly longer than pressing F7 (or whatever).
>
> Which you only have to do once... After that you only need to hit
> ALT-TAB and the up arrow.

That works great - /until/ your command history has more than one 
command in it. E.g., if you use the same window to run the compiler, run 
the main program, and control your SCM. Then you end up jabbing up-arrow 
endlessly, or executing the wrong command, or both. Very annoying.

(I wonder why nobody has yet thought of making an editor where you can 
add buttons to the toolbar and kind arbitrary commands to them? You 
could even give them keyboard shortcuts...)

> Starting notepad++ and a command prompt take significantly less time
> than starting any IDE.

Depends on the IDE. Some are slower than others. I do take your point 
though - some of them do take an absurd amount of time to start. Then 
again, "you only do that once". :-P

>> Sure, once you take your hands off the keyboard and onto the mouse to
>> switch from the text editor window to the command prompt window. :-P
>>
>
> As mentioned previously, ALT-TAB. Much faster.

And if in the middle of your coding session, you quickly switch to your 
email client to check something, next time you try to use Alt+Tab, it 
takes you to the wrong window.

It sounds trivial, but it's really very, very annoying.

(It becomes even more fun when what you're working on involves more 
windows. E.g., right now I'm writing some TeX, so I have my text editor 
open, my command window open, and my DVI window open. You can 100% 
guarantee that almost every time I change window I change to the wrong 
one...)


Post a reply to this message

From: nemesis
Subject: Re: Teach yourself C++ in 21 strange malfunctions
Date: 19 Apr 2012 13:08:09
Message: <4f904679@news.povray.org>
Francois Labreque escreveu:

>>> in any case, even humble C can do that, provided a Makefile is ready.
>>> heck, Makefiles are language-agnostic even...
>>
>> Makefiles only work on Unix. :-P But hey, you can write a simple script
>> to build your project under Windows.
> 
> WAT?
> 
> http://gnuwin32.sourceforge.net/packages/make.htm
> http://msdn.microsoft.com/en-us/library/dd9y37ha%28VS.71%29.aspx
> 
>>
>> The /real/ problem, of course, is that you have to open a command
>> window, CD to the right folder, and type in "make program1" or whatever.
>> This takes significantly longer than pressing F7 (or whatever).
>>
> 
> Which you only have to do once... After that you only need to hit 
> ALT-TAB and the up arrow.
> 
>> Heck, KDevelop lets you have the terminal window embedded right there in
>> the text editor, and it /still/ takes longer switching back and forth
>> between windows than it would to just jab a key.
>>
> 
> Starting notepad++ and a command prompt take significantly less time 
> than starting any IDE.  So you still have quite a few 
> "F7-is-faster-than-alt-tab" to do before you catch up...
> 
>>>> - Easily launch your application.
>>>
>>> like ./out ?
>>
>> Sure, once you take your hands off the keyboard and onto the mouse to
>> switch from the text editor window to the command prompt window. :-P
>>
> 
> As mentioned previously,  ALT-TAB.  Much faster - and a lot easier on 
> your elbow and shoulder tendons - than lifting your right hand going 
> over the numeric keypad and using the mouse.

thank you ?)


Post a reply to this message

From: nemesis
Subject: Re: Teach yourself C++ in 21 strange malfunctions
Date: 19 Apr 2012 13:14:29
Message: <4f9047f5@news.povray.org>
Invisible escreveu:
> But as I say, a tiny amount of shell scripting will automate most tasks, 
> without the need for Make.

yes.  It's easy to rewrite Make from scratch for your every projects.

BTW, do your scripts handle automatic compilation of only the parts that 
were last updated?

> That works great - /until/ your command history has more than one 
> command in it. E.g., if you use the same window to run the compiler, run 
> the main program, and control your SCM. Then you end up jabbing up-arrow 
> endlessly, or executing the wrong command, or both. Very annoying.

ctrl+Rghc
ctrl+Rmain
etc

oh, sorry.  Forgot you use a lameass DOS command prompt...

> (I wonder why nobody has yet thought of making an editor where you can 
> add buttons to the toolbar and kind arbitrary commands to them? You 
> could even give them keyboard shortcuts...)

emacs can do that.  And any decent text editor allows you to bind some 
keyboard shortcut to some command.

>>> Sure, once you take your hands off the keyboard and onto the mouse to
>>> switch from the text editor window to the command prompt window. :-P
>>>
>>
>> As mentioned previously, ALT-TAB. Much faster.
> 
> And if in the middle of your coding session, you quickly switch to your 
> email client to check something, next time you try to use Alt+Tab, it 
> takes you to the wrong window.

it`s much easier when you it all on the command-line. ;)

-- 
a game sig: http://tinyurl.com/d3rxz9


Post a reply to this message

From: Orchid Win7 v1
Subject: Re: Teach yourself C++ in 21 strange malfunctions
Date: 19 Apr 2012 15:10:47
Message: <4f906337$1@news.povray.org>
On 19/04/2012 06:14 PM, nemesis wrote:
> Invisible escreveu:
>> But as I say, a tiny amount of shell scripting will automate most
>> tasks, without the need for Make.
>
> yes. It's easy to rewrite Make from scratch for your every projects.
>
> BTW, do your scripts handle automatic compilation of only the parts that
> were last updated?

No, my compiler does that. :-P

Besides, compiling the entire thing takes less than 400 ms. Why would I 
care about speeding up compilation?

> oh, sorry. Forgot you use a lameass DOS command prompt...

There's a DOS command prompt that /isn't/ lame?

>> (I wonder why nobody has yet thought of making an editor where you can
>> add buttons to the toolbar and kind arbitrary commands to them? You
>> could even give them keyboard shortcuts...)
>
> emacs can do that.

Emacs doesn't even have a GUI yet. :-P

> And any decent text editor allows you to bind some
> keyboard shortcut to some command.

I've yet to find one, but OK.

>>> As mentioned previously, ALT-TAB. Much faster.
>>
>> And if in the middle of your coding session, you quickly switch to
>> your email client to check something, next time you try to use
>> Alt+Tab, it takes you to the wrong window.
>
> it`s much easier when you it all on the command-line. ;)

Yeah. That way you can't look at more than one file at once. Oh, wait...


Post a reply to this message

From: nemesis
Subject: Re: Teach yourself C++ in 21 strange malfunctions
Date: 19 Apr 2012 15:32:29
Message: <4f90684d@news.povray.org>
Orchid Win7 v1 escreveu:
> On 19/04/2012 06:14 PM, nemesis wrote:
>> BTW, do your scripts handle automatic compilation of only the parts that
>> were last updated?
> 
> No, my compiler does that. :-P

so, all your programs are some monolithic piece of software with all 
parts compiled in one go?

>> oh, sorry. Forgot you use a lameass DOS command prompt...
> 
> There's a DOS command prompt that /isn't/ lame?

No, but there's at least powershell, which is lame *and* heavy.

>>> (I wonder why nobody has yet thought of making an editor where you can
>>> add buttons to the toolbar and kind arbitrary commands to them? You
>>> could even give them keyboard shortcuts...)
>>
>> emacs can do that.
> 
> Emacs doesn't even have a GUI yet. :-P

it's GUI is useful enough to have buttons per-mode and to write a web 
browser for.

>> And any decent text editor allows you to bind some
>> keyboard shortcut to some command.
> 
> I've yet to find one, but OK.

you should look at any editor aside notepad.

>> it`s much easier when you it all on the command-line. ;)
> 
> Yeah. That way you can't look at more than one file at once. Oh, wait...

you're nuts.  Any decent editor has support for several file buffers. 
You may navigate them through with file buffer lists or tag files...

-- 
a game sig: http://tinyurl.com/d3rxz9


Post a reply to this message

From: Orchid Win7 v1
Subject: Re: Teach yourself C++ in 21 strange malfunctions
Date: 19 Apr 2012 15:56:16
Message: <4f906de0$1@news.povray.org>
>>> BTW, do your scripts handle automatic compilation of only the parts that
>>> were last updated?
>>
>> No, my compiler does that. :-P
>
> so, all your programs are some monolithic piece of software with all
> parts compiled in one go?

Yes. Why?

>>> And any decent text editor allows you to bind some
>>> keyboard shortcut to some command.
>>
>> I've yet to find one, but OK.
>
> you should look at any editor aside notepad.

To be fair, SciTE allows you to define what F5, F7 and Ctrl+F7 do. (But 
only once per file-extension.) Sadly it doesn't let you do "when I press 
F7, compile THAT file, not the file I'm currently editing".

>>> it`s much easier when you it all on the command-line. ;)
>>
>> Yeah. That way you can't look at more than one file at once. Oh, wait...
>
> you're nuts. Any decent editor has support for several file buffers.

Any decent GUI-mode text editor, yes. On the a text terminal, you can't 
do that.

(Correction: Emacs can do it. And it looks awful.)


Post a reply to this message

From: Orchid Win7 v1
Subject: Re: Day 6
Date: 19 Apr 2012 16:23:11
Message: <4f90742f$1@news.povray.org>
On 18/04/2012 12:17 PM, Warp wrote:

>    If you want to read something actually useful about C++, try the
> "Effective" book series by Scott Meyers (or at the very least "Effective
> C++" and "More Effective C++"). They actually contain some competent and
> easy to understand information.
>
>    "Effetive STL" is probably also good.

I had a look at Effective C++ on Amazon. They let you look at a handful 
of pages before you buy it. By doing so, I already learned more about 
C++ in a few pages than anything the naff book I'm currently reading 
taught me.

On the other hand, it appears to be aimed at people who already know the 
C++ language. That isn't really me, yet. I know some of the syntax, but 
certainly not all of it, or what all of it actually does.

I'll see what kind of prices I can find for it...


Post a reply to this message

From: nemesis
Subject: Re: Teach yourself C++ in 21 strange malfunctions
Date: 19 Apr 2012 16:31:36
Message: <4f907628@news.povray.org>
Orchid Win7 v1 escreveu:
>>>> BTW, do your scripts handle automatic compilation of only the parts 
>>>> that
>>>> were last updated?
>>>
>>> No, my compiler does that. :-P
>>
>> so, all your programs are some monolithic piece of software with all
>> parts compiled in one go?
> 
> Yes. Why?

because it's both wrong and dumb.

>>>> And any decent text editor allows you to bind some
>>>> keyboard shortcut to some command.
>>>
>>> I've yet to find one, but OK.
>>
>> you should look at any editor aside notepad.
> 
> To be fair, SciTE allows you to define what F5, F7 and Ctrl+F7 do. (But 
> only once per file-extension.) Sadly it doesn't let you do "when I press 
> F7, compile THAT file, not the file I'm currently editing".

yeah, while we're at it, it should also guess that THAT file is the 
right file you have in mind...

>>>> it`s much easier when you it all on the command-line. ;)
>>>
>>> Yeah. That way you can't look at more than one file at once. Oh, wait...
>>
>> you're nuts. Any decent editor has support for several file buffers.
> 
> Any decent GUI-mode text editor, yes. On the a text terminal, you can't 
> do that.
> 
> (Correction: Emacs can do it. And it looks awful.)

emacs, vi, pico etc...

it may look awful, but it behaves great.  Ever heard "don't judge a book 
by its cover"?


Post a reply to this message

From: Orchid Win7 v1
Subject: Re: Teach yourself C++ in 21 strange malfunctions
Date: 19 Apr 2012 16:54:07
Message: <4f907b6f$1@news.povray.org>
>>> so, all your programs are some monolithic piece of software with all
>>> parts compiled in one go?
>>
>> Yes. Why?
>
> because it's both wrong and dumb.

That's right up there with saying that Haskell is better than C because 
C is both wrong and dumb. Yeah, it's true, but it won't convince anybody...

>>> you should look at any editor aside notepad.
>>
>> To be fair, SciTE allows you to define what F5, F7 and Ctrl+F7 do.
>> (But only once per file-extension.) Sadly it doesn't let you do "when
>> I press F7, compile THAT file, not the file I'm currently editing".
>
> yeah, while we're at it, it should also guess that THAT file is the
> right file you have in mind...

How hard would it be to allow each directory to contain a file saying 
what commands each key should be bound to? Or a text box to let you 
change it just for this session? Or *something*...

>>> you're nuts. Any decent editor has support for several file buffers.
>>
>> Any decent GUI-mode text editor, yes. On the a text terminal, you
>> can't do that.
>>
>> (Correction: Emacs can do it. And it looks awful.)
>
> emacs, vi, pico etc...
>
> it may look awful, but it behaves great. Ever heard "don't judge a book
> by its cover"?

The whole point of a text editor is for looking at text. Why make it 
look awful when you can make it look good? Why make your job harder when 
you can make it easier?


Post a reply to this message

<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.