POV-Ray : Newsgroups : povray.off-topic : Teach yourself C++ in 21 days : Re: Teach yourself C++ in 21 strange malfunctions Server Time
29 Jul 2024 18:23:37 EDT (-0400)
  Re: Teach yourself C++ in 21 strange malfunctions  
From: nemesis
Date: 18 Apr 2012 18:18:41
Message: <4f8f3dc1$1@news.povray.org>
Invisible escreveu:
>> IDEs are only really useful for OO languages.
> 
> I do not agree.
> 
>> You know, you have a
>> variable holding an instance of a class, then you type "." and get a
>> list of methods available... no such thing in functional programming
>> where the order is reversed: you have a function and want to apply
>> arguments to it. You may list arguments that match that function
>> definition and you may even know their types (assuming "intellisense"
>> got type inference), but most likely you're not directly applying those
>> arguments to the function, but applying some other function to it first.
>> It sounds too much of hassle to use "intellisense" in those situations...
> 
> Did you know that there's a program called Djinn which can take any 
> Haskell type signature and generate Haskell source code for it, if it's 
> possible to write it without recursion?
> 
> Of course, there's usually more than one possible expression for a given 
> type signature. So the code you get may well not be the code you 
> actually wanted. But still, it's interesting that just a type signature 
> is sometimes enough to generate useful, runnable code. (Try doing /that/ 
> in a normal programming language...)

AFAIK, the hindley-milner type system is turing complete, so it's not 
surprising at all.  So, if you want you may indeed just provide 
mind-boggling complex types and let djinn extract the program behaviour 
from that, just as a C++ programmer can go overkill and write with 
templates a compile-time lisp interpreter and run factorial 100 on it 
and just output 
93326215443944152681699238856266700490715968264381621468592963895217599993229915608941463976156518286253697920827223758251185210916864000000000000000000000000

at run-time.

It's all feasible, just not very useful.

>> I fear IDEs are really only useful at getting away with lesser
>> languages' weaknesses
>>
>> so, all that would seem to rest of usefulness for an IDE is project
>> management.
> 
> I do not agree.
> 
> Consider the things that a typical IDE does:
> 
> - Syntax highlighting. Bracket pairing.
> 
> - Generate parts of an expression as you type. (E.g., generate the 
> matching close bracket, generate the "then" and "else" keywords when you 
> type "if".)

all common features of the most featureless text editors out there 
besides scumbag notepad.

> - Highlight any syntax errors, mismatched brackets, unused variables.

that requires a bit more working, specially unused variables. 
Mismatched brackets is a (mis)feature of languages that are not lisp. ;)

> - Allow you to compile the whole project with one keypress.

that's only useful for languages still in the old edit-compile-test 
cycle... ;)

in any case, even humble C can do that, provided a Makefile is ready. 
heck, Makefiles are language-agnostic even...

> - Highlight the line of source code that the compiler is complaining about.

emacs and vim both allow that kind of integration with external tools 
such as compilers... I'm sure other featureful text editors too.

> - Display a summary of what entities are defined in each file, what 
> their types are, whether they're public or private, etc.

For C/C++ that's as easy as simply taking a look at each header file. :)

> - Let you navigate to each entity in the list.

ever heard of exhuberant C-tags?  I'm sure it got support for haskell 
too, and is such a tool that generates for a codebase a tags file and 
lets you navigate through source code using those tags.  Support for it 
in both emacs and vim at least.

> - Run the document extraction tool.

what's wrong with man? ;)

> - Take you to the documentation for a given entity (regardless of 
> whether its in your project or an installed 3rd party library).
> 
> - Easily launch your application.

like ./out ?

> - Run your test suite and log the results.

like ./test > log.txt ?

> - Integrate with your source control system. Show interactive diffs. 
> Show the history tree. Manage commits and reverts and branches.

well, I'm stopping now.  It's clear you're just a button masher who 
enjoys mashing buttons than simply harnessing from an integrated textual 
development environment.

> - Integrate with the debugger. Let you single-step through your code. 
> Let you create watches, inspect variables in scope, drill down through 
> complex data structures.

you are not even talking like a haskeller anymore!  Is there such a 
haskell debugger?  Last time I heard, debugging and lazy evaluation were 
at odds...

> Tell me, how do any of these things stop being useful if your 
> programming language isn't object-oriented?

They are all very useful and none requiring a bloated and costly IDE. 
Intellisense is the only really thing useful in such IDEs, and, like I 
said, it's only really useful for OO languages.


Post a reply to this message

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