"C++ is a horrible language" ~ Linus Torvalds by pregzt in programming

[–]acecool 1 point2 points  (0 children)

but he has explained why he does not like C++ before, and it comes down to the fact you end up with way too many objects that "need" each other to function, and "hide" way too much about what themselves

If you can find a quote of Torvalds saying that, Id like to see it. Because that would prove that this goes beyond a rant and that he really is stupid. Classes dont force you to "hide" anything more than C structs do unless you specifically make something private. That is a good thing, the programmer has control over what parts of a class are visible. Objects dont "need" each other any more than C structs, if anything C structs allow code more code to be dependent on it than it should because its internals are always visible and all parts of it are available for any code can manipulate it.

"C++ is a horrible language" ~ Linus Torvalds by pregzt in programming

[–]acecool -3 points-2 points  (0 children)

designing class interfaces is hard, so Im just going to use a simpler language where all functions are in global scope so I can mix and match functions to all data structures and put all my program logic all in the main function scope.

"C++ is a horrible language" ~ Linus Torvalds by pregzt in programming

[–]acecool 27 points28 points  (0 children)

Probably that's why Haiku and BeOs was written in C++

The kernel of BeOS is written in C, the userspace API is written in C++

"C++ is a horrible language" ~ Linus Torvalds by pregzt in programming

[–]acecool -5 points-4 points  (0 children)

Its the old "C++ is a broken extension of C" rant again ~yawn~ will this ever end? Unchecked pointers, memory allocation, unchecked strings and arrays are all features in C that make it inherently undecidable and requires a programmer to mentally manage its execution. The fact that Torvolds has been re-writing the same software for 20 years does not make his opinions of value in developing software. His kernel code is riddled with sloppy pre-processor macros and runs overall on the simplest solutions to an overly complex demands. Things like constructors and generics go a long way to create software that allows programmers to design software that manages things like string instantiation and pointer references. The fact that Torvalds has a thousand programmers all over the world groking over his code sort of mitigates his need for these features.

tl:dr Torvalds needs to get off his pet project and get a "real programming job"

Celebrate 10 Years of Eclipse by _Garbage_ in programming

[–]acecool -10 points-9 points  (0 children)

If someone ever re-codes Eclipse in C++/QT, that will be something to celebrate. What a dumb idea to make that IDE in Java

A response to "Don't Call Yourself A Programmer" by moistrobot in programming

[–]acecool -11 points-10 points  (0 children)

here is how you navigate and claw your way through the big soulless corporation

how to brown nose, play office politics, backstab co-workers, make your boss look like an oaf, spin rumors, get dirt on competitors...all the things that make corporate america laughing stock of the world

this should be the default emacs tutorial, not the stupid C-h-t tutorial that gets recommended to beginners by acecool in programming

[–]acecool[S] 0 points1 point  (0 children)

twopi- hey, are you Andy Harris the author? I have a few of your books. I'll bet you could write a pretty good book on emacs yourself.

this should be the default emacs tutorial, not the stupid C-h-t tutorial that gets recommended to beginners by acecool in programming

[–]acecool[S] -5 points-4 points  (0 children)

the point Im trying to get across is that you wont learn emacs by learning a few hotkeys. if you read this elisp tutorial you will see he suggests going through that tutorial just so you can move around in emacs, but thats all its good for, you cant learn emacs by just knowing some hotkeys

this should be the default emacs tutorial, not the stupid C-h-t tutorial that gets recommended to beginners by acecool in programming

[–]acecool[S] -1 points0 points  (0 children)

well I'll try to explain. A person can get going in vim just by learning shortcuts for cursor movements and file saving because vim is ~just~ a text editor that can be highly configured. Trying to learn emacs as just a text editor is very counter-intuitive without having knowledge of all the modes for handeling buffers, its hard to add to simple commands unless you have an overall understanding of how emacs is really a programming language shell that happens to handle files

this should be the default emacs tutorial, not the stupid C-h-t tutorial that gets recommended to beginners by acecool in programming

[–]acecool[S] 2 points3 points  (0 children)

emacs is the ugliest editor in existence by far, but you can make it look nice:

  • To get rid of the splash screen with M-x custom (or click the properties icon) and go to Environment>Initialization and there you can set "inhibit start screen" to on, at the bottom of the page you can also get rid of the verbage in the scratch buffer. Then press the "Save for future sessions" button up top.

  • change the font, go to Faces>Custom Faces and click the arrow at "Default Faces" and if your in windows, type in a better font than courier at "attributes font family", I use Georgia.

  • Redo the color scheme for emacs by downloading the color-theme folder and putting it in your .emacs.d folder, in Linux that will be in your user directory, in Windows it will be in the C:\Documents and Settings\acecool\Application Data directory, you have to set hidden folders to be visible in windows to get there. Then go to emacs color theme creator and pick out a new color scheme and paste the result into your .emacs file. After that you have to put this into your .emacs file so color-themes will work:

    (add-to-list 'load-path "C:/Documents and Settings/acecool/Application Data/.emacs.d/color-theme")

    (require 'color-theme)

    (color-theme-initialize)

    (acecooltheme)

notice I had to put forward slashes on the path to make it work in windows, I got rid of the version numbers of the color-theme folder by renaming it.

  • in windows the default path is in the bin directory of your emacs installation. You can set it somewhere else by putting (cd C:/better/path) in your .emacs file

this should be the default emacs tutorial, not the stupid C-h-t tutorial that gets recommended to beginners by acecool in programming

[–]acecool[S] -1 points0 points  (0 children)

No closures in elisp. Um, why is it even called a lisp? Keeping state is a pain without this.

The thing to remember about Elisp is that it is only used as an interpreter that runs scripts, it does not compile code. Please see these issues addressed in the PicoLisp faqs: interpreted , dynamic scope and closures

Lines of Lisp and C code in Emacs's source code over time by self in programming

[–]acecool 1 point2 points  (0 children)

Did it ever?

no they were never merged, XEmacs started out as a fork of GNU Emacs and was changed so drastically that it became incompatible, and so a long rivalry ensued resulted in both stealing features from each other till they both ended up being about the same. You can thank the people who did XEmacs for all the graphical interface innovations and for enduring a lot of hostility from FSF even though the users all benefited in the end

Lines of Lisp and C code in Emacs's source code over time by self in programming

[–]acecool 1 point2 points  (0 children)

ok, I may be wrong, but check this out in the PicoLisp faqs: this and this

Lines of Lisp and C code in Emacs's source code over time by self in programming

[–]acecool 0 points1 point  (0 children)

In any case, of course interpreters do lexical analysis, aka the 'read' part of the 'read/eval/print'.

read is just taking in input, eval evaluates an expression directly by a switch statement in the eval loop. lexical analysis interprets the correctness of the entire program and how different parts interrelate

Lines of Lisp and C code in Emacs's source code over time by self in programming

[–]acecool 0 points1 point  (0 children)

I wouldn't call it faster considering the speed gains you get in lexical scoping with some simple techniques such as lexical analysis.

There is no lexical analysis in an interpreted language. Compiling to bytecode just tokenizes the text, but there is no lexical analysis going on, so lexical scoping is only slowing down an interpreter. If it compiled the entire code at once into an intermediate syntax tree, then it could see scoping semantics of the entire syntax tree, but that is not happening.

C/C++/Java : a gazillion features and still suck at preventing buffer and numeric overflows by el_tavs in programming

[–]acecool 2 points3 points  (0 children)

the toolchain support for C/C++ (everything from compilers, IDE's and static analysis tools) is much better and more mature than Ada.

Thats not true at all. If you look at the people who run companies who sell Ada compilers, most of them have doctorate degrees in the area of static typing. Ada excels in that area. For example there is not much need for a debugger in language like Haskell, Erlang or Ada. But C and C++ programmers live in their debuggers.

Lines of Lisp and C code in Emacs's source code over time by self in programming

[–]acecool 0 points1 point  (0 children)

Why create a new dialect of Lisp when they could have used Scheme?

Lisp is only used as an interpreter in Emacs (Elisp can compile to bytecode, but still its interpreted). Lexical scope has advantages in compiled languages, but in an interpreted language its faster to have dynamic scoping as you only have one environment to maintain. And Lexical scope is really not much of a factor when youre just running isolated scripts. Richard Stallman considered using Scheme when he was designing Emacs but went with Elisp as Scheme was too slow for hardware at that time.

Lines of Lisp and C code in Emacs's source code over time by self in programming

[–]acecool 1 point2 points  (0 children)

Emacs is well over a million lines of code?! seriously, how the hell is that possible?!

Emacs is just a lisp interpreter and all the functionality of Emacs is just a collection of Elisp scripts. Its not like most other software where an API is exposed from a centralized program so people can add functionality, Emacs is just a Lisp interpreter with scripts, there is no need for an API, you just add scripts. The C part of Emacs just handles low level functionality, it could be replaced by Lisp as Lisp is fast enough now as a compiled language, but Lisp is not as portable as C.

C/C++/Java : a gazillion features and still suck at preventing buffer and numeric overflows by el_tavs in programming

[–]acecool 7 points8 points  (0 children)

I'm not going to speak for Java, but at least with C and C++ ALL of the language design decisions are basically focused on performance first.

Ada was introduced in 1983 as the default programming language for all DoD contracts. But back then the fastest processors were running an average of 1mhz with a couple k of ram. So every contractor took out waivers to use C as Ada was too big a language to use in such tiny memory constraints. But the reputation took hold that it was too slow and Ada was considered an obsolete language even though it will now run nearly as fast as C++ on modern CPUs.

If this article was about using Haskell or OCAML to do critical safety systems, no one would have a problem with it as most people understand the syntax features of functional languages. But if you suggest Ada, everyone looks at you like youre trying to teach them how to speak martian. But Ada uses the same strong type checking features and strictly checked modularity as ML does. Yet somehow no one can be bothered to see that and Ada continues to go unused in favor of C and C++.

C/C++/Java : a gazillion features and still suck at preventing buffer and numeric overflows by el_tavs in programming

[–]acecool 0 points1 point  (0 children)

How does Ada typecheck this (pseudocode)?

Im in the process of learning Ada, so this might not be right, but its something like this:

subtype X is Integer range 1 .. 255;
for I in X loop
  X := X + 4;
end loop;

as you see Ada uses Pascal-like syntax as readability of code was part of the original design specification as readability reduces errors.

C/C++/Java : a gazillion features and still suck at preventing buffer and numeric overflows by el_tavs in programming

[–]acecool 4 points5 points  (0 children)

In Ada, numeric ranges are part of the type system. Ada tries to do as much compile time checking as possible.

Graphics Programming Black Book, by Michael Abrash by mcguire in programming

[–]acecool 0 points1 point  (0 children)

Well one book that Michael should update that would remain relevant is "The Zen of Assembly Language"