/dpt/ - Daily Programming Thread

Old thread: Javascript best language edition

Other urls found in this thread:

di.unipi.it/~nids/docs/why_you_should_learn_c_but_probably_never_use_it.html
pastebin.com/ZKxCv7bX
twitter.com/NSFWRedditVideo

...

Exactly. It's insanity.

First for if you're not using c++ you're wasting you're time

guys please. I need a good answer here.
pick one option:
C -> C#
or
C# -> C

C# -> C#

They only share syntax, they're both very different from one another so it doesn't matter

post a screenshot of your programming environment

that isn't an option
or you could look it at another way - it's a logical conclusion of any of these choices
but wouldn't some languages be naturally better for learning first compared to another "similar" one?

>What happens if i do this?
>What result will that give?
>Will this compile?

I always end up doing trial and error programming. Is this really how it should be?
I can't help but feel i'm doing it wrong.

i really like this gif
can i save it

ye

> he's not programming on his phone

just jerked off

please guys
Need an answer on this one.

Are there non-assembler cache-aware programming languages?

Threadly reminder that you should not refer to the act of programming as coding. It is improper and makes you look like a 16 year old

You are a programmer, not a coder

Software Alchemist is GOAT
Developer is okay
Magician is okay
Software Magus is okay
Software Engineer is okay
Software Architect is okay
Computational Conjurer is okay
Information Systems Sorcerer is okay
Purveyor of Programs is okay
Code Guru is questionable

Archmage is reserved for only the most senior of programmers

Writing in HTML and CSS is not programming, therefore it should be referred to as designing

Assembly

What is O-Auth good for?
I just used a POST request to the endpoint and that was it. Everything worked and I didn't use any O-Auth library

Threadly encouragement to fuck off.

Can anyone please be so kind as to answer this?

Any beginners guide for embedded programming with C or asm ?

so python question
I have the following code but want to know if there's a way to make each value save if that makes sense
repeat = input("Enter how many times you would like the script to repeat")
for i in range(repeat)
number = input("Enter your number")

so if the user makes the script repeat five times I want to be able to add up all the five numbers he enters (for example) the key aspect is the user can pick how many times the script repeats and only enters one number each time it repeats

this isn't homework just looking to improve a script I'm making

>that isn't an option

something something prepositional logic

in Haskell this is just replicateM

request :: Read a => String -> IO a
request s = do
putStrLn s
readLn

results :: Read a => IO [a]
results = do
repeat

I'm writing a programming tutorial for young kids

So do you love working with young kids?

are you writing a tutorial for yourself?
LMAO

...

How would I write a tutorial for myself

No but I am interested in how people learn how to program

Answer this god damn question then.
Just pretend i'm a young kid

Neither you retard

What? WHY?!

>No but I am interested in how people learn how to program
Kek. It varies by people. Depends on talent and innate ability too.

Also, look at Colobot/Ceebot. The idea is cool.


C then C#. Honestly in a way C is simpler and teaches you some under the hood stuff which languages like C# / Java don't push that much or even abstract it away totally.

It's enough to get good grounds in C then you can move on to something else.
However I would be interested to know why?
C and C# has nothing to do with each other, so why?

>tfw unironically love working with kids
>tfw not a degenerate just want the kids to have a wonderful childhood

Learn scripting shit like ruby

it's the easiest way to actually get useful programs going so you'll stick with programming

>>tfw unironically love working with kids
I hope you aren't a porn actor.

C first any day

di.unipi.it/~nids/docs/why_you_should_learn_c_but_probably_never_use_it.html

literally this famala

finally finished my course completion work (is that how it's said in english?)

It was a small nightmare but most things went well

I had to make an C# application, an SQL database and a windows phone app

the entire work was basically:
database
C# program
Java program
asp.net website
android app
windows phone app

the rest of these things were made by the rest of my group

Having to write a bunch of unit tests for this codebase for a class. No documentation on the code, so no idea what it's actually supposed to be doing in a few places.

>Cfags will defend this
#include
#include

int main(){
float the_measured_angle;

puts("Addition");
for(the_measured_angle = -360.0; the_measured_angle < 360.0; the_measured_angle+=0.001){
printf(" %7.3f\n", the_measured_angle);
}

puts("Multiply and Divide");
the_measured_angle = 3.0;
for(int i = 1; i 0.001;
package Angle_IO is new Ada.Text_IO.Fixed_IO(Angle);
The_Measured_Angle : Angle;

begin
Put_Line("Addition");
The_Measured_Angle := -360.0;
while The_Measured_Angle < Angle'Last loop
Angle_IO.Put(The_Measured_Angle); New_Line(1);
The_Measured_Angle := Angle'Succ(The_Measured_Angle);
end loop;

Put_Line("Multiply and Divide");
The_Measured_Angle := 3.0;
for I in 1..100 loop
Angle_IO.Put(The_Measured_Angle); New_Line(1);
The_Measured_Angle := The_Measured_Angle * 1.001;
end loop;

end Fixed_Point;

>a windows phone app
What third world country is this?

It'd be platform specific wouldn't it? Try an arduino

Can you define good grounds in C?
What do you mean by why? I don't get it.
But I'm not scared of anything and I don't care about scripting. I just want to know the answer. I don't need something to make my stick with programming since I'm already pretty interested.
Thanks mate I'll read it right now after masturbating

What kind of programs are you currently thinking of writing? :^)

>Can you define good grounds in C?
It's late, sorry. I meant that it's enough to get good in C then you can move on. You don't need to do everything in C, but knowing it at a somewhat competent level is helpful. Unless of course you want to work with that kind of shit.

It would help if could explain what is your background, how much do you know about programming and why did you make that C->C#/C#->C post.

brazil

it was basically to inflate the work, it was supposed to be a windows phone 7.1 app, so we had some experience with xaml basically

*answers this question*
I see. That's what I'll do I guess.
*answers the question about my background*
Anyone else willing to answer this?

C# -> C

you'll get bored way too fast with C first
just learn C#, make some programs and shit, and when you feel you're ready, go to C, it'll be less painfull

C# is better for learning first because it's easier

at what point should I get bored?
0_0

when you're trying to make simple stuff and failing miserably because of simple details

always go from the easy language to the hard language, not the opposite

>0_0
C# handles memory allocation by itself with garbage collection and some other stuff. You gotta do all that stuff yourself in C. You'll get bored with C because instead of doing programming that results directly in the stuff you want to do, you have to handle a lot of the intermediary stuff behind the scenes which can get tedious

Anyone care to help me out with some geometry?

This method is intended to create a grid of hexagons, but the results are bonkers. I must be doing something fundamentally wrong. Any ideas?

pastebin.com/ZKxCv7bX

anyone willing to offer counterpoints to this?
would it hurt in the long term if im not retarded and I can adapt to harder stuff/concepts over time?
I guess that makes sense as well.

>anyone willing to offer counterpoints to this?

NO! NOW LEARN C# GOD DAMN IT!

(゚∀゚) angry post!

I'm making some hot chocolate

i'll be making some soon too.
just ate a whole bunch of spicy food

FIRST LEARN THE EASY STUFF, THEN LEARN THE HARD STUFF

IS THAT SO HARD TO UNDERSTAND?

I think literally every CS program in the country will have you start on a language like C#, Java, or Python first, then you'll learn C or C++ in like, your 3rd year of college. You won't suffer for learning C# first. You have to learn to tie your laces before you learn to walk

>Not knowing what a wizard is...
GTFO you fuck. Go and read the jargon file.

but it's hard and easy at the same time
it's hard in that its literally hard
but it's easy in that it's more "basic" so to speak
i don't recognize university programs as legitimate
but your second/third point makes sense

I'd say it depends on which features do you need in the language

but probably go with c#

i wish I could answer this question mate but if you absolutely need an answer
*answers your question*

first you learn how to use a pen, then you learn how to make a pen exactly how you want

In Europe it's the other way around, at least here, for both CE/CS. You start with C in the first semester then Java + Assembly the next. After that C++.

>I don't recognize university programs as legitimate

It's your choice. The other reason that they teach these languages is because it's easier to teach algorithms and data structures when you don't have to get lost in the details of memory management

I'm considering writing a small access point and or router from the ground up, no OS. It's not gonna be some major thing tons of people rely on so it's not that important that everything is super rigorous or anything. I know networking but I'm questioning I'm thinking through all the things I should.

So I'm just wondering if any of you know of any small open source embedded networking systems I could look at? Preferably very small. I can't imagine the entire piece I'm writing should be more than 10k SLOC at most. And I'd like to find something around that size.

Preferably in C.

The amount of codemonkeys in this thread are astonishing.

Learn C first. Know the machine, then you can move on to C#.

Does every college in Europe really have the same curriculum?

why would anyone fucking care how universities teach shit? they aren't efficient in any way especially if we're talking about e*rope
i didn't say that particular choice was bad. i said that universities are not a legitimate source of choosing a learning method. they are literally shit
what would you define as learning c?
yeah it's probably mandated by the eu as well. nothing surprising it's fucking e*rope we're talking about

what are your objectives?
what are you trying to accomplish?
what timelines are you working with and what's your prior knowledge?

are you trying to ruse me?

>Algorithms and datastructures
Not that guy but I hear this so much I'm questioning what else you learn at university. Really those two are no big deal. Where's the code architecture courses, modern programming for modern computers, Principles for API design and such things?

You're probably good at programming, but you probably don't know shit about teaching.

>making useful things is less important than understanding every little thing about it

it's like saying:
>hurr durr why don't you grow your own vegetables instead of buying them??

*answers every single on of your questions except the last one*
no i'm not. i just want an answer!

>-359.930 + 0.001 = -359.928
Thanks C

Since some people can be really finnicky about how input is done, what's the best way to handle input in Javascript?
I'm doing WebGL stuff, and I've made a pretty good WebGL engine, but I've not once made Javascript that can take input.

Learn intel micropts first. Know the machine, they you can move on to C.

>learning C
Learn the basic hello world stuff, control flow, loops and simple memory management (malloc, free and a few pointers on how you could use it). And pointers.

It's a small language, should deal with that much in maybe 3 weeks or so to know it fairly well.

Don't bother learning the entire standard library.

lmao
i already have a good enough grasp of all of that
this can't be all, right?
i haven't built anything complex with it though.

No. Not at all. Varies a lot university to university. The legitimacy of a degree region to region is an issue solved by external agencies usually.

i would have to learn a little more about pointers though but i'm doing that right now as we speak, i was anyway before righting these posts.
i'm sure this can't be all there is to learn to say you know even the basics of C. or am I wrong?

No, that's why I said "around here".

Although there is ECTS so you can transfer credits.
Most CE/CS courses in my country do focus on knowing the underlying shit though. You will probably know Java by the time you reach Algorithms and Data Structures I.

On the other hand, it's not that good in some ways. Those who can't do it will either get rekted in their first year - time to retry next year - (pass rate is 30% in some subjects) or they will simply drop the fuck out.

>why would anyone fucking care how universities teach shit? they aren't efficient in any way especially if we're talking about e*rope
What? Please don't be angry, but American universities started out in the early 20th century by modeling European universities. For example MIT. Don't spout shit about stuff you don't know.
All I was doing is making a counterpoint to anons university example.

Well try and imagine something you couldn't do. What you probably end up with is specific OS interfacing things like networking and graphics. Knowing that amount of C lets you appreciate when other things become a burden. It lets you understand there's a path outside of OOP for instance. Which many OOP programmers struggle with.

Whether you can grasp C on first time when you get introduced to programming is a major breaking point. It decides whether you are more of a code-monkey or real programmer kind of guy with possible interests in CE/EE.

On the other hand I do know about teaching programming.

If the guy is a pleb then I would start with either Python or Java.

However if you're all by yourself, then it's ok to try out your limits.

Well its deceptive in how simple it is, just being imperative language. But interfacing with computers isn't all that hard so it's to be expected.

I was just saying that when you're done with that you can decide to make something or you can decide to learn more in other areas.

Have you ever gone to university? Here's how it goes in America:

>1st year:
>Some social science class like Gender Studies
>Stupid University 101 course
>English 1
>Math pre-requisites depending on how you did in highschool
>electives
>two basic java/python classes

>2nd year:
>more social sciences
>more math
>more electives
>algos/data structures and computer organization and architecture

>3rd year
>more math
>general science requirements, like physics or biology
>Systems programming, software design, maybe 2 or 3 cs classes

>4th year
>more cs classes
>maybe some higher math
>maybe 1 or 2 electives

Social science departments get their budgets by leaching off of engineering majors. We have to take english and shit but do they have to take CS? Noooo

Knowing C is nowhere near that level. Honestly if you can't grasp pointers and C then you're a codemonkey.

It's an effective way to kill of idiots. Maybe you learn it first, but you should definitely do.

On the other hand, most people who come from a very high-level language are usually utter shit in a lot of programming/computer concepts.

What should I work with in OpenGL: Pixels or clipspace?

>Well try and imagine something you couldn't do
well that isn't hard lol
pretty much anything besides what I can do.
> What you probably end up with is specific OS interfacing things like networking and graphics.
yeah I guess.

so in your opinion I should get better with C and then move on to C#? or is now the time?
You could say I know all of the shit in I will definitely in a few days.

Yeah. It can't be this simple. Haven't really encountered any major thing I couldn't grasp by thinking about if for a while.
didn't really understand your second line though.

Ehhh

at least it makes people well rounded or something

>second line
Well I'm just saying. Computers are just machines that take some numbers, does some math on them and then places them in memory somewhere. That's really all computers do. Audio is just a bunch of numbers the sound card takes care of to make the speakers vibrate. You just have to do whatever you wanted to do with them and then move them to the right place. Usually you have an operating system between you and the sound card. Which just means you ask the OS where to put your numbers.

The basics isn't really hard at all. So because C is relatively low level just doing things becomes pretty easy.

See handmadehero.org for instance. They do a game from scratch. It's probably pretty interesting for a new programmer like you to look at the first few videos. Because he very quickly gets far while doing the very basics.

Why don't art majors have to be well rounded

ah, you've tracked down america's obesity problem.

So universities can make money

it would be pretty good for them to at least take some physics and math but it will never happen

what's the best way to get gcc or clang on windows these days

>gcc

mingw

if you don't know C, there's a good chance you don't know your program works