/dpt/ - Daily Programming Thread

Old thread: What are you working on, Jow Forums?

Attached: 1543000339886.jpg (996x1000, 866K)

Other urls found in this thread:

robots.thoughtbot.com/better-commit-messages-with-a-gitmessage-template
twitter.com/SFWRedditImages

first for ssize_t

What's the best language for compiling runtime errors

We need to have a talk about the future of C. Everyone who has ever programmed in it for any sizable time knows it has some big flaws and the committee flat out is refusing to budge on more quality of life improvements. With C11 they introduced a horrible memory model that is broken thanks to their inability to properly integrate threading into the standard. What would you do to fix C at this point?

let it die, make a new language

(3d (for (common lisp)))

Lisp is the most powerful programming language.

It had its glory days and it was great, just let it die.

Go fuck yourselves stop shitting up the thread.

In your heart you know it's true~~

Not being ironic but Rust or golang desu

golang has GC and is a webdev lang at this point. Rust is still immature and inherits a lot of mess from C++. it's a no go.

Write bug free code? It's not hard. Valgrind, lint, and so forth all help prevent this.

and so does a type-checking compiler

Yes so? I already have those without the harassment of a compiler that hand holds.

Rust is unity trash lul. Everyone knows unity sux

>forth
You got one thing right!

What?

double Yes so?

Why is this thread usually filled with hipsters using old dead languages? Haskell, Ada, Forth, Erlang just to name a few. Hell I'm pretty sure I saw someone talking about ALGOL 68 a few times.

I am unaware of any hipsters called Haskell

Learn Lisp.

There is actually a bunch of work defining a more robust memory model for the next C standard.
C is fine and is just doing as it's always done. Everything I want is pretty minor and not having them is not a deal-breaker. It'll be nice if closures get in.

>It'll be nice if closures get in.
That really can't work with C's memory model.

Forth, Ada and Lisp are just being spammed by the one autistic fan they each have
Haskell is probably being taught to CS kids these days

>Everything I want is pretty minor and not having them is not a deal-breaker. It'll be nice if closures get in.
What an incredible pair of sentences.

Sure they can. It already works for Apple.

t. Haskell shill

I should have been a little more specific with my words. Closures is by far the biggest thing, but other than that, it's pretty minor shit.
Things like retyping string literals to const, etc.

Recently I started having thoughts about customizing the UI of some windows programs I use, notably MPC-HC. Thing is I know nothing about programming or how much of an effort that would be, can you guys give me some guidance?
By the way MPC-BE already offers a lot of customization that HC doesn't, but I'm staying at home for the next 2 months doing nothing so I might as well try to learn a few things.

Attached: 1541429541291.jpg (1920x2030, 670K)

Haskell shills are like cockroaches, university indoctrination is the only explaination

I dunno, when I went to school, it was Python.

It depends 100% on where you go. There are schools still doing Lisp in off shoot classes. Haskell is definitely not a main language anywhere. Guarantee it's some subset of class(es)

pls suggest GUI projects I can make with Python

What are some of the most hands on programming jobs? I love programming, but I don't want to be staring at a monitor 40 hours a week. I was thinking something like embedded programming.

Attached: animemoji.jpg (812x806, 477K)

Lisp interpreter

>I was thinking something like embedded programming.
Definitely. You get close to hardware, get to play with whatever you're writing on, and code.

Same shit, except you will be staring at code written by engineers (aka hell)

>I love programming, but I don't want to be staring at a monitor 40 hours a week
you program by staring at a monitor

That job doesn't really exist. I graduated five years ago and I've basically been staring at a monitor for 40-45 hours a week since then. The longest consecutive vacation I've had was a week. Kill me.

No shit. I meant do programming for something you have to test in the real world. Not shit that'll only exist in the computer. Something you would have to get out of your chair and test.
What type of programming do you do?

>Something you would have to get out of your chair and test.
doesnt really happen
if its physical hardware you'll have an emulator
programming is not a "get out of your chair" job

Testers do the testing, not the programmers.

How is the suicide rate for programmers not 100% then? It sounds terrible wasting away for an outcome you don't care about

>Testers do the testing, not the programmers.
QA does full testing after preliminary testing passes. Programmers do their own tests as well which is mostly automated. With Embedded programmings it's not rare to find yourself working with the gadget or tool to help solve issues, work on new features, etc.

>take sys admin job
>automate most of it away
>program tools to help the team and monitor stuff
>no strict SE worklife
>very relaxed
best of both works

Attached: .png (149x148, 58K)

I don't have to worry about paying the bills, and I can devote time and money to other things I care about. Plus, some programmers actually find the job fun. I don't mind it myself, though I hate having boring meetings all the damn time. Such is life.

Telecom with C++

not everyone is a troglodyte who needs to see physical results to be satisfied

it sucks but you get used to it. i hang my arms by my sides when i'm not typing to lessen the wrist pain.

I used to program PLCs and over half the job was testing them in the field and working with technicians.
PLC programming is not anything like programming in C or something though.

>Why is this thread usually filled with hipsters using old dead languages?
>Erlang
take that back senpai

If you don't know programming it'll be a lot of effort. You'll need to spend those two months just learning programming in general before it's even reasonable to hope that you can modify something like that.

You could always go for something like instrument development - there's postitons that are somewhere at the interface of both hardware and software development. Or you could go be a scientist doing field work - you get both the handling of the instruments, as well as having to do all the data analysis tasks.

what do you do as a sysadmin?

I like Erlang, but just accept it.

Isn't it the same as C++ memory model? Sure, it's batshit insane, but so is hardware.

Funny enough C++ committee pushed it onto the C committee which has largely been taking from C++ for awhile now.

>instrument development
What is this?

Helped people debug their programming assignments for four hours.
I'm exhausted.

The font is FIRA Code. It's amazing, and I love it.

Attached: [Reaction] Starmie gets nailed.png (500x500, 151K)

What's so great about Erlang? I'm taking a class on concurrency / multiprocessing / multithreading and read that Erlang's pretty good with those type of projects. How is using Erlang easier/better than just using fork/threads?

Just curious.

wrong person

Woops.

C is deprecated.

Are thenewboston youtube tutorials enough for a beginner to learn java from?

Erlang threads are green threads.
Fork/Posix threads are kernel.

Erlang can spawn and manage thousands of threads because green threads are cheap. you can't do the same with kernel threads with seeing a big hit to performance overall. Erlang also comes with a lot of boiler plate to be concurrency focused.

It's where people develop scientific instruments to be used in both academic and industrial research. Anything from X-ray machines, XPS (x-ray photoelectron spectroscopy), IR spectrometers, temperature and pressure sensors, optical instruments and lasers, .. just fucking everything.

Yeah. Let's hope they both finally standardize 2's complement representation.

C++20 already did it.

But it's 2019.

Attached: .png (800x600, 525K)

Try learning C++.

Well the standardization process isn't completed yet. But a proposal was demonstrated and it was added to the draft.

I need to represent an IMMUTABLE linked list using dynamic arrays (using realloc yada yada)

is there an easy way of doing this or should i use a Node struct as is the classical implementation

What do you do exactly ?

No these tutorials are obsolete.

that's fucking retarded
maybe i should instead ask:

should a language have linked lists or immutable vectors (meaning each time you append or prepend something, copying happens)

what would you prefer to deal with
im leaning towards linked lists, though they are inherently slower than arrays which pisses me the fuck off

both. Both have their advantages.
But as a fundamental data structure, lists work better.

I dont think you know what you're talking about dude you should look up how vectors are actually implemented, they're not the same thing as linked lists

I just find out about .gitmessage and commit message templates
robots.thoughtbot.com/better-commit-messages-with-a-gitmessage-template
neato

If he's talking about a Clojure-style vector, those things are B-trees

why is clojure so fucking bad

i know what i'm talking about
the point is to have a linked list implemented as an array, that implements a linked list "interface" and also has the same or better algorithmic performance than a linked list

then traversing it would be as fast at traversing an array, so map, filter and reduce would be fast
but it's not possible to have the best of both worlds, or maybe not feasible

i just implemented linked lists with nodes, without thinking too much about it anymore, who cares

>i know what i'm talking about
no you don't
a linked list implemented as an array isn't a linked list because it doesn't have any links
go post about your beginner language somewhere else

Technically, you can have a bounded linked list in an array if you use indices as "links".

negro, a data structure implementing a linked list interface doesn't have to have links, but consing will be O(n)
see this implementation, it doesn't have explicit links other than shit in the environment, which is an array actually

also you can have an array of stuff where they each point to their next door neighboor, that's not a linked list even though it has links

busting my balls over semantics here, kys

a linked list is just where you can ask for the first and the next, in my case
it's about behavior it isn't about whether it has links
#compile_func("(define pair (@ x (@ y (@ z ((z x) y)))))")
#compile_func("(define first (@ p (p (@ x (@ y x)))))")
#compile_func("(define second (@ p (p (@ x (@ y y)))))")

@ is a lambda

no, an array isnt a linked list

linked list an implementation of a list that uses links
hence the name
if you don't have links it's not a linked list

It would be a linked list with an array as underlying implementation. All operations, with their complexity, are preserved.

it IS the implentation you stupid fuck

what is the missing link between the first element of an array of bytes and the rest
it is PLUS ONE

i am fucking done with this conversation

for me its C :)

An array is defined by the fact the elements are contiguous in memory.
It's not an abstract data type like other things are.

objects should not contain methods

objects 'containing' methods is merely syntactic sugar

If they're dynamic or overridable at all, then there has to be a vtable, which goes beyond just having sugar for it.

then you might aswell say structs shouldn't contain function pointers

This is bait

A lot of embedded development is just working in a Linux environment. You'll likely specify feature requirements you have and then your company hires another company to deliver that. Then you hire a company to set up the Linux distribution according to the requirements.
Then you get to work in that environment. Likely you're porting something older and providing feature upgrades at the same time.

The niche of being a contracted product developer for embedded products (like a drone or some shit) is rare. But it sounds like that's what you want.

>implemented as an array
Depends. It can be a hybrid datastructure. You link through the elements of the array and keep the array interface for fast iteration.
Likely you're allocating these arrays in chunks so it's more like a deque than an array/vector from that perspective.

all abstractions in CS are "merely syntactic sugar"