Programming thread

Splendid

> Moderating KF for free
Retired Staff
True & Honest Fan
kiwifarms.net
Joined
Mar 11, 2015
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.
 
Should learning programming satisfy a college's foreign language requirement?

No.
 
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.
 
Dude, I'm trying to drum up controversy and attract people by stirring up shit and you go and say reasonable things? *sigh*
 
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.
 
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:
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?
 
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.
 
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
 
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.
 
  • 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 retarded 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.
 
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.
 
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.
 
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.
 
Null Sponsored by Null
Post in thread 'Supporting the Kiwi Farms by Check in the Mail (Billpay Edition)'
Null
You can now pay by check in the mail. If 600 people set this up, it will sustain the site and its development perpetually.


It is very important that you read the instructions.
You do not supply your username or a bank account number for Kiwi Farms.
Read the instructions.



How To​

It's very easy to do. It will take a while (a week or more) for the payment to processed, as it has to be sent to a bank for the deposit.

You are identifying your forum account with a secret account number found only on this page.
1760641111863.png

Billpay is a system where your bank prints physical checks and sends them on a schedule to a physical location by mail. The process of setting this up depends on the bank. You can google "My Bank Billpay".

For instance, with Old Glory Bank it looks like this. This varies by institution but this is a general process guide.

1. Add a payee. If it asks if this is a company or personal transfer, select company.

1760635878760.png1760636509106.png

2. Enter your details carefully. Pay special attention to anything related to a "billpay id" or "account number". The terminology changes by vendor, but basically this is the identifier for the payee's system that identifies you.

1760636314067.png1760636371421.png

3. Fill in mailing details. My system asks me for my name to put on the check. You may be able to replace this with an LLC or omit this entirely, depending on your bank's rules.

1760636415936.png

4. Set up a recurring payment with this payee. For continuous supporter status, arrange $20 per month at any day of your pleasing. There is no minimum or maximum. You will get premium upgrade time distributed pro rata: if you send a dollar you will get 36 hours, if you send a hundred you will get more than 150 days.

1760636721510.png

That's it. Your bank will send a check to mountain momma every month.




Rewards​

As explained above, time is given to your account pro rata. You can check it on the billpay page.

1760636975539.png

Gilded Profile​

1760636880904.png
See: @Null Test Account. You have the option to gild your avatar which will display on any place your avatar does. It will also gild your banner from green to gold. You may disable each of these.

The True & Honest Fan banner will default to green and appear regardless of preference if you run out of time. This will confer to you the same benefits as anyone else who has donated $20 at any point in the forum's history.

Sponsored Posts​

Currently, once a week, you can sponsor a post to appear in advertising positions around the site.

Special Stickers​

A very special and highly requested sticker will be made available in the political boards to active supporters.

I have some ideas for global reactions but I'd like to get the first users in and discuss it with them before deciding one.

Additional Customization​

I'm considering other things such as custom user name color or banner customization. As above, I'd like to discuss these things before committing time to it.

Planned: Gifting​

I do not advise paying for somebody else by asking for their billpay id.

I will provide a way to gift time to users from your own account. So, if you donate $100 in a month, you will be able to apply a month to five people or two months to one person or whatever you want.



F.A.Q.​

Q. Can I send more than $20? Can I send $40 every two months? Can I send $240 a year? Can I send less? What happens if I send an odd amount like $31?​

Yes, yes, yes, yes, yes, yes. Any amount you send will be applied pro rata.

The formula is thus:
  • Take either the existing expiration time of your upgrade OR the current time at the point the payment is processed.
  • Add +n months, where n is the quotient of $AMOUNT divided by $20).
  • Add +x hours, where x is the remainder of that division divided by $20 and multiplied to the total number of hours in the month that the expiration date would otherwise be in.
If you donate $31 and it is processed by me on January 1st, your upgrade will expire on February the 16th at 8pm (1 month then 55% of the amount of hours in February).

Q. How long does it take?​

I estimate between 2 to 3 weeks after your institution cuts the check and sends it. For my breakdown, see here. I know, it sucks, I was hoping for closer to a week. In the future, we may have a way to improve the speed at which checks are deposited: our bank, Old Glory Bank, is interested in issuing a check deposit machine to us directly which will completely remove about 6-9 business days of processing time. The good news is that once you send your first check and it comes through you never have to think about it again.

Q. When is money withdrawn from my account?​

This is an institution-specific question. Many banks withdraw and endorse the payments as soon as they are created. Some do not. If you do not see a withdrawal for the amount you send, you should ensure that your balance stays positive so that it will not bounce or overdraw.

Q. What Security Measures are in place?​

The gist is: No one party ever holds both the check and the user account associated it. This is why you specify your bill pay id, not your account name.

Here is a rundown of the safety precautions being taken.
  • There are federal and state laws in regards to the handling of financial information.
  • The billpay id that is created for your account is known only to the Kiwi Farms, not the check deposit clerk.
  • Payment information is stored by the bank, not any online device, individual, or business location that I manage.
  • Payments are applied to user accounts by a receipt generated by the banking service.
  • No information about the depositor or the financial institution are stored on the server.
  • USPS money orders and bank checks are accepted for this.
In short, who is donating to which account will be unknown to every individual. The mail clerk, the teller at the bank, and myself will never see the depositor and the user account at the same time. The clerk receives the checks with numbers on it. The bank receives the same. I receive a receipt of which payees received what payments. The Kiwi Farms receives instructions to update those accounts. Even in the event of a total breach at any of those locations, cross-contamination is not possible.



Refund Policy​

No refunds, including if you are banned. Sorry, but I'm not writing checks to people who bought it and then featured something gross. This is a way to support the forum and the gimmicks are just my thank you.
Back
Top Bottom