This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Konlab's profile picture

Opinion on different programming languages?

Started by Konlab, 17 October 2015 - 05:29 PM
Konlab #1
Posted 17 October 2015 - 07:29 PM
I'm curious what programming languages you know/want to learn and what's your opinion about them. What's your opinion about OOP or Stack-based languages?
FUNCTION MAN! #2
Posted 17 October 2015 - 07:42 PM
I'm a C and C++ developer, but I've recently picked up Scheme and Common Lisp. I prefer imperative and (pure) functional programming languages over OOP, and I think stack-based languages aren't practical enough to do nontrivial development in. I'm currently looking into learning Haskell.
Exerro #3
Posted 17 October 2015 - 07:49 PM
I mainly use Lua with CC, although I've used love2d and some other Lua frameworks too, and I've recently started using C++ and found it amazing. In Computing at school, we're often asked to use Python, which I despise. I much prefer OOP to functional programming, although I can see the benefits to both.
Konlab #4
Posted 17 October 2015 - 07:54 PM
I usually code in games, so I code in C# (Space Engineers' programmable block and Unity), Lua (CC), Java (Minecraft modding) and CRPL (Creeper reversed polish language, Creeper world 3). I prefer OOP over imperative and functional and I find Stack based languages interesting and useful for math.
Edited on 17 October 2015 - 05:55 PM
SquidDev #5
Posted 17 October 2015 - 07:55 PM
I love the .Net stack, so C# and F# are probably my favourite. The functional aspects of F# (unions, pattern matching, immutable by default, first class functions, currying) are pretty great, but C# still wins. Lambdas (and Linq) are pretty awesome.

C++ is pretty nice, though I have to Google before using anything - I probably write my most efficient code in C++ as I think about the implications of everything and how it could be more efficient. C however, ugghrhr - not a great fan of it.

I'm not sure I understand the comparison of stack vs OOP - Java and .Net run on stack based VMs, but both support OOP. If we are talking about this, then I cannot imagine anything worse (ok, maybe AppleScript).
Konlab #6
Posted 17 October 2015 - 07:56 PM
I love the .Net stack, so C# and F# are probably my favourite. The functional aspects of F# (unions, pattern matching, immutable by default, first class functions, currying) are pretty great, but C# still wins. Lambdas (and Linq) are pretty awesome.

C++ is pretty nice, though I have to Google before using anything - I probably write my most efficient code in C++ as I think about the implications of everything and how it could be more efficient. C however, ugghrhr - not a great fan of it.

I'm not sure I understand the comparison of stack vs OOP - Java and .Net run on stack based VMs, but both support OOP. If we are talking about this, then I cannot imagine anything worse (ok, maybe AppleScript).
Yes, Stack oriented languages like Forth or RPL :P/>
Edit: AppleScript looks like a Bat file
Edited on 17 October 2015 - 05:58 PM
FUNCTION MAN! #7
Posted 17 October 2015 - 07:59 PM
AppleScript doesn't look like a batch file, it looks like English. That's the point.

I love the .Net stack, so C# and F# are probably my favourite. The functional aspects of F# (unions, pattern matching, immutable by default, first class functions, currying) are pretty great, but C# still wins. Lambdas (and Linq) are pretty awesome.

C++ is pretty nice, though I have to Google before using anything - I probably write my most efficient code in C++ as I think about the implications of everything and how it could be more efficient. C however, ugghrhr - not a great fan of it.

I'm not sure I understand the comparison of stack vs OOP - Java and .Net run on stack based VMs, but both support OOP. If we are talking about this, then I cannot imagine anything worse (ok, maybe AppleScript).

You have no harsh feelings towards Common Lisp?
Edited on 17 October 2015 - 06:01 PM
LeDark Lua #8
Posted 17 October 2015 - 08:19 PM
Well I love: C++, Assembly, C# ( Cosmos :P/> ), Lua and I looked into Java a bit. OOP is what I love too, its just better. Stack-based umm nope, I just don't find it appealing.

PS: I know C++ and Java Virual is Stack based but I love the OOP of it, sorta say I love both of them really.
Edited on 17 October 2015 - 06:21 PM
Creator #9
Posted 17 October 2015 - 08:28 PM
I can speak some C++, some little Java, some even less HTML, and some very much Lua.
FUNCTION MAN! #10
Posted 17 October 2015 - 08:31 PM
Forums, you have impressed me. No hate on Lisp (looking at you ben Exerro) or functional programming?
Exerro #11
Posted 17 October 2015 - 08:35 PM
Well, ok, lisp is taking it to a new level. I mean half your code will be opening and closing brackets, it's horrible. I have a feeling we have two very different standards of functional programming as well. Mine is something like Lua's C API, which I think is pretty awesome, even if impossible to set up in VS.
SquidDev #12
Posted 17 October 2015 - 08:40 PM

Why do you presume I have harsh feelings about everything :P/>. I think it is pretty cool, though mostly in an experimental sense rather than 'I'd write something in this'. There are some really cool parts of it, but the syntax gets in the way whenever I try to learn it.

Forums, you have impressed me. No hate on Lisp (looking at you ben Exerro) or functional programming?

Though, if you want to read rants about languages, do feel free to read this old thread (no necros though). My one complaint about functional programming the enforcement of no mutation and functions have to be pure - sometimes I want/need/it is easier to mutate than write in a pure function paradigm. I recently spent 10 minutes looking at 50 lines of OCaml in total cluelessness about what it was doing (OK, that was because of liberal overloading of operators), and managed to convert it to about 20 lines of C#. I don't think that OOP or functional are 'better' than each other, I think the limitation comes from when you use one exclusively, at the cost of clarity or efficiency (both in reading, writing and executing time).
FUNCTION MAN! #13
Posted 17 October 2015 - 08:46 PM
Well, ok, lisp is taking it to a new level. I mean half your code will be opening and closing brackets, it's horrible. I have a feeling we have two very different standards of functional programming as well. Mine is something like Lua's C API, which I think is pretty awesome, even if impossible to set up in VS.

Lua's C API is not functional programming at all, it's completely imperative. It doesn't involve passing around functions, it involves modifying the state of a stack machine, and there are no higher-order functions. By functional programming I mean purely functional programming, without objects and especially without side-effects. Monadic IO, that sort of thing.

Also, when you strip Lisp code (Bliss code, to be precise this work of art) of it's parens, it's 194 characters. When you keep only the parens, it's 161. As far as I can remember, 194 is greater than 161.
SquidDev #14
Posted 17 October 2015 - 09:13 PM
Seeing as one of my current projects is an extension to Lua integrating type checking, pattern matching and a couple of other features, it would be interesting to know what particular features of languages people particularly like.
FUNCTION MAN! #15
Posted 17 October 2015 - 09:49 PM
Pattern matching and Option types. Maybe X, Just X and Nothing.
Bomb Bloke #16
Posted 17 October 2015 - 11:47 PM
The only languages where I can just "sit and write something" (without my nose constantly in a reference book explaining the basic syntax) would be Java, BASIC, and Lua. I somehow never got around to doing much in C or its variants.

A large advantage I find in BASIC/Lua is the ability to just sit down and mash in some code. You don't have to declare main methods, or if you're in a rush, anything at all; QBASIC even assumes your array declarations for you if you don't bother to type 'em in manually. Many tasks can be coded extremely quickly in these sorts of interpreted languages, and debugging is a dream - if you're working away in the QBASIC IDE, for example, and you test-run your program, at most any point (even if it just crashed!) you can jump back to the editor, change the code, and have execution continue from that point. Heck, you can even execute custom lines midway through the run without explicitly adding them to the main program. It doesn't get much easier than that.

Sure, I imagine most other languages have similar debugging features available to them these days, but I've yet to come across one with them so obviously presented. In QB, everything's just… there. The editor has the whole language documented within it, and you can right-click most any term to jump to its definition in the help file (which nearly always comes complete with a program that demonstrates example usage!). Pre-internet, this finally meant I didn't need physical reference books sitting next to me.

Java's default method library is rather more extensive - for example, if you want to display a PNG on-screen, the ImageReader object's got you covered - so it's much better suited for larger, more complex projects. Catch is that there's a lot more messing about just to get your code started.

AppleScript doesn't look like a batch file, it looks like English. That's the point.

Really? That sounds like a pointless, um, point (it's blunt?); it's one thing to make a language that's easy to read, but quite another to make one that's easy to write. That is to say, a better idea would be to get the interpreter to understand English, as opposed to making the programmer learn something that looks like English. In my few dealings with AppleScript, it never occurred to me that its designers might've been trying to make it "easier" than other languages. It's all a bunch of garbage syntax to me.

Now, batch files, those are easy to write. You simply type in whatever you'd type into the command line, maybe add some condition evaluators if you're feeling fancy, and you're done.
TYKUHN2 #17
Posted 18 October 2015 - 12:06 AM
I like LUA and use it a lot, but I have started Ruby and besides the most irritating tutorial ever it is a nice language.

I like OOP because Objects are Kool
KingofGamesYami #18
Posted 18 October 2015 - 03:27 AM
I started with Lua (CC Lua, anyway), learned RobotC (…and some of various C stuff) for FTC last year, and this year I'm learning Java (Android) for FTC since they decided to change the entire control system -_-/>.
CraftedCart #19
Posted 18 October 2015 - 08:13 AM
TL;DR:
BASIC, nah
Roblox Lua, Ehh
CC Lua, lovely
C#, it's alright
HTML / CSS, OK…
JS, I don't know much
Python, Eww…
Java, Huh?

I started with (Visual) BASIC, which wasn't fantastic. Then I used Roblox Lua, then CC Lua, and now C# in Unity. I know some HTML & CSS, and a little JS. School made me learn Python… I hate Python. Still trying to understand arrays and how to store multiple data types in them in in C#… I also know some Java from Android. Bit confusing though
Edited on 18 October 2015 - 06:20 AM
Waitdev_ #20
Posted 18 October 2015 - 11:47 AM
i would do something really odd that nobody uses, but i'd rather stick with Lua.

i have attempted Java, which went well, but it wasn't very fun compared to the Computercraft forums i almost left!
[right]really, i love it on the computercraft forums.[/right]
the other random languages i do are HTML, CSS, BAT, and some other ones i never remember. those include Python.
yet the only thing i could do with python was print "hello world" by guessing.

i used to do JS, but i was TERRIBLE. i mean, i didn't even know how to add parameters to a function.
Edited on 18 October 2015 - 09:49 AM
Konlab #21
Posted 18 October 2015 - 12:45 PM
For some reason I love Stack-oriented languages (like CRPL)
It makes much more sense for me doing this:
1 3 + 4 * 8 2 / * 5 5 / /
--# result is: 64
Than this:
(((1+3)*4)*(8/2))/(5/5)
--#It's the same as above
I don't like when my code's 50% are brackets

But this applies only for math calculations
Creator #22
Posted 18 October 2015 - 12:59 PM
What is the difference between a stack based language and the other type that was mentioned?
Konlab #23
Posted 18 October 2015 - 01:42 PM
What is the difference between a stack based language and the other type that was mentioned?
Other type? Stack-oriented? I really dont know what is Stack-based. Stack-oriented languages use a stack, their functions instead of receiving arguments/ returning values pop and push from stack. I cant tell you what stack-based is.
Bomb Bloke #24
Posted 18 October 2015 - 02:08 PM
(((1+3)*4)*(8/2))/(5/5)

This could simply be written as:

(1 + 3) * 4 * 8 / 2 / (5 / 5)
Konlab #25
Posted 18 October 2015 - 02:13 PM
(((1+3)*4)*(8/2))/(5/5)

This could simply be written as:

(1 + 3) * 4 * 8 / 2 / (5 / 5)
In this case. But if you use stack based languages you don't need to care about the order things will be executed in. You specify the order. Without brackets.
And I translasted it with brackets so in any case (+ can be replaced with * and ^ too) it will work.
Edited on 18 October 2015 - 12:14 PM