Programming thread

2D25D211C45FA44039CCA91EC75F9470F317899E

This seems like she was joking, but her followers were too dim to get it. She was kidding around right? Right?

She wasn't joking was she

Karlie Klod.jpg

https://www.reddit.com/r/ProgrammerHumor/comments/68sxs6/nice_programming_skills/

Idjit.PNG


God damned thots.
 
Having a "key man" setup is a common fuckup. I've been in situations where people have tried to run off with essential domains, or take them hostage for money.
That's the thing, the disadvantage to a key man setup is that if the key man dies or goes insane you're fucked. The danger of having many people with that kind of access is that you can get a situation like gentoo had recently.
This has to be a fucking joke, it just has to.
Everyone hopes it's a joke when they first see it. Also, for a real laugh, check out the dates on the "recent news" links at the bottom.
 
Ok, so I thought of something at work that I think would be a good question here.
What are some things from your favorite/most used programming languages that you don't like?
  • I don't like how Python had to mess up the great asynchronous programming model that Microsoft invented and how we now have methods with signatures that don't begin with "def".
  • I don't like it when any language doesn't let me pass anything I want by reference or by value at any time.
  • I think C# has a really bad default house style and now everyone uses it. Java's makes much more sense.
  • Of all the dumb mistakes in PHP, the dumbest thre eare not introducing namespaces much earlier (so now the global scope is polluted,) not making everything object oriented for PHP 7, and the fucking dollar signs in front of variables.
  • Javascript singlehandedly proved that prototype based inheritance is cancer and that even tiny little allowances for amateur programmers like automatic semicolon insertion can really fuck up a language.
  • SQL's select statement should read FROM tables SELECT columns.
 
So what am I supposed to use for dynamic websites in CURRENT YEAR? I guess PHP is out, am I allowed to write with Python or do I have to use NodeJS? Also what is this "Framework" stuff for NodeJS? Like Express? Do you really need that?

I'm currently looking at Flask but I hear NodeJS performance is better than Python.
 
I like it, and you can do quite a lot with the standard library. If you're used to python though, the language will be like wearing a straight jacket.

There are frameworks, and using them (or not) seems to be more up to religious preference and a coin flip.

The two that seem to come up a bit right now, are Echo and Revel

But come on, make this interesting DO IT IN LISP
 
So what am I supposed to use for dynamic websites in CURRENT YEAR? I guess PHP is out, am I allowed to write with Python or do I have to use NodeJS? Also what is this "Framework" stuff for NodeJS? Like Express? Do you really need that?

I'm currently looking at Flask but I hear NodeJS performance is better than Python.

I agree with this sentiment, and I think a lot of developers that aren't soy sipping retards do to. I was perfectly happy with PHP and the occasional C based CGI script but now employers want dumb meme frameworks like Ruby on Rails and Django.

I personally decided to give NodeJS a go because it seems to be getting fairly popular and javascript doesn't make me hate my life in the same way that Python does.

If anyone else has any ideas/suggestions please say.
 
I don't like how Python had to mess up the great asynchronous programming model that Microsoft invented and how we now have methods with signatures that don't begin with "def".
Which asynchronous programming model is that?

But yeah, like lots of things in Python, its recent asynchronous syntax stuff is a glaring sign that it's getting too big for its britches.

A programming language with mandatory indentation rules (particularly obnoxious ones like Python's) can only get so complicated before it becomes a clumsy, unreadable mess.

The promise model for asynchronous programming is fine, but python's just getting way too complicated.

Like one example of something that I should've been able to do without learning async stuff, is:
  • download some JSON from an endpoint
  • do something with that
  • repeat
It doesn't need any async functionality. I could do it in bash if I hated myself. But the only libraries I saw required learning async, and learning a whole library just to do something I could've done by piping out to curl.
Javascript singlehandedly proved that prototype based inheritance is cancer and that even tiny little allowances for amateur programmers like automatic semicolon insertion can really fuck up a language.
Prototype inheritance is a cute party trick to show how simple of an OOP system you can design.

The only time it's a valid tool is if you're writing a program entirely yourself and want to experiment a little. You can never have anyone else work on your code, and they can't call methods in your code without requiring a retarded amounts of hand-holding on your part.

Which is never acceptable when you're writing for the web.
SQL's select statement should read FROM tables SELECT columns.
I find SQL overall to be a talent looking for a purpose.

Like it's always highly tied to a particular database. All the fancy SQL tricks that tie tables together or have weird column restrictions end up being a pain in the ass if you want to repair something.

Most of the time, I find people just use SQL as a fancy key/value database, basically.
I like it, and you can do quite a lot with the standard library. If you're used to python though, the language will be like wearing a straight jacket.

There are frameworks, and using them (or not) seems to be more up to religious preference and a coin flip.

The two that seem to come up a bit right now, are Echo and Revel
I'd pretty much just use the standard library net/http. If you're just wanting to handle a few http endpoints, it does the job.
But come on, make this interesting DO IT IN LISP
This but unironically.
 
Doing some research it seems NodeJS kills Python in performance.
The performance of specific programming languages doesn't really matter anymore, especially if you're doing web stuff. Unless you're in a few very specific fields like scientific computing (lol) or game development, your language choice doesn't really matter unless you start comparing extreme ends of the spectrum like Python vs C. If you're doing web programming, the time it takes for your shit to actually move around the internet will make even that irrelevant. At most, you might get some theoretical advantage in startup time.
 
The performance of specific programming languages doesn't really matter anymore, especially if you're doing web stuff. Unless you're in a few very specific fields like scientific computing (lol) or game development, your language choice doesn't really matter unless you start comparing extreme ends of the spectrum like Python vs C. If you're doing web programming, the time it takes for your shit to actually move around the internet will make even that irrelevant. At most, you might get some theoretical advantage in startup time.
Agreed, although one performance issue (less about the language, and more about the implementation) is handling OS events. Like file handles becoming available, things like that. Like libevent, for example.

It affects parallelism and portability.

People thinking the bytecode interpreter itself or the garbage collector performance matter are mistaken.

NodeJS uses libuv, which is supposed to be pretty nifty.
 
I like it, and you can do quite a lot with the standard library. If you're used to python though, the language will be like wearing a straight jacket.

There are frameworks, and using them (or not) seems to be more up to religious preference and a coin flip.

The two that seem to come up a bit right now, are Echo and Revel

But come on, make this interesting DO IT IN LISP
Thanks for the tip about Echo. I think I'll go with that. The template system seems like it'd make my life easier.

Seems golang has a native html/template, also there's these benchmarks which suggest fasthttprouter is the most BLAZING FAST way to do this: https://github.com/smallnest/go-web-framework-benchmark

Turns out fasthttp doesn't support WebSockets, which is potentially a big deal. Also have you guys seen this drama? http://www.florinpatan.ro/2016/10/why-you-should-not-use-iris-for-your-go.html

I think I'm just going to go with @Marvin's suggestion of sticking to the standard libraries until there's a very specific reason I need to change up.
 
Last edited:
I wouldn't worry about choosing the most 3l337 benchmarked library for whatever you're doing. Unless you're literally writing for bare metal microprocessors, computers are fast enough to not really give a shit anymore. A reminder that you're reading this on the output of about 10 vms nested within each other.
 
I wouldn't worry about choosing the most 3l337 benchmarked library for whatever you're doing. Unless you're literally writing for bare metal microprocessors, computers are fast enough to not really give a shit anymore. A reminder that you're reading this on the output of about 10 vms nested within each other.
Minimalism is important. There's legitimate criticism about echo being dependent on a whole set of other packages. Right now I'm just trying out net/http+html/template+httprouter. Chi is another framework that did seem interesting, though.
 
I'm not sure how much benefit a promise model can bring to a language still gimped by the GIL. Yeah you can do a few things while waiting for a http response to return, but you're still bound to a single core for work unless you fork the entire process. I only find Python appealing for smaller scripts for that reason -- something that performs tasks every so often via cron? Sure. A high-throughput web server? No.

The performance of specific programming languages doesn't really matter anymore, especially if you're doing web stuff. Unless you're in a few very specific fields like scientific computing (lol) or game development, your language choice doesn't really matter unless you start comparing extreme ends of the spectrum like Python vs C. If you're doing web programming, the time it takes for your shit to actually move around the internet will make even that irrelevant. At most, you might get some theoretical advantage in startup time.

You have to consider throughput in this. I've worked with enough busy servers to know the pain of sudden surges in web traffic.

Say you have a good app server returning a cached response in 50μs, and a bad one that returns a cached response in 50ms (close-to-real example -- I'm porting a legacy PHP application to something less terrible right now). While there is little difference to the user, the bad server requires 1,000 times more effort for the server, per request. 1,000 requests later, that's 49.9 seconds of wall time wasted on a poor-performing application server. If your server is being hit very hard by a thousand users at once, this is where bottlenecks begin to appear. This is a worst-case scenario, since PHP is a poor choice if you are building for performance due to the need to bootstrap an entire application around every incoming request, but whatever.

The point is eventually you are going to be in a situation where you are going to build stuff that is going to span multiple servers. It's not just response time that matters, but also how much CPU and memory resources are being consumed. You could be saving hundreds, maybe thousands of dollars a month in the long run if you select your infrastructure and design your software well.
 
I'm not sure how much benefit a promise model can bring to a language still gimped by the GIL. Yeah you can do a few things while waiting for a http response to return, but you're still bound to a single core for work unless you fork the entire process. I only find Python appealing for smaller scripts for that reason -- something that performs tasks every so often via cron? Sure. A high-throughput web server? No.
I wouldn't say multicore processing in a single process is collectively "settled" as a good idea, as a necessary feature. Most people go "hey, yeah, more cores is more better, right?"

I think people misunderstand what it would really bring to the table that multiple processes wouldn't do easier.

The only reason it's 100% necessary is if you absolutely have to read and write data between threads/processes as fast as possible. Like, I'd want to hear an explanation for why ordinary IPC won't work before I grudgingly admit that genuine multiprocessing is necessary.

Otherwise I'd just tell you to run $cores processes and call it a day.

Promise based systems are more about how you conceptualize multiple tasks at once, rather than being a performance thing.

Also I really hate threaded code. At least situations where you're working directly with mutexes for anything more complicated than a single threadsafe queue.

I still have nightmares hunting down obscure, impossible-to-trigger deadlocks in pthreads code.

If there's a problem with Python and web development, it'd be that the overall byte interpreter is slow. Not the GIL. (But I doubt it.)
Say you have a good app server returning a cached response in 50μs, and a bad one that returns a cached response in 50ms (close-to-real example -- I'm porting a legacy PHP application to something less terrible right now). While there is little difference to the user, the bad server requires 1,000 times more effort for the server, per request. 1,000 requests later, that's 49.9 seconds of wall time wasted on a poor-performing application server. If your server is being hit very hard by a thousand users at once, this is where bottlenecks begin to appear.
Generally the language choice itself won't be the biggest issue. A good app will use layers of techniques to make shit go fast. Memcached or redis, disk caches, your slower, bulk store like mysql/postgresql, and nginx. The language interpreter itself is essentially statistical noise by that point.
This is a worst-case scenario, since PHP is a poor choice if you are building for performance due to the need to bootstrap an entire application around every incoming request, but whatever.
Well, there's php-fpm. But I hate php anyway.
The point is eventually you are going to be in a situation where you are going to build stuff that is going to span multiple servers. It's not just response time that matters, but also how much CPU and memory resources are being consumed. You could be saving hundreds, maybe thousands of dollars a month in the long run if you select your infrastructure and design your software well.
Programmers are substantially more expensive than machines. And this isn't a situation where you can just tell your programmers "lol, program better". To some extent you can, but at the end of the day, bugs happen.

You'll want the highest level language you can get, to squeeze the most value out of your programmers, especially in an emergency situation with an unexpected bug.

Unless you're outright writing ass backwards code that can't possibly run fast, I think it's an expensive mistake to prioritize machines over people.
 
Back