Programming thread -

Splendid

Castigat ridendo mores
True & Honest Fan
kiwifarms.net
This is a thread for programming. Here are some common programming questions:
Yes
Money, and also other reasons. Look, I'm tired and I'll write out something later, ok?
Python. Go with the highest numbered version available. If you must get into web programming right off the bat, then go with Javascript (because you don't have a choice,) and PHP. Be aware that both of these languages are rather...unique and promote some bad habits and I'm only recommending them because they're the fastest way to get started.

There, I'll write a better OP later. If I remember.

Let me start off with some topics guaranteed to piss people off so that the thread gains some traction:
  • For 90% of application programming, using a functional language is trying to force a square peg into a round hole.
  • The JVM is outdated and .NET will eventually replace it
  • The only reason to write production assembler code for x86-64 is if you're making drivers for something that doesn't support C.
  • Visual Studio >>> NetBeans
  • PHPStorm >>> NetBeans
  • Rust and C can't coexist long term. Either C will destroy rust like it's done with so many other languages, or Rust will finally force C into a niche.
  • The only Lisplike language that I've seen that seems decent is Racket.
 

Marvin

Christorical Figure
True & Honest Fan
kiwifarms.net
PHP. Be aware that both of these languages are rather...unique and promote some bad habits and I'm only recommending them because they're the fastest way to get started.
PHP hasn't been the fastest way to get started in years. Probably approaching a decade by now.

Reason being: hipster designers started getting into low grade web development. Things like single page web apps that require 10:1 clientside:serverside code. They worked their asses off to make it easy to hit the ground running.

It's why things like jsfiddle are popular, or nodemon, or easy-to-deploy webservers for experimentation, like python, javascript and ruby all have. I mean, I'm sure there's something similar for PHP, but all the rapid development is focused on what the hipster webdevs are doing, which is Javascript nowadays.
For 90% of application programming, using a functional language is trying to force a square peg into a round hole.
Depends on what you're doing. Well, and also depends on how you measure "90%".

90% of the total number of apps released? Yeah, probably not.

But if you're doing something that requires complex thinking, it's probably better to reserve as much of your brain power as possible for the problem at hand. Effort spent on plumbing is wasted.

Example: A project I'm working on involves getting users to collaborate on categorizing content. I'm trying to think of an algorithm that encourages users to contribute for the benefit of the group, without having any choke points. If the administration on the site have to settle disputes, that's less organic. It'd be neat to have a turnkey operation, where the rules of the site naturally encourage accurate results.

That sort of project is going to require extensive testing and tuning of the algorithm. It's essentially pure math. Anything that distracts from that will make testing the code (and making sure the theory is correct) that much more difficult.

These sorts of problems aren't all that rare actually. Any big site with a lot of users will want to experiment with crowd behavior.

Also, functional programming has properties that make scaling really easy.
The JVM is outdated and .NET will eventually replace it
You think? I was more excited / optimistic about .NET because Mono was looking pretty cool. But I haven't heard anything new from that corner in awhile.

Are you talking about GUI stuff? Because encountering Java GUI stuff in this day and age makes me laugh.
Rust and C can't coexist long term. Either C will destroy rust like it's done with so many other languages, or Rust will finally force C into a niche.
I think C has been in a niche role for awhile.

That is, C is almost exclusively used as either portable assembly, or as a glue language for extension libraries.

Though I don't know of any projects that use Rust either. Golang is a better candidate, I think. It's used for Docker.
The only Lisplike language that I've seen that seems decent is Racket.
Racket is a Scheme implementation. Although the line between "implementation" and "separate language" is blurry in the Lisp world.

Lisp isn't a programming language, it's a building material. You go into a Lisp project expecting the line between language and the resulting software to be very, very blurry.

Like the concept of userscripts in browsers is a very Lisp-like construction, albeit not the most ambitious route to take.
 

Marvin

Christorical Figure
True & Honest Fan
kiwifarms.net
Dude, I'm trying to drum up controversy and attract people by stirring up shit and you go and say reasonable things? *sigh*
Heh, well I guess after awhile you get bored of nerd fights.

Let's see if we can stir some shit up:

What about tabs vs spaces?

Ooh, here's a good one: Objective C's dynamism is a huge boon to building UIs. A GUI built with Objective C is going to be better designed, more usable and just overall cooler than one built with C++, at the expense of execution speed. Example: nextstep and OS X.
 
  • Disagree
Reactions: Plastic Godzilla

Splendid

Castigat ridendo mores
True & Honest Fan
kiwifarms.net
I'm gonna shamelessly tag people:
@CrunkLord420 @CIA Nigger @carltondanks @Give Her The D @AnOminous (?) @xxXDxx @LocalFireDept
Invite anyone else you know!

What about tabs vs spaces?
Statistically, StackOverflow's 2018 developer survey shows that developers that use spaces make more money, but I think this is mostly a relic of languages with much stricter whitespace rules like old school cobol where a comment is declared with a C in column 7, certain things can only be declared in columns 8-15, and the rest in 16-72.
Also, spaces suck and people who are insistent on them need to get off of Vim, suck it up, and pay $100 for a nicer editor like big boys and girls. Or if you're lucky, your language has a free and awesome IDE.

Ooh, here's a good one: Objective C's dynamism is a huge boon to building UIs. A GUI built with Objective C is going to be better designed, more usable and just overall cooler than one built with C++, at the expense of execution speed. Example: nextstep and OS X.
Isn't Apple itself trying to kill off OC in favor of Swift? Either way, anything Apple made after Jobs rejoined is shit so I just kinda hate it automatically.

Here's one for you: TCL and VB.NET are the best languages for building GUIs. Prove me wrong.
 
Last edited by a moderator:

Splendid

Castigat ridendo mores
True & Honest Fan
kiwifarms.net
Thanks.

Been trying to do Python for a little bit now. I'm just really exceptional in trying to come up with ideas, so I have no idea what to code. Help.
Code something stupid and childish. Make it draw ASCII dicks or something.
Or just do the Rosetta Code challenges, some of those are OK. Of course, some of them are just painfully stupid and involve reimplementing some random sorting algorithm or whatever, or just boil down to importing a module and making some function calls, but it's there.

Is Python your first language?
 
  • Agree
Reactions: Marvin

Marvin

Christorical Figure
True & Honest Fan
kiwifarms.net
lisp-programmers.jpg


Each of these is actually very funny. Well except for the Bill Nye one. Smalltalk doesn't deserve that level of cuckoldry.
Statistically, StackOverflow's 2018 developer survey shows that developers that use spaces make more money, but I think this is mostly a relic of languages with much stricter whitespace rules like old school cobol where a comment is declared with a C in column 7, certain things can only be declared in columns 8-15, and the rest in 16-72.
Also, spaces suck and people who are insistent on them need to get off of Vim, suck it up, and pay $100 for a nicer editor like big boys and girls. Or if you're lucky, your language has a free and awesome IDE.
Spaces are important if you want your code to be readable. Spoiler alert: In the real world, actually being balls deep in an IDE isn't the only time when you need to read code.
Isn't Apple itself trying to kill off OC in favor of Swift? Either way, anything Apple made after Jobs rejoined is shit so I just kinda hate it automatically.
Oh yeah, they're ditching Objective C. But Swift is just a nicer interface to the same underlying object model. They just ditched the C part of Objective C.
Here's one for you: TCL and VB.NET are the best languages for building GUIs. Prove me wrong.
Toy GUIs maybe.

Ultimately if your GUI needs to do anything remotely complicated, you're going to need a real language underneath at some point. Not shell-for-tards (which is funny, because shell languages are for tards to begin with, so I guess that makes TCL a language-for-tards...-for-tards).

And VB has always been "javascript for secretaries".

The reason why Objective C is a better real language than C++ is because developing anything that touches the user is going to require constant improvement and testing.

You'll sit down your hipster designers in front of the code, and the quicker they can test shit and restart the code, the better the end result.

Though the GUI language niche has been taken over by javascript, so it's kind of an academic discussion at this point.
 

CrunkLord420

not a financial adviser
Supervisor
True & Honest Fan
kiwifarms.net
I've been writing a game engine in C++ in my spare time for like the past year. I've been experimenting with different libraries and I've even got it compiling with emscripten (transpiling C++/OpenGL into wasm/WebGL) which lets me embed it into standards compliant HTML5 browsers.
  • SDL_Renderer is bad
  • GLFW is better than SDL if you don't plan to use SDL_Renderer and just want the events/windowing
  • SDL_gpu is way better than SDL_Renderer (faster, more features, lets you use shaders/raw OpenGL contexts)
  • NanoVG is a good way to do vector graphics
  • Allegro is probably better than SDL for a more "full-feature" framework (Factorio uses Allegro)
    • note: no one is talking about compiling Allegro with emscripten
  • bgfx looks promising for 3D graphics (technically hardware accelerated 2D is just orthogonally projected 3D)
  • Box2D and Bullet are good for physics backends
  • Text and fonts are actually insanely complicated
  • imgui is good for an easy debug UI
 

Splendid

Castigat ridendo mores
True & Honest Fan
kiwifarms.net
I've been writing a game engine in C++ in my spare time for like the past year. I've been experimenting with different libraries and I've even got it compiling with emscripten (transpiling C++/OpenGL into wasm/WebGL) which lets me embed it into standards compliant HTML5 browsers.
  • SDL_Renderer is bad
  • GLFW is better than SDL if you don't plan to use SDL_Renderer and just want the events/windowing
  • SDL_gpu is way better than SDL_Renderer (faster, more features, lets you use shaders/raw OpenGL contexts)
  • NanoVG is a good way to do vector graphics
  • Allegro is probably better than SDL for a more "full-feature" framework (Factorio uses Allegro)
    • note: no one is talking about compiling Allegro with emscripten
  • bgfx looks promising for 3D graphics (technically hardware accelerated 2D is just orthogonally projected 3D)
  • Box2D and Bullet are good for physics backends
  • Text and fonts are actually insanely complicated
  • imgui is good for an easy debug UI
Unity exists you know.
 

Marvin

Christorical Figure
True & Honest Fan
kiwifarms.net
  • SDL_Renderer is bad
  • GLFW is better than SDL if you don't plan to use SDL_Renderer and just want the events/windowing
  • SDL_gpu is way better than SDL_Renderer (faster, more features, lets you use shaders/raw OpenGL contexts)
Just 2d graphics, right?

I knew SDL 1.2 very well back in the day. I started trying to do stuff with 2.0 recently. What are the big differences? Mostly GPU stuff, I'm guessing?
Text and fonts are actually insanely complicated
This. It sneaks up on you how exceptional font handling is on modern computers. And it never seems to get any better. Just wait five years from now and see if anything has improved. I guarantee you nothing will have changed.
I love how ASP.NET is the prostitute. Nobody uses ASP.NET unless they're really, realllly drunk.
Yeah, haha.

Also the thread about the munchkins molesting Dorothy reminded me of that meme. It always makes me laugh and it's what comes to mind when Erlang (and elixir) comes up.
 
  • Disagree
Reactions: Plastic Godzilla

CrunkLord420

not a financial adviser
Supervisor
True & Honest Fan
kiwifarms.net
Just 2d graphics, right?

I knew SDL 1.2 very well back in the day. I started trying to do stuff with 2.0 recently. What are the big differences? Mostly GPU stuff, I'm guessing?

This. It sneaks up on you how exceptional font handling is on modern computers. And it never seems to get any better. Just wait five years from now and see if anything has improved. I guarantee you nothing will have changed.

Yeah, haha.

Also the thread about the munchkins molesting Dorothy reminded me of that meme. It always makes me laugh and it's what comes to mind when Erlang (and elixir) comes up.
The biggest difference is they dropped support for a ton of 15 year old consoles and stuff. SDL2 still has the old software renderer as well as a hardware renderer option (DirectX/OpenGL), but is really limited and bad even when compared directly with the drop-in replacement library SDL_gpu. Though, apparently Nintendo Switch support was just added to the library if you can prove you have a developer contract.
 

Marvin

Christorical Figure
True & Honest Fan
kiwifarms.net
The biggest difference is they dropped support for a ton of 15 year old consoles and stuff. SDL2 still has the old software renderer as well as a hardware renderer option (DirectX/OpenGL), but is really limited and bad even when compared directly with the drop-in replacement library SDL_gpu. Though, apparently Nintendo Switch support was just added to the library if you can prove you have a developer contract.
I'm thinking about maybe doing android games with SDL. Well, it's at the bottom of my todo list, anyway.
 

Tookie

Mountain of Molten Lust
True & Honest Fan
kiwifarms.net
It's why things like jsfiddle are popular, or nodemon, or easy-to-deploy webservers for experimentation, like python, javascript and ruby all have. I mean, I'm sure there's something similar for PHP, but all the rapid development is focused on what the hipster webdevs are doing, which is Javascript nowadays.
PHP has some pretty good frameworks nowadays with deployment and VM tools surrounding them. The frameworks help eliminate a lot of the syntactic quirkiness and common security problems that used to plague it as well. The hipsters being busy off chasing shiny objects has almost helped it mature.

I used to work in an office downstairs from a coding academy. They would do 4-month classes and seemed to cycle to a new framework/language with each batch. They started with Ruby on Rails, moved to Node.js in the next one, and I think they're dicking around with TypeScript now.
 
  • Informative
Reactions: Splendid
Tags
None

About Us

The Kiwi Farms is about eccentric individuals and communities on the Internet. We call them lolcows because they can be milked for amusement or laughs. Our community is bizarrely diverse and spectators are encouraged to join the discussion.

We do not place intrusive ads, host malware, sell data, or run crypto miners with your browser. If you experience these things, you have a virus. If your malware system says otherwise, it is faulty.

Supporting the Forum

How to Help

The Kiwi Farms is constantly attacked by insane people and very expensive to run. It would not be here without community support.

BTC: 1DgS5RfHw7xA82Yxa5BtgZL65ngwSk6bmm
ETH: 0xc1071c60Ae27C8CC3c834E11289205f8F9C78CA5
BAT: 0xc1071c60Ae27C8CC3c834E11289205f8F9C78CA5
LTC: LSZsFCLUreXAZ9oyc9JRUiRwbhkLCsFi4q
XMR: 438fUMciiahbYemDyww6afT1atgqK3tSTX25SEmYknpmenTR6wvXDMeco1ThX2E8gBQgm9eKd1KAtEQvKzNMFrmjJJpiino