[ / / / / / / / / / / / / / ] [ dir / acme / agatha2 / arepa / fast / general / pe / s / vichan ][Options][ watchlist ]

/tech/ - Technology

You can now write text to your AI-generated image at https://aiproto.com It is currently free to use for Proto members.
Email
Comment *
File
Select/drop/paste files here
Password (Randomized for file and post deletion; you may also set your own.)
* = required field[▶ Show post options & limits]
Confused? See the FAQ.
Expand all images

File (hide): 7086d646ed9c283⋯.jpg (57.75 KB, 715x694, 715:694, you can't.jpg) (h) (u)

[–]

 No.989281>>989283 >>989286 [Watch Thread][Show All Posts]

It seems like this is the right place to ask this question.

What is the best and effective programming language that can make computer programs and will still be useful in like 20 years?

Asking because I want to make some programs and do something better with my life.

 No.989283>>989284

>>989281 (OP)

>best and effective programming language

just about anyth--

>will still be useful in like 20 years

C or Common Lisp.


 No.989284>>989285 >>989286 >>989297

>>989283

Are these languages complicated and difficult to learn?


 No.989285>>989288

>>989284

yes, but in different ways. With C, the difficulty is with doing it correctly and with correcting your mistakes, but you'll learn the language very quickly. With CL, the difficulty is the size of the language--there's just a lot to learn, but what you learn doesn't have edges as sharp as C's.

Neither is that hard though. Just get few good tutorials, get on IRC, and slog through the learning curve. We're not talking FP, Prolog, or dependent typing.


 No.989286>>989288 >>989377

>>989281 (OP)

>and will still be useful in like 20 years?

C, and probably C++. When using C make sure you use C99 with its properly define integer sizes like uint16_t for fixed-size integers, rather than assuming that a short will always be 16 bits large or something like that.

C has its flaws, lots of them, but it is well understood, time-tested, it can run on your toaster and every language can use C libraries. It's the universal high-level language for better or for worse and it's what we are stuck with.

>>989284

C and Common Lisp have very opposite ideas of how a program should be written. C is fairly small and close to the machine, you could read through K&R in about a week if you already know the basic ideas of programming. Mastering C on the other hand takes practice, it is a language that allows you to do stupid things and will follow your orders. Also beware of undefined behavior, just because something works for you that doesn't mean it must work for others.

Common Lisp is a huge language with an ancient legacy. To understand why it is the way it is you have to image a whole bunch of mutually incompatible Lisp languages. Then try to make a Lisp that has features from each one of them, some features of its own, and it tries to make porting from all those Lisps to Common Lisp easy. You get one of the ugliest and most powerful languages ever.

It takes longer to learn due to its size, but once you get a grip on it you will have a massive powertool which lets you make your own powertools on top of power tools. The syntax is weird, it uses prefix notation, but once you get it any other notation will seem backwards to you.


 No.989288>>989291

>>989285

>>989286

So in summary your saying that these two languages have got their pros and cons. But to me it sounds like that C is the most effective at the moment. But it has some flaws sometimes. And this Common Lisp sound like an interesting language but difficult to learn and remember and porting problems. But at the end of the day they both are effective.


 No.989289>>989291 >>989309

And if I want to learn these languages, then with what material should I start reading? And what kind of hardware is required to write in this language?


 No.989291>>989292

>>989288

They're both useful and they're both fairly static. Code you write today will be just as readable 20 years from now. If you use libraries (yes even with C, I have an inherited C project with two cobweb-covered dependencies) those libraries might evolve into compatibility with your code. C++ can improve on C with some restraint, but with C++ some code you write today might be the Bad Old Thing a year or two from now, and then by 20 years from now people not even remember that the code you wrote today even works.

Since CL's a bigger language you can do things with it that you might reach for a library to do, in C. It's not necessarily any harder to port. It at least has much nicer support for porting it across systems.

>>989289

start filling a directory with programs. 1.c, 2.c, 3.c. Compile something that works, run it, move on. The best programming book can't replace you doing stuff. The worst programming book can't prevent you from doing stuff.

I say that because I can't recommend any C or CL book that strongly, but try

https://learncodethehardway.org/c/

http://www.gigamonkeys.com/book/


 No.989292>>989293 >>989309

>>989291

Do these languages work on all OS or just a few (like Windows, Linux etc.)?


 No.989293>>989294

>>989292

Like C and C++ on Windows?


 No.989294

>>989293

Yes, they're widely useful. If you have a very specific goal ("I want to write JRPGs about female monsters that rape the male protagonist if he loses batles against them"), you may get a specific answer ("buy RPGMaker MV and learn JavaScript to write plugins for it"). But even there, it'll only benefit you to spend some time learning to program at all with a "good enough for 20 years" language.


 No.989296>>989302

Check the catalog before posting >>965637


 No.989297>>989299 >>989302

>>989284

You're being memed, at least as far as Lisp goes. While C is resilient because it's so straightforward and no-nonsense, it's not perfect and will probably be replaced b something else in 20 years. That's a very long time as far as technology goes.


 No.989299>>989303 >>989309

>>989297

I don't quite know myself what I should learn but this Lisp language sounds interesting.


 No.989301

But what language could be the next C or C++?


 No.989302

>>989296

a good first language is "any language, idiot". He wanted a language to last 20 years, that cuts a lot of languages out.

>>989297

Zig might do that, but if you master Zig today you're going to have to update your mastery in a month when it replaces varags with tuples. You're going to have to keep re-learning Zig for a while. "I want to learn the language that will be a very good language to know 20 years from now" is a different question.


 No.989303

>>989299

Want my advice? Pick one and start churning out shitty useless programs that you thought of for fun, a program that takes the hex values of anything and converts them into pixels in an image for example, every language will be tough at first but unless you hack together programs that work but have way too many lines of code you will never learn to program properly.


 No.989309

>>989289

> what material should I start reading

The C Programming Language by Kernigham & Ritchie, it's old, but well written and you can later catch up on what new standards added. Make sure you read the 2nd edition, the first edition is older than the standard.

For Common Lisp Common LISP: A Gentle Introduction to Symbolic Computation by Touretzky is a good introduction. But it's just an introduction, it will not teach you the deep ends of Common Lisp. Here is also a good overview of Common Lisp to whet your appetite:

http://stevelosh.com/blog/2018/08/a-road-to-common-lisp/

I generally recommend staying away from online tutorials. With those you get what you pay for, which is usually nothing. They don't have to be bad, but more often than not they are. Especially the Learn Code The Hard Way by Zed Shaw.

Another really good book worth mentioning is SICP. It's an entry-level book about computer science, it's a very long read, and it uses Scheme as its language (a different type of Lisp). It goes more into the intricacies of designing a program rather than the act of programming itself, so maybe it's not necessarily what you want to read as your first book, but definitely read it at some later point. There is a version with better typesetting than the original online:

https://sicpebook.wordpress.com/ebook/

> And what kind of hardware is required to write in this language?

If your computer can handle posting on this site, then it can handle the above languages. You will need a compiler for C (GCC and Clang are two Free ones, so pick whichever) and for Common Lisp you will need an implementation (SBCL is a good one which can produce production-grade code). Keep in mind that those languages used to be run on machines so old, that our computers would be considered Science Fiction back then.

>>989292

> Do these languages work on all OS or just a few

A language does not run anywhere, but I get what you mean. It depends on your compiler. For both C and Common Lisp there is a compiler for pretty much any platform out there. You can grab the source code for Doom on MS-DOS and if you know C you can study it.

>>989299

Lisp is really cool, but its community is small. There are just the more dedicated for it, so it can be both a good and a bad thing. Just don't be surprised if people have no idea what you are talking about when you mention Lisp.


 No.989349

Thank You for this amazing thread /tech/. At least I'll know what do do know.


 No.989377

C weenies are trying to deflect by mentioning both C and Common Lisp, but what really sucks about C is that it restricts the hardware you are allowed to use. Tagged memory, useful hardware exception handling, hardware strings and arrays, and many other technologies that have been around for decades have huge advantages over the hardware you are using today, but C does not benefit from them.

Some reasons C sucks are pointer arithmetic, which prevents tagged memory and garbage collection, null-terminated strings, which slow every string down to 1 byte at a time, lack of error handling, which prevents useful hardware exception handling, and a brain-dead linker and "function pointers" which prevent any hardware attempts to speed up nested scopes, generics, or OOP.

C compilers need millions of lines of code to be efficient, so a C compiler on any kind of hardware would need just as much work as C on a shitty RISC like RISC-V. Other languages like Lisp, Ada, PL/I, Fortran, Basic, and so on would have serious improvements in both quality of implementation and compiler complexity by running on a tagged architecture, but C can't because anything not part of the PDP-11 is not useful to C. Even after all that code, C itself still sucks. Writing useful software (not FizzBuzz and K&R "exercises") in C is like trying to build a skyscraper out of toothpicks held together with shit. They need 15,600 "unskilled" "programmers" just to do a kernel, which sucks. OS/360 written entirely in assembly and including compilers for 5 languages (Fortran, Cobol, Algol, PL/I, and RPG) took less time and fewer people and that included creating the PL/I language and 360 hardware architecture. Multics was made with a much smaller group and that included inventing the hierarchical file system and rings and adding segmented memory to the GE hardware. Linux is mostly a clone of UNIX, an OS that already existed for 20 years, and despite all that and decades of better operating systems, Linux can't do system calls right and has an OOM killer and all that other bullshit and none of those are considered problems.

>>989286

>It's the universal high-level language for better or for worse and it's what we are stuck with.

That's defeatism. You're confusing C not being compatible with other languages with being stuck with C. C would need an FFI on Lisp machines too because of the brain-dead data structures like null-terminated strings, but you wouldn't be stuck with C. We'll only be "stuck with" it if the world IQ becomes too low for anyone to ever be able to create something better again (>>988677). That might be what UNIX weenies want.

There is no difference between "the fundamental design flaws
of Unix" and "the more incidental implementation bugs."

If you had to write umpteen versions of of a pathname parser
because the system didn't do it for you, I bet you would
make a number of "incidental implementation bugs." And it
wouldn't be your fault. It just not reasonable to expect
that every programmer that comes along has the
where-with-all to deal with aborted system calls, memory
allocation, a language that allows (make that "proudly
features!") both "==" and "=" in conditional tests, etc.
The fault lies with the original designers.


I've been waiting for an appropriate time to use this quote.
This is as good a time as ever.

Programs are written to be executed by computers rather
than read by humans.

This complicates program comprehension, which plays a
major role in software maintenance. Literate
programming is an approach to improve program
understanding by regarding programs as works of
literature. The authors present a tool that supports
literate programming in C++, based on a hypertext system.

- abstract to an article in the Jan 1992 issue of the Journal of
Object-Oriented programming

The fundamental design flaw in Unix is the asinine belief
that "programs are written to be executed by computers
rather than read by humans." [Now that statement may be
true in the statistical sense in that it applies to most
programs. But it is totally, absolutely wrong in the moral
sense.]

That's why we have C -- a language designed to make every
machine emulate a PDP-11. That's why we have a file system
that forces every file to be viewed as a sequence of bytes
(after all, that's what they are, right?). That's why
"protocols" depend on byte-order.

They have never separated the program from the machine. It
never entered their tiny, pocket-protectored with a
calculator-hanging-from-the-belt mind.


 No.989400>>989440

What does "useful" mean? I can still run games in this book via a BASIC interpreter today. It really depends on what you're trying to write.


 No.989440

>>989400

Writing programms or even making AI sound interesting




[Return][Go to top][Catalog][Screencap][Nerve Center][Cancer][Update] ( Scroll to new posts) ( Auto) 5
21 replies | 1 images | Page ?
[Post a Reply]
[ / / / / / / / / / / / / / ] [ dir / acme / agatha2 / arepa / fast / general / pe / s / vichan ][ watchlist ]