/dpt/ — Daily Programming Thread

Previous: How's your custom language coming along, Jow Forums?
What features does it have?

Attached: vlcsnap-2018-04-07-13h21m34s449.png (1512x1072, 1.09M)

Other urls found in this thread:

blog.golang.org/conduct-2018
twitter.com/AnonBabble

Why you use JS and not Python for backend and CSS for all animations popups and styles?

I miss good old "block JavaScript"

What's the best language to painlessly create a nice GUI? Fuck python, java and C#.

fuck java, i think tkinker is better than jpanel jframe and jshit.

I meant fuck all of those languages.

Do many of you guys get lonely? How do you deal with isolation and loneliness as a programmer without turning to drugs? I feel like It isn't worth coding without stimulants now and when I use them all my loneliness goes away but without them sometimes I feel so lonely I just lay in bed and cry.

Attached: Untitled.png (994x982, 156K)

>Fuck python, java and C#

Too dumb to learn 3 of the most popular languages in world? Give up on programming.

Turn your Java script off you retard

I don't program alone that much.

I write in C. It has its warts, but if you're gonna claim there's a better language it has to satisfy all these basic ground rules, or don't you dare even try to sell it to me.

1. Pointers are pointers. None of this "shared_ptr" or "&safety" bullshit. Give me the goddamn address of the data and let me do what I want with it.
2. Give me "defer" or let me keep my fucking goto. In fact, I'll take both. And let me jump into other functions while you're at it. Can't do that in C.
3. Use = for assignment, += for add-in-place, and ++ for increment. If you think it's a bright idea to take ++ out of the language, I think it's a bright idea to kick your ass.
4. No const. Anywhere. If I want to change something I'm damn well going to change it.
5. While I'm at it, no enum. I want #define and I want it to be the only way to name a literal.
6. Type BEFORE variable name, like God and General Lee intended.
7. Seriously. Type before variable name. Do not fuck with me on this.
8. No generics. All that punctuation is more trouble than it's worth.
9. Default values for types/arguments. If I don't specify a default value for an argument, it should be the default value of the type.
10. Let me cast anything to anything else, like a struct to an int. Do it automatically for function arguments so the compiler doesn't bug me about passing the wrong type.
11. If I call a function with too many arguments, just leave out the extras.
12. If I don't return a value, just use the default.

Attached: 7a349640f17383d538a74c93581d0e44--snakes-birds-of-prey.jpg (713x554, 74K)

>no const
>no enum
>if i call a function with too many arguments, just leave out the extras.
>If I don't return a value, just use the default.
is this bait?

>4. No const. Anywhere. If I want to change something I'm damn well going to change it.
>5. While I'm at it, no enum. I want #define and I want it to be the only way to name a literal.
>10. Let me cast anything to anything else, like a struct to an int.
>11. If I call a function with too many arguments, just leave out the extras.
>12. If I don't return a value, just use the default.

Your brain is poisoned by the C menace.

who gives a shit about your opinion?

agree with all others, but 11 and 12 soound like you're inviting problems that you can't debug without excruciating trial and error

Attached: pooinloo.jpg (1678x1672, 801K)

Qt in c++
Then again qt in Python is even easier but will get dirty quick.

Teaching myself how to use a GUI by forcing myself to make a small GUI for Youtube-DL.
Nothing too fancy, just something that lets me quickly and easily download files with minimal typing on my part.

Dumb question, though:
How do I make the button on the right bigger? I want it to look as large (height-wise) as the three textboxes on the left of it.

def __init__(self, master):
Win_Height = 480
Win_Width = 640

geometry_str = self.createCenteredWindow(
master, Win_Height, Win_Width
)

master.geometry(geometry_str)

#Contains label and textboxes
Labels_Frame = Frame(master, width = 20)
#Labels_Frame.pack(side=TOP, fill=X)
Labels_Frame.grid(row=0,column=0)

#Contains list and scrollbar
Scrollable_Frame = Frame(master,height=Win_Height-100, width = Win_Width/2)
#Scrollable_Frame.pack(side=TOP, fill=X)
Scrollable_Frame.grid(row=1, column=0)

#Contains buttons
Button_Frame = Frame(master , height=100, width = 100, bg="red")
# Button_Frame.pack(side=TOP, fill=Y)
Button_Frame.grid(row=0, column=1)


#Create three labels and text fields
# /* code here */


#Create scrollable list frame
# /* code here */

#Create button
Format_Button = Button(
Button_Frame, text="Format Video"
)
#PROBLEM: Button is pretty short/stout
Format_Button.pack(side=TOP, fill="y")

Attached: Screen Shot 2018-05-29 at 11.16.28 PM.png (1286x1004, 100K)

Cool fucking guy ill smack your face up you little bitch. Don't fuck with me I'm one crazy motherfucker. How dare you speak like that you little shit. I'll break your fucking face open so fast you won't even be able to react. You're fucking dead cocksucker.

You mean C ?

You realise in an ideal world this would be what programming languages will be like? What you want to do gets done, no safety shit and stuff to check for stupid errors. You won't change consts, what's enum even for, the function thing can be nifty sometimes, but sadly this is a non ideal world where we all make mistakes, and with the mass production of programmers the mistakes are just increasing. Thus languages now have so many safety features, and they make it seem like if you don't use them then you're some outdated old man when the outdated old men were those that made all this possible. Gone are the days where passionate smart people created quality code and now is the day of tools and methodologies and paradigms to catch stupid mistakes made by incompetent faggots.

Hi I'm new and learning :)

Attached: Capture.png (357x175, 7K)

>answer = yes and if input = answer do something
>not if input = yes do something

Mind unironically blown haha

I finished adding support for classes to my Lisp interpreter/compiler:
(defclass animal :fields (color temper))

(defmulti make-sound types-of)

(defun animal-greet [a]
(str (animal::temper a) " " (animal::color a) " " (type-of a) " "
(make-sound a) " as it sees you"))

(defclass cat :super animal)
(defclass dog :super animal)

(defmethod make-sound [cat] [c] "meows")
(defmethod make-sound [dog] [d] "woofs")
(defmethod make-sound [animal] [a] "makes an unidentifiable sound")

(defvar *my-cat* (cat :super (animal :color "brown" :temper "lazy")))
(defvar *my-dog* (dog :super (animal :color "black" :temper "angry")))
; attributes get passed to parent constructors, so the following would be equivalent
(defvar *my-cat* (cat :color "brown" :temper "lazy"))
(defvar *my-dog* (dog :color "black" :temper "angry"))

; you can even use a completely different object as :super because the inheritance is prototypal under the hood
(defvar *number-cat* (cat :super 4))
(+ 5 *number-cat*) ; => 9
(cat::color *number-cat*) ; => will result in an error because it doesn't have an animal object as its prototype

(animal-greet *my-cat*)
; => "lazy brown cat meows as it sees you"

(animal-greet *my-dog*)
; => "angry black dog woofs as it sees you"

(animal-greet (animal :color "blue" :temper "mysterious"))
; => "mysterious blue animal makes an unidentifiable sound as it sees you"

>no cost
Stopped reading there.

>And let me jump into other functions while you're at it. Can't do that in C.
What is setjmp/longjmp?

I think I'm a brainlet.

I can't even figure out how to get started on programming. I know the basics of python but if I'm not getting handheld I don't even know how to get it started. Like wtf I want to program on my Ubuntu but I tried dlpading python and it didn't work and it took me a while to even understand the purpose of vim. I'm so fucking dumb but I'm trying and trying and will get a tech career.

Attached: 1527467710312.jpg (251x248, 6K)

I've always had issues starting with stuff. The only thing that actually got me to learn Python was starting help from friends on an IRC bot, learning from the things that they wrote, and taking suggestions from people and having to learn to add support for feature requests.

Self-teaching is significantly gayer than help from friends, but lots of people also don't want to babysit you.

Take some cs/maths papers at uni. Its easy.

HAHAHAHAH
IM LEGIT RETARDED AT MATH PROBABLY 4TH GRADE XD I should try something different .__. something i have some genetic goodness with..

Maybe that's what I should do is lurk some social circle..maybe here lol

Having issues with math isn't so bad if you can get the logic behind it.

I think it's best to find something you want to make and learn by making that better. It's kinda hard to start out with no goal other than to learn and with no teacher.

Well the thing is...programming is a means to an end. I want to create a world in final fantasy 7 a home where I can live in for comfort. I need to be able to program for that but also I have another goal of living with off the grid in Japan in a village and if I have to fight through pain of mathmatics than I gotta fucking try. I can't tie my shoes or swim but I have dreams and techmogy is fun but it's also a means to an end.
Always wanted to make a living making people laugh but standup comedian isn't on the table. Maybe write weird books idk..in capitalism to survive you have to implement every crazy idea and not get distracted.

Attached: 1527643784520.jpg (301x385, 39K)

This guy is right. Math makes a lot more sense if you can get your head around logic structures first.

Go check out the Euler Project and see if you can work through the questions. Will learn heaps if you commit yourself.

make tic tac toe or some shit
make it output to a shitty string like
_ _ _
_ _ _
_ _ _

I'll try..I can't even get anything going on my Linux I'm so fucking dumb .__. at least I'm trying I guess

I'm checking that out now. It's pretty cool tbqh even tho it's hard. Ill keep trying tho

Attached: 1527644129136.jpg (570x692, 98K)

you don't need linux, just run your python shit in win10, and it'll work fine.

you don't need a whole operating system just to start learning how to program

I have two thinkpads that I use for different stuff. My Linux one is for "work" which is basically just reading books practicing command line other various stuff.

My windows one has python all hooked up and ready to go with pycharm but I'm lazy and don't want to grab it especially it's just my final fantasy 7 box.

I get what you're saying tho...I just want to get some programming on my Linux just cuz I'm on it more lately.

Does vcvarsall.bat define any variables for detecting whether it was initialized in 32 or 64 bit mode? I'd like to know for a makefile so that I can choose which LIBPATH to include.

I wish I could get lonely. I spend most of day with my team and I'm so sick of people, solitary confinement is starting to look like heaven. I don't know how people do it desu, they spend 12h with other people only to come home to wife and kids I think I'd kill myself or them. People are so draining, I just want to be left alone and play games not work and trying to meet deadlines. user you are lucky bastard its only shame you dotn realize it

pretty slowly, still absorbing theory
>lambdas not closures
>simple but strict type system
>inlined assembly
>lexical scoping
>possible arch-independent IR interpreter with JIT or compiled to x86 or arm machine code
>experimental LLVM bindings that I'm never going to finish
>modules
>shell and some runtime debugger
>not sure what the state of art debugging is, heard some names like DWART, have to look at this
>single-threaded because I'm brainlet
>manual allocation with smart pointers that die with lexical scope unless moved, not sure if statically or dynamically
well a lot of space for experimentation, it's a toy project afterall

>SICP for python
in what sense? SICP isn't about Scheme, it just uses it because academics don't care for language that reflects what computers do
you can do SICP exercises in python if turn off the recursion limit

and people told me perfect code doesn't exist

Is there actually anything wrong with Go?

you forgot enforced braces around if/while/for/... condition

In C++, how do I get the actual type of a variable to use in the build in is_type_...() functions? Code related does not work.

float f1 = 1;
if (std::is_floating_point::value) {
std::cout

That's subjective, try and see it for yourself.

Any good literature on C/C++ and ASM?
Plannon on having sexi tiem with charlies angels (if you know what i mean)

>How do you deal with isolation and loneliness as a programmer without turning to drugs?
I make friends, duh.
Its not hard, go where people conglomerate and just start talking with them, if you have a hard time talking to people then gain the confidence and read "How to make friends and influence people". Want to find people into theatre? Go to a theatre club or on operah house or whatever. Programmer-friendos? Programmer club.

If you want to keep bitching though and put in no effort into getting out of this funk, then just fucking end it loser.

I did, and it seems pretty good, but everyone has some kind of psychotic hate boner for it aside from web tards, so I feel like I'm missing something beyond the common complaints.
Assembly in general, or is there a specific ISA you wanted to know about?

typeid isn't the same as decltype senpai.

wut? do you mean decltype?

>Assembly in general, or is there a specific ISA you wanted to know about?
NASM more specifically, switched to linux from windows and its super comfy

In addition, you learn the skills of social interaction from trial and error, which give you great bonus skills for the future (employers want non-autistic programmers more than they want programmers)

>I did, and it seems pretty good, but everyone has some kind of psychotic hate boner for it aside from web tards, so I feel like I'm missing something beyond the common complaints.
People hate it because it's a relatively modern language but doesn't have the features they consider "modern" like generics or sophisticated type system. I always treated it as high-level C, so I wasn't really bothered.

Im optimizing project i've been working on, its at 7k loc of javsscript (its bussiness web application for proccessing and inserting data). Client wants everything snappy and instant.
I replaced bunch of stuff and now all data is loaded instantly though it doesnt have same functionality yet. I discovered 10 bugs or so... does it ever end this cycle of add feature, create bugs, fix bugs, refactor....

And don't forget to abide by the new updated CoC and it's girl (male) "steward"

blog.golang.org/conduct-2018

That makes a lot more sense than the usual comparisons. I was just worried I was about to fall for PHP 2.0.

>want to make presentable github profil
>finally enough skills to make projects that look good
>can't think of a nickname

Attached: 14004028.jpg (800x522, 28K)

Why not use you real name?

because it sucks

let me give you one, q0qbreath

Your name is not important.
You just need to make sure you have a cute anime girl as the profile pic.

In my opinion using real name looks more serious and projects confidance. If you were empler looking at potential employees repo with nick superhaxxor or whatever really and some random picture, would you think well of this employee? Does he seem adult, responsible? Or?

This only affects people involved in developing the language itself.

I don't know why people care about those things at all. How does the CoC prevent you from writing programs in a particular programming language? What is the "Go community"? If I open a project on GitHub in Go do I automatically belong to it, regardless if I want to or not? It's not like they can stop me from using the language or delete my repos just because I don't abide by the CoC.

Not my custom language but I hear F# team is working on typeclasses

No idea what I'm doing.
No features atm because it doesn't exist yet.

Oh, thanks. I'm not familiar enough with C++ yet to know all the keywords.

What book to read to learn programming?

this is both disgusting and impressive

sicp, unironically

Attached: 1507559416263.jpg (1280x720, 500K)

sicp, ironically

Attached: 1_DCzEYU60hk2pO7WCJj3GoQ.jpg (1000x1414, 347K)

But user, the perfect language already exists..

Attached: 1506761900557.png (256x256, 4K)

sicp and scheme don't teach you programming because everything is too high level. and dynamic shitlangs poison your mind.

I though you guys might be interested, I've found an .epub version of the third edition of Computer Systems: A Programmer’s Perspective on libgen

Attached: d4daa126c3a05cdbddd8a55ca2dcf691-d.jpg (389x500, 28K)

Use your initials

When making projects along with your internet friends, do you use your real life github account or make a separate one?
If it's the same account, does it mention any of your real life information?

Attached: potential employers looking at your resume.jpg (625x322, 125K)

> do I use Pu$$y$l4v3r9000 or ymous.user?

Attached: 1507555328650.png (89x18, 660)

I only have a single github account. It mentions my real name (not as the handle, though), my real email address, and what country I live in.
It has the most important detail though: I use a cute anime girl as the profile picture.

Attached: 1418006520547.jpg (1280x912, 497K)

I'm sure its possible to have a username that's relatively 'normal' but doesn't identify yourself.
My question was more about whether I should dox myself to internet strangers or have a couple of projects that I would never be credited for.

>mentions my real name
>cute anime girl as the profile picture
That's the worst of both worlds.

There is enough sugar in this picture to give you diabetes.

Just use your handle you'd use for anything, like steam/games, or social shit
No one's swatting you for your shitty python scripts

>That's the worst of both worlds.
I don't really care. I've done a fair bit of serious work on that account, and I want it to be attributed to me.
Also, I've been using that profile pic for ages so people would have associated it with me, and I wouldn't want to change it anyway.

at least there is Jow Forums bros

JS obviously as it's been proven, but if you're a Jow Forums user just get a shit 90s style gtk theme and you're good to go for your monouser interface

B-but I am [spoiler]pajeet[/spoiler] and /dpt/ would bully me if it finds out.

Attached: haya.jpg (288x401, 74K)

Go back to sjwfox

>tfw ywn be in loli room
>tfw you'll just ldar
s m h t b h f a m

Attached: 1527625325875.png (592x128, 46K)

typescript with react or kotlin with tornadofx

Ain't that the truth.

>still using 'sjw' in 2018

Attached: zKHMYRn9ZDfq9n5mcmaXvyn6YSfxo8T_zVYQaaO2GLY.jpg (566x767, 107K)

...

...

now i am stuck. what is even the difference of static block vs constructor

a static initializer block is executed when the class is loaded

there are nonstatic initializer blocks and those are executed before the body of any constructor

static blocks run in a static context when the class itself is loaded. Constructors run when you new Shit(1) an instance and can get parameters. There can be multiple mutually exclusive constructors. Blocks that aren't static also exist, in which case they are executed at instance creation as well.

While I don't think writing gui is hard (tedious at worst, more fun to automate). I do think it'd make sense to have a gui library that autogenerates gui representations for features through some high level user-experience description. I haven't seen that yet.
Something that takes a set of expected user command line representations of program usage that ranks and presents these options well. For instance if you wanted a gui for ffmpeg that lets you crop video you describe where it gets its image background for the min-max coord UI element that lets you place two points. You'd simply describe where the points end up on the command line (or if we're doing libav, you'd place a special get call in the source) then you describe the rest of the requriements/constraints to the UI.

Almost tempted to write this right now.

Attached: 1523980382949.png (1280x720, 519K)