[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

/dpt/ - Daily Programming Thread

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 374
Thread images: 28

File: 1498117439710.png (9KB, 637x130px) Image search: [Google]
1498117439710.png
9KB, 637x130px
Old thread: >>61018062

What are you working on, /g/?
>>
>>61024201
Daily reminder that if your language can't shuffle actions, then it's shit.
>>
>>61024201
Daily reminder that coders aren't the same as programers
>>
>>61024249
Daily reminder that coders is a misnomer, you aren't writing code, you're writing instructions in a structured and readable language that is interpreted or translated/compiled into something your computer can execute.
>>
File: 69f.jpg (168KB, 1200x684px) Image search: [Google]
69f.jpg
168KB, 1200x684px
can someone recommend me a good book on writing JS that isnt shite?
>>
>>61024201
Daily reminder that all programming languages are shit, and programming is a retarded waste of time.
>>
In python I want to return the value or 0 if the value is lesser than 0
I have the feeling there must be a simpler way than what i came up with
( filter(
( lambda x: x > 0 ), list((-4,)) )
or [0]).pop()
>>
>>61024299
This picture confuses me.
>>
>>61024299
depends. All JS is shit so hrm.
>>
>>61024299
nope, JS is shit, so their books can only be worse
>>
File: dL6uznT.jpg (162KB, 680x680px) Image search: [Google]
dL6uznT.jpg
162KB, 680x680px
>>61024308
shes autistic
>>
>>61024309
>>61024316
but i need to learn web dev in a matter of days
>>
>>61024307
return value if value >= 0 or 0
>>
>>61024332
What? What is this "web dev" you speak of? What could it possibly mean?
>>
>>61024307
This shit is what happens when Lisp programmers attempt writing imperative language.
>>
>>61024344
Bullshit, no self-respecting lisp programmer would fuck up their parens that badly.
>>
>>61024307
return value > 0 ? value : 0;
>>
>>61024342
basically i need to learn how to do OOP in the browser with JS
>>
>>61024332
why? even if you are really good at it, you will only produce crap in a saturated pile of crap called "internet". Make the humankind a favor and stop using scripts on websites.
>>
>>61024371
i need to land a job with a web based company
>>
>>61024334
why is python's ternary operator so fucked
>>
>>61024400
Because you shouldn't use ternaries in the first place, they convolute your code.
>>
>>61024382
That's ok, you are young, need that little money to convince your woman to reproduce and shit. But guess what? you don't need to be good at it, you just need to convince the employer. Then he will say: why should I pick you instead of Mr. Rajeesh when he cost me only $22k at year?
>>
>>61024299
JS the good parts.
JS might not be the best.
But its certainly not shit
>>
>>61024367
Look at the series of books 'You don't know JS' if you really want to understand the inner workings of javascript prototypal system (which is shit)

If you don't understand that, you'll set yourself for a future suicide
>>
File: 1493618122608.jpg (199KB, 1280x1689px) Image search: [Google]
1493618122608.jpg
199KB, 1280x1689px
>>61024201
Trying to create a program which given a language computes whether it's shit or not.
>>
>>61024444
Here:
return true;
>>
>>61024306
excepting lisp languages. them being programmable programming languages, they are only as shitty as you make them to be.
>>
File: ddd.png (86KB, 935x659px) Image search: [Google]
ddd.png
86KB, 935x659px
>>61024430
Pic related is what happens internally once you have the bad idea to try to mimic OO code in a language that was primarily built for behaviour delegation

Javascript IS shit. And this comes from someone who uses it daily for most of his coding
>>
>>61024473
they are shit by themselves, and being programable you can make them utter shit
>>
>>61024473
>them being programmable programming languages
What are you going to mean by that?
>>
>>61024473
>lisp is perfect until the programmer makes it shit by actually programming in it
All languages are perfect until anyone tries to actually do anything in them
>>
>>61024507
https://en.wikipedia.org/wiki/Language-oriented_programming
>>
>>61024201
Making my compiler user-friendly.
>>
>>61024509
>All languages are perfect
Nope. Any POOlang is defined to be shit.
>>
File: shit.png (29KB, 548x425px) Image search: [Google]
shit.png
29KB, 548x425px
>>61024430
Also, prototypal delegation is fundamentally flawed as a sytem to emulate class-oriented languages, and creates all sort of problems, pic related being just one of the more apparent

There's plenty of subtle, catastrophic situations you may run into in this horrible language if you need to create anything that is not trivial
>>
>>61024531
>I failed Introduction to Java and now I'm going to rant about it on /g/ - the post

kek
>>
>>61024544
what's wrong in your example?
>>
>>61024547
I wouldn't ever study C*. I'm not subhuman.
>>
File: cvcfvt[1].png (4KB, 206x176px) Image search: [Google]
cvcfvt[1].png
4KB, 206x176px
why is this allowed /g/
>>
>>61024560
>wanting to learn OOP
>not learning Smalltalk, OCaml or at least Simula-67

Pleb
>>
>>61024582
I know at least one of those languages. It doesn't change the fact that any POOlang is defined to be shit.
>>
>>61024201
>What are you working on, /g/?
enterprise quality lisp interpreter in java. I already have 17 classes and it doesn't even do anything yet :^)
>>
>>61024561
>doesn't know how floating point works
>>
>>61024600
>:^)
>>>/v/
>>
>>61024596
>POOlang is defined to be shit.
Reported for being under the age of 18.
>>
>>61024612
le mad?
>>
>>61024612
fuck off


btw I'm going to take a break and work on my video game in electron javascript html css for a bit
>>
>>61024625
>reddit spacing
>>
File: 1484589609504.png (439KB, 720x720px) Image search: [Google]
1484589609504.png
439KB, 720x720px
>>61024561
>his ""language"" doesn't support real numbers
>>
>>61024561
What is numerical analysis and what relation does it have with computers
>>
>>61024371
fucking this
STOP
FUCKING
USING
SCRIPTS
ON
WEBSITES
MOTHERFUCKERS
WEBDEVS
>>
>>61024371
>>61024652
Fuck off, grandpas. I like getting push notifications.
>>
>>61024678
then "push" them deep into you anus
>>
>>61024638
no, that was actually double reddit spacing
>>
>>61024334
>>=
>or
do you also put a break statement after returning the value?

'just to be sure
>>
>>61024201
I am about to finish E Sports betting website. Wrote it with JS. I gave money to freelance designer. Soon ship it with advertisements.
>>
>>61024780
The or is obviously a mistake, it should have been else.

>= is just autism. Technically, if value is 0, it isn't less than 0. In this case it doesn't really matter, because it will return 0 when value is 0 either way.
>>
>>61024652
Why not
>>
>>61024334
>>61024363

can this statement be done with using value only once
>>
>>61024678
same here
>>
>>61024826
>>61024881
Fuck off tripfags
>>>/trash/
>>
File: 1453302491365.png (129KB, 314x278px) Image search: [Google]
1453302491365.png
129KB, 314x278px
>>61024639
But anon, it's impossible for a computer to support real numbers.
>>
>>61024922
>not having a decimal computer in a shielded room
>>
>>61024912
I'm not going to fuck off anytime soon
>>
>>61024949
But there exists real numbers which are not algebraic, so a computer cannot possibly have a representation for all real numbers.
>>
>>61024851
tmp = value
return tmp if tmp >= 0 else 0
>>
>>61024964
figures you'd be a pajeet
>>
>>61024983
welcome aboard
>>
>>61024983
?!?!

>>61024851
I don't think so. But you can use function like
return ((value+abs(value))/2);
>>
>>61024307
return value < 0 ? 0 : value
>>
>>61024678
>what is RSS
>>
>>61024851
Or something like this

#include <iostream>

#define X(a) a*(a>0)

int main() {
int value1 = 5;
int value2 = -5;
std::cout<<X(value1)<<" "<<X(value2);

return 0;
}


Not sure if it can be implemented in python tho
>>
>>61024851
I got it
return max(0, value)
>>
>>61025180

._.

I am dumb
>>
>>61024851
return {'v': x for x in [value] if x > 0}.get('v', 0)
>>
File: 1496830205398.png (371KB, 700x700px) Image search: [Google]
1496830205398.png
371KB, 700x700px
>>61024922
Just define the type of real numbers.
>>
>>61024994
maybe, but I got you job, redneck
>>
>>61024639
import std.stdio;

void main()
{
sum(34, -9.34).writeln;
}

auto sum (real x, real y)
{
return x+y;
}


$ rdmd main.d
24.66
>>
>>61025180
And yet "under the hood" value is used more than once
>>
>>61024780
Since when did python have monads?
>>
>>61025284
Floating point garbage.
>>
>>61025192
this is beautiful actually
>>
>>61025311
Where does the word "float" appear in the post you replied to?
>>
>>61024968
https://www.youtube.com/watch?v=LJQgYBQFtSE
>>
@61025322
Do you even study your own retarded language?
https://dlang.org/spec/type.html
>>
61025351
Where did I claim so/otherwise?
>>
^
Fuck you and your ignorance.
>>
>>61024290
Is this the new GNU/Linux copypasta?
>>
>>61025254
>>61025329
How does one exactly represent pi in such a system?
>>
>>61025286
Most likely since its unfortunate inception.
>>
>>61025437
7/22
>>
>>61025437
  pi = 16 * atan (fromRational (1 % 5)) 
- 4 * atan (fromRational (1 % 239))
>>
>>61025456
Does this terminate?
Does this have infinite precision?
>>
>>61025461
Yes to both
>>
>>61025470
But that literally cannot fit into memory. I feel like you're lying.
>>
File: pi-in-a-bible-2-638.jpg (80KB, 638x479px) Image search: [Google]
pi-in-a-bible-2-638.jpg
80KB, 638x479px
>>61025437
3
>>
Is C a good language to learn stuff in without being raped my language specific ideologies and libraries? I just want to be able to type stuff into like notepad++ or some alternative, build the code, and then see if I made something faster or shittier or better.

I've been programming for about two years now. I've used mainly C# but I'd like to learn how to write platform independent code (or rather code that IS native code but has an easily transferable entry point and minimal platforms specific dependencies so its basically actually cross platform, however is not a runtime language). I've also used Python, Lua, Java, minimal C and C++, and I've been using Godot for game development which uses its own scripting language that's similar to Python.

Somewhere down the line I'd like to make cool games that are heavily data structure/design based and far less graphics based (think games like Out of the Park Baseball, Dwarf Fortress[though I know DF is actually a rather unique type of design because it is REALTIME and the gameplay is directly tied to the actual FPS/Pathfinding etc, it functions more like a physics simulation based game than it first appears.])

Anyways I have no formal education, game programming books mainly discuss graphics rendering and code structure in terms of an entity component type based thing with viewports and whatnot, I've been reading "Game Coding Complete 4th Edition".

Basically what I'd rather learn right now is.
>The tools that work now and are being worked on in order to process and tranform data
>How to design programs that efficiently make use of those tools.

By tools I mean "a dictionary" but I also mean "XML or JSON". I realized what I'm looking for will not be condensed into one book or resource. The reason I was asking about C is I'm looking for a blank language that I can use to try out stuff that I read in articles and books and to legitimately learn with. I'd like to be able to become competent within 10 - 12 years.
>>
>>61025480
Stores it as a function.

Try it yourself if you don't believe me: https://hackage.haskell.org/package/numbers-3000.2.0.1/docs/src/Data-Number-CReal.html#CReal
>>
>>61025480
data Nat where
Z : Nat
S : Nat -> Nat

Does this also """not fit into memory"""
>>
>>61025497
How do I represent the smallest transcendental number after 0?
>>
>>61025453
>7/22
What does that have to do anything with Pi?
>>61025486
>B*ble says Pi equals 3
Even if it said that Pi = 4, it would have no affect
>>
>>61024473
>programmable programming languages
all programming languages are this
even assembly is this if you work hard enough at it
>>
>>61025527
You cannot represent something which does not exist
>>
>>61025527
A number being transcendental has nothing to do with it being computable.
>>
>>61025538
oh really? then show me how you would extends the semantics and syntax of C, for example.
>>
>>61025537
>What does that have to do anything with Pi?
I think it's a common approximation that engineers use.

>>61025539
But it does exist. Infinitesimals are "real".
>>
>>61025556
#define
>>
>>61025557
7/22 is no where near as Pi, do you happen to be an A**rican?
>>
>>61025560
syntaxic sugar which by definition doesn't alter the semantics of the language.
>>
>no where near as
What did this E*ropean subhuman mean by this?
>>
>>61025557
I thought they were hyperreal
>>
#define PI 3.14

This is more than enough for 99% of use cases. Prove me wrong.
>>
>>61025562
Oh right, it's 22/7. I guess he wrote it the wrong way around.

>>61025548
I know. It's some shit to do with the root of polynomials, but trying to think of non-computable numbers is hard.
>>
>>61025456
This doesn't compute pi to the nth digit though.
>>
repost from last thread

quick question for /dpt/

im a junior studying CS, about to go into my senior year. the thing is, i transferred to my current school from a community college, and the community college CS program was terrible. So even as an almost-senior to CS, I'm only like 3-4 actual programming courses in. i've done an intro course, 2 data structures courses, and a C++ specific class.

I have a basic understanding of pretty much all the basic concepts in C++; i.e. I have the approx. knowledge of someone who's gone through the Bjarne intro book.

my question is, where do i go from here? im still overwhelmed looking at open source projects, but i dont know what textbook or whatever to follow to get to that level? All the ones that go beyond the scope of basics just appear to be guides on good practices.
>>
>>61025537
>What does that have to do anything with Pi?
Whoops, wrote it backwards lol. 22/7 is what I meant
>>
>>61025557
>But it does exist. Infinitesimals
No it doesn't, there are actually no infinitesimals. There are differential infinitesimals, but wherever you use them, you're working within the context of an implicit limit, and outside that context, they're actually just 0.
>>
>>61025590
>but trying to think of non-computable numbers is hard
Here's a pretty interesting one
https://en.wikipedia.org/wiki/Chaitin%27s_constant
>>
>>61025601
>I have a basic understanding of pretty much all the basic concepts in C++
C++ concepts haven't even landed yet, liar.
>>
>>61025604
>pi is rational
Are you by any chance retarded?
>>
>>61025571
>write C in C
>change it as you please
>copy the source code
>modify it to work with the changes
>invoke it on the modified version
>invoke the result on itself
>>
>>61025631
is it even possible to define a new operator in C? I highly doubt it.
>>
Why in C a pointer defined but not declared can't point to NULL? Is there a reason behind this choice?
>>
>>61025619
ha ha ha
>>
>>61025648
>is it even possible to define a new operator in C?
Yes, by the procedure I describe above.
>>
>>61025490
If you already know how to program, you can learn C in a couple of weeks, but it'll probably take a fair bit longer to "get good" at it.
It is a good language for learning shit though, due to how barebones it is. You have to understand the fundamentals of what you're implementing if you're going to get it to work.

>>61025661
Phrase your question better. A code snippet of what you're talking about would be nice, too.
>defined but not declared
You can't define something without declaring it.
>>
File: NUL.png (244KB, 1920x935px) Image search: [Google]
NUL.png
244KB, 1920x935px
>>61025595
Did you actually try it?
>>
>>61025668
you are not programming the C language, you are creating a new language using C. I think you are completely misunderstanding what a programmable programming language is.
>>
>>61025691
That's not pi though. Fucking liar.
>>
>>61025661
>defined but not declared
This is not possible. You might mean "declared but not defined."
>can't point to NULL?
A pointer declared but not defined (i.e.
extern int*
) can't point to anything unless linked to a definition, because the address object itself--not the hypothetical object pointed to, but the object pointing--isn't allocated.
>>
>>61025691
I'm retarded, didn't notice the showCReal function.
>>
>>61025682
int *p; //this doesn't point to NULL by default
>>
>>61025709
That's a shame
>>
>>61025709
Uninitialised variables have indeterminate value. It may point to NULL; it may not. The value is just garbage.
At a global/static scope, this is different. They are all initialised to zero. However, on some implementations/architectures, a NULL pointer may not be represented by zeros.
>>
File: 1497943483459.jpg (20KB, 480x489px) Image search: [Google]
1497943483459.jpg
20KB, 480x489px
>>61025486
>this is how much line was needed to measure around it
>therefore the bible says pi = 3
>what is a non sequitur
>because the bible should have specified exactly what fraction of line was needed to measure around it
>because people back then were so stupid, they couldn't notice it was more than 31 cubits around
>being this desperate for an argument
m8, you have to find some new websites to fish your atheism from 'cause you're looking pretty stupid
>>
>>61025744
I asked why it couldn't be set to NULL by language standards. Is there a reason to do so?
>>
>>61025705
https://docs.oracle.com/javase/7/docs/api/java/util/Scanner.html

there is no scanner(string, string)
>>
>>61025694
>you are not programming the C language, you are creating a new language using C.
Not necessarily.
>write an interpreted C in C
>include programmability functionality
>your version of C does not violate the C standard
>it is therefore technically still C, and not a new language; it's just that some things that would have been ill formed C before are now implementation defined
>program in your programmable C
>use the programmability feature
>reminder that the language you're using it in is technically still C
>qed
>>
>>61025697
Prelude Data.Number.CReal> pi == (pi :: CReal)
True
>>
>>61025705
Where is the constructor for Scanner defined? That is probably why it is complaining. You are referencing a Scanner Constructor that does not EXIST within the scope.
>>
>>61025622
22/7 is a really handy approximation for doing mental math
>>
>>61025759
Efficiency reasons.
>>
>>61025780
>>program in your programmable C
no more c; your code would not compile on a standard c implementation.
>>
>>61025697
pi is pi, if you had a brain you'd see that he's showing pi truncated to so many digits
>>
>>61025589
what use cases?
>>
>>61025836
I was promised EXACT representations of pi. I want to see that exact representation printed out, in decimal form.
>>
>>61025832
Is setting to NULL so expensive? Probably one instruction in assembly.
>>
>>61025857
If you're declaring a lot of shit, it might just be. It's especially wasteful if you know you're just going to write over it later.
C is about giving control to the programmer; if you want NULL, set it to NULL.
>>
Anyone care to help a noob out? This class is supposed to read a file and print the lines that contain the given word, if the given word is a blank string it should just print the entire file.

import java.io.File;
import java.util.Scanner;


public class Printer {
private String filename;
private Scanner reader;
public File file;

public Printer(String filename) throws Exception {
this.file = new File(filename);
this.reader = new Scanner(file,"UTF-8"); // <-- no suitable constructor
}

public void printLinesWhichContain(String word){
if(word.equals("")){
String string = "";
while(reader.hasNextLine()) {
String line = reader.nextLine();
string += line;
string += "\n";

}
System.out.println(string);
}
else{
while(reader.hasNext()){
String line = reader.nextLine();
if(line.contains(word))
System.out.println(line);
}
}
}


please be gentle (or don't, its cool either way)
>>
>>61025849
That is a physical impossibility.
>>
>>61025759
>I asked why it couldn't be set to NULL by language standards. Is there a reason to do so?
Yes. C's types only describe an interpretation of the underlying bytes in terms of operations possible on them. Nothing more. Since zeroing out some types upon declaration but not others would be in excess of this, it would fundamentally change what a type "means" in a way that would prove undesirable for generic programming using sizeof, macros, and void*. If we zeroed out pointers on declaration, then to be consistent, we'd have to zero out everything on declaration, which would be a huge waste of processing time, especially in cases where it's necessary or at least helpful to declare something once and define it later. All in all, the tradeoff of not having to type the extra two characters ("=0") isn't worth it.
>>
>>61025906
I know. Perhaps people shouldn't promise the impossible.
>>
>>61025857
so do you auto-initialize every variable or just pointers? will variables then be initialized twice, once by the compiler and a second time by the programmer? is the impact of auto-initializing millions of variables insignificant?
you see, the question is not so trivial.
>>
>>61025911
I didn't promise you a decimal representation. Merely a representation.
>>
>>61025835
>no more c; your code would not compile on a standard c implementation.
but what does compile it would be a standard implementation. everything in excess of that would be making use of implementation defined behavior.
>>
>>61025897
if(word.equals("")){
String string = "";
while(reader.hasNextLine()) {
String line = reader.nextLine();
string += line;
string += "\n";

}
System.out.println(string);
}

change to
if(word.equals("")){
String string = "";
while(reader.hasNextLine()) {

System.out.println(reader.nextLine());
}
}
>>
>>61025922
I have another question for your silly "real numbers" representation.
How does pi * 2 work? (or any irrational number, really)
>>
>>61025944
You just write pi * 2
>>
>>61025958
But how is it calculated?
>>
>>61025962
  (CR x') * (CR y') = CR (\p -> round_uk ((x' (p+sy)*y' (p+sx)) % 2^(p+sx+sy)))
where x0 = abs (x' 0)+2; y0 = abs (y' 0)+2
sx = sizeinbase x0 2+3; sy = sizeinbase y0 2+3
>>
>>61025849
It is an exact representation of pi.
"pi" specialised to Real IS the exact representation.
He is showing you a finite decimal representation.
You cannot have an exact /decimal/ form.
>>
>>61025920
A mixed solution would be nice.
struct queue {
node *head = NULL;
node *tail = NULL;
}

>>61025920
Just pointers.
>>
>>61026001
>Just pointers.
That's inconsistent as fuck.
>>
>>61026001
>Just pointers.
See: >>61025909
In short, this would be a problem because types need to be able to be treated homogeneously.
>>
dumb question: in a system like a microcontroller, how does the cpu keep track of the memory allocated?
I have two major doubts:

I know that function addresses are stored in a FIFO memory called "stack", but where is the stack stored (ram, cpu cache? ) and how does the cpu know its location?

Then what about variables and the heap? who keep track of where data is stored and where does it keep a record of the addresses of any variable?

More importantly, where can I study this stuff?
>>
>this thread

proof that you don't need to know shit about math to be a programmer
>>
>>61026037
you seem to be quite easily impressed by some shitposting
>>
>>61025932
this is insane, you are saying that, for example, python is C since cpython is written in standard c.
>>
>>61024307
max(value, 0)
>>
>>61025480
Neither can your mum
>>
>>61026093
No, because the Python interpreter itself is not a conforming implementation of C.
What I'm suggesting is a conforming implementation of C whose implementation-defined behavior allows for metaprogramming. That is, you could only do it through means whose effects the C standard describes as undefined or implementation-defined. This may sound restrictive but it actually really isn't, because there are a great many operations in C whose effects the standard describes as undefined or implementation-defined.
>>
>>61026032
>function addresses
The location of functions is fixed and known by the linker. They aren't stored anywhere in particular.
Variables go on the stack.
>but where is the stack stored
RAM
>and how does the cpu know its location?
It's just a memory address. It depends on the OS or whatever you're using.
The program loader would set the stack pointer where it needs to be when the program starts, or it might be some fixed well-known location on something simpler.
>Then what about variables and the heap?
Again, very dependent on the OS. There is it bit of design that goes into writing a memory allocator, and I can't be bothered explaining it here.
>who keep track of where data is stored
The compiler (or assembly programmer), typically.
>where does it keep a record of the addresses of any variable
For stack-allocated things, a compiler already knows the stack-pointer offsets and just puts them in.
For heap-alloacted things, the memory allocator has some internal bookkeeping.
>More importantly, where can I study this stuff?
"Operating Systems Design and Implementation" covers a lot of that.

A lot of what I've said is very vague, because it's VERY dependent on the OS and CPU architecture you're talking about.
>>
>>61026032
>FIFO
I mean, LIFO
>>
>>61025490
>Is C a good language to learn stuff in without being raped my language specific ideologies and libraries?

C has many "language specific" ideologies and libraries.

If you want platform-independent code, consider Object Pascal. Lazarus/Freepascal, and its ecosystem, has a huge emphasis on making your code work the same regardless if you're putting it on a *nix or even Windows 3.1. Otherwise, Java/JVM is probably your next best bet, although a modern LLVM language (ie. Rust) would probably work well, and beyond that, C++ (I put Rust over C++ here, because a lot of older libraries, you have to pay attention to cross-platform compatibility).

C++ is the king of game programming, though, so if that's what you're interested in, why not go there.

Modern C++ has also filled in a lot of the "holes" that you still have to worry about in C, one such fix being RAII and smart pointers.
>>
>>61026166
This is one of the memiest posts I have read in a while.
>>
File: zc.jpg (24KB, 403x433px) Image search: [Google]
zc.jpg
24KB, 403x433px
Can someone redpill me on python?
>>
>>61025702
>>defined but not declared
>This is not possible. You might mean "declared but not defined."

Sure it is. But usually we just call that a "memory leak". ;)
>>
Least headache inducing way to create and handle databases in cpp?
>>
>>61026183

Tell my why I'm wrong.
>>
>>61026206
The C Preprocessor is utterly inappropriate for handling databases. It's just a simple macro system.
>>
>>61026206
Do all the database work in Haskell, use the FFI.
>>
>>61026234
>It's just a simple macro system.
very simple
>>
>>61026166
>C has many "language specific" ideologies and libraries.
Only insomuch that you have to deal with a lot of lower-level data and memory manipulation that you do in other languages.
Otherwise learning C and then moving to C++ or Java or anything else is like heaving a sigh of relief, knowing you don't have to micromanage your code so much anymore.
>>
>>61026264
C doesn't even have a string type.
>>
>>61026032
>where is the stack stored (ram, cpu cache? )
The stack is usually stored in RAM. How the CPU knows its location depends on a lot of things. Most importantly, is there an OS on the microcontroller? If so, the location of the stack is defined by the application runtime set up by the OS before launching. If not, there will be some chain of addresses, generally not needlessly long, eventually leading back to an address baked into the CPU, called the "reset vector," which describes where the CPU should seek to every time it power-cycles.
>Then what about variables and the heap?
In languages like C, these are actually two very different questions. The heap is also going to be stored in RAM, separately from the stack. They grow in opposite directions, and when they meet, your program has run out of memory. Variables, on the other hand, and information on their bindings, are actually stored on the stack.
>who keep track of where data is stored and where does it keep a record of the addresses of any variable?
Re. variables, see above. As for heap management, there's a component called the MMU, standing for "memory management unit." In the absence of an OS -- and, actually, in the presence of one as well -- it can take responsibility for allocating and freeing memory, and keeping track of where memory is allocated and how much. All this being said, if the microcontroller happens to not need multitasking, a heap may be unnecessary; dynamically "allocating" memory may be as simple as arbitrarily picking out an address and assigning to it. (Granted, you'll want something that statically keeps track of what's been dynamically "allocated" in this way, so that your program doesn't stomp all over itself, but you don't have to worry about stomping all over other programs, because there are none.)
>More importantly, where can I study this stuff?
Google, Wikipedia, and Stack Overflow are pretty good resources.
>>
>>61026263

It is, it's what people make on top of that which is complex.
>>
>>61025943
still isn't printing anything :/
>>
>>61026146
ok, thank you.
I realized that I don't know anything about this stuff studying digital electronics. While I was messing with an FPGA and how to get it to write and read from ram I started wondering how a system keep track of where stuff actually is.
>>
unimportant poll http://www.strawpoll.me/13256565
>>
>>61026360
still doesn't work but it passed the automated test, whatever then.
>>
/dpt/, what is the maximum quantity of lads that a program can wew?
>>
>>61026367
>FPGA
Do you use VHDL or the inferiour verilog?
>>
>>61026489
How top are said lads?
>>
>>61026186
python cuck sjw jews something something reddit
you're welcome
>>
File: qtCreator.png (163KB, 1200x1200px) Image search: [Google]
qtCreator.png
163KB, 1200x1200px
/Python/

I have to write script in python that will work as exe with gui on windows.

What is the least problematic way?

Is Python 2.7 + Qt creator + py2exe good enough?
>>
>>61026499
>inferiour verilog
vhdl has been obsolete for a few years now. everyone in the industry has moved to verilog or a derivative.
>>
>>61026345
thank you as well.
Sorry for the even more vague question, I will look more into that later, but does it ever happen to a programmer to interact with the MMU, or is it an hardware component that works "transparently" (i.e. the programmer doesn't need to know about it)?
>>
>>61024444
lang.startswith("C") && len(lang) <= 3
>>
>>61026535
Qtdesigner, which is integrated in qtcreator, is a good place to start for making a graphical interface
>>
>>61026499
VHDL, because my uni teach VHDL, I never looked into verilog,

>>61026546
I heard that it depend a lot on where you live; verilog is more common in USA and vhdl in Europe.
>>
>>61024544
>being this retarded.

You are modifying the prototype, not changing the prototype assigned the class C. You stupid fuck. it's like modifying a pointer of a class's virtual method table.

class C {
constructor() {
this.num = Math.random();
}
rand() {
console.log("Random: " + this.num);
}
}

var c1 = new C();
c1.rand();

// copy C.prototype
var new_proto = Object.assign({}, C.prototype);

// change rand() in the copy
new_proto.rand = function() {
console.log("Random: " + Math.round(this.num*1000));
};

// set the modified copy as the new prototype of the C class
C.prototype = new_proto;

var c2 = new C();

c2.rand(); // has the new prototype
c1.rand(); // still has the preview prototype
>>
>>61026186
if only a girlmale that cute had autism
they are always smelly fatties
>>
>>61026546
Meh verilog looks so ugly.
>>61026605
Ah nice I really like vhdl sadly I don't get to work with it.
>>
>>61026644
>girlmale
i'd tell you to kill yourself, and in fact was in the process of doing so; but you got those sweet dub-dubs, so i'll allow it
>>
>>61024544
>class c
>var c1
>var c2

dude just do something else,maybe go be a carpenter, or a cop anything but a programmer.
>>
>>61026670
>Ah nice I really like vhdl sadly I don't get to work with it.
well, chances are that after this uni course I won't as well (except for hobbyism)
[spoiler]I'm doing a master in condensed matter physics[/spoiler]
>>
File: Picture of me 27.png (194KB, 480x480px) Image search: [Google]
Picture of me 27.png
194KB, 480x480px
>>61026489
public static void main(String[] args) {
String lad = "lad";
wew(lad);
}
public static void wew (String lad){
for(;;)
System.out.printf("wew %s\n",lad);
}
>>
>>61026324
C doesn't need a string type, char* is literally just as capable. Tell me one thing you can do with a string that you can't do with a char* and I will prove you wrong.
>inb4 concatenation
You can do that. Tell me you can't and I'll prove you wrong.
>inb4 concatenation specifically with +
This doesn't actually matter.
>>
File: fucklinux.png (85KB, 1920x1080px) Image search: [Google]
fucklinux.png
85KB, 1920x1080px
>>61025897
it works for me man

pic related, when the String word was "" it just printed the whole file
>>
>Some coding practices, like functional programming, recommend never reassigning a variable. In Java this is done with the final keyword. Python does not have a final keyword and it would be against its philosophy anyway.

oh fuck off, "it would be against its philosophy" is not an argument for not having a feature, it's an argument about how shitty "its philosophy" is

why are dynamictypingfags so delusional
>>
>>61026791
Thanks anon. No clue why it isn't working in my IDE, but it passed the automated tests so whatever.
>>
>>61026791
Also what theme is that?
>>
>>61026605
>verilog is more common in USA and vhdl in Europe.
maybe in schools, no more the case in the industry.

>>61026670
>Meh verilog looks so ugly.
then http://www.myhdl.org/
>>
>>61026851
Darcula, I think all the JetBrains IDEs come with it.
>>
>>61026805
you're making the assumption that a feature is inherently beneficial
>>
>>61026863
>then http://www.myhdl.org/
is that actually a thing?
>>
>>61026791
>J*va
>W*dows
I can literally smell shit coming out of you. Get out.
>>
>>61026880
No she's making the claim that the excuse isn't valid. It's dismissing the idea of including the feature based on the idea that it's against philosophy, that's a bad idea. Whether or not the feature is good or not is besides the point.
>>
>>61026932
>excuse
put this word into your mind and reread my post
>>
>>61025601
any help here? thanks
>>
>>61026953
This post?
>>61026880
I did. Doesn't give me anything. Unless you're claiming that your post is excusing the person anon quoted. I don't see how that changes anything really.
>>
>>61026926
The guy asked a question about java, should I have answered in python?
>>
I am going to live a NEET live for the rest of my life.

Fuck that shit, I'll make some shitty apps with kotlin and sell it to normies
>>
>>61026324
Most languages string types are just char[] under the hood.
>>
>>61026999
yes, python is like pseudo code. the utilmate programming language for communicating.
>>
>>61027021
Usually char[]. A capacity value and a size value.

On the topic of strings. What other formats are there that's better than UTF-8? I don't like how you can pretty much only move forward in them.
>>61027050
Anon I think you mean that dynamically typed languages are like pseudo code. Python is very narrow.
>>
>>61026805
/dpt/ Facts #189: Dynamic Typing Is The Most Powerful Typing In The World
>>
>>61026999
Even Pyshit is better than J*va
>>
>>61027021
UNDER THE HOOD. there is the programming language and there is its implementations. a programming language is defined by its syntax and its semantics, not by how one of its implementations is doing things under the hood. never forget that.
>>
>>61026783
Yeah, you can technically handle just about any type as an array of bytes.

That doesn't mean it's necessarily the most ergonomic approach.
>>
>>61026994
Why do they need an excuse?
>>
>>61027064
>Python is very narrow.
https://news.ycombinator.com/item?id=1803815
>>
File: 1494544436510.png (6KB, 472x508px) Image search: [Google]
1494544436510.png
6KB, 472x508px
>>61027078
The fuck are you getting at?
C doesnt have a string type, but no language I can think of actually handles strings in a way different from C.
And if you just want to close your eyes and blindly let the interpreter or runtime environment handle things for you, you're probably a shit programmer.
>>
>>61026783
>Tell me one thing you can do with a string that you can't do with a char* and I will prove you wrong.
the guarantee that a string is well formed?

void myputs(const char *s)
{
puts(s);
}


can you guarantee here that *s is always a well formed string?

also, encoding?
>>
>>61027125
>And if you just want to close your eyes and blindly let the interpreter or runtime environment handle things for you, you're probably a shit programmer.
What you're talking about is called abstraction and it's the only reason we ever got beyond punch cards
>>
D!
>>
>>61027120
>this one guy thinks it fits his pseudo code
Ok? What's your point?
Python has far more implications than similar versions in pseudo code most of the time.
>>
>>61027165
>can you guarantee here that *s is always a well formed string?
first of all I can guarantee *s is not a well formed string because *s is a character
as for the question of whether s itself is a well formed string yes i can guarantee that and here is how
/* Let s be a well formed string. */
void myputs(char const* s);

this means s must be a well formed string or else it's the caller's fault the function didn't work
>>
>>61027125
>And if you just want to close your eyes and blindly let the interpreter or runtime environment handle things for you, you're probably a shit programmer.

This is what any sane programmer would do, wtf. if you have to care about every details of every implementations, then defining a programming language makes no sense.
>>
>>61027125
Who the fuck cares about how a language handles it below the surface?

If you insist on wasting your time handling well-solved problems yourself, you're probably a shit programmer.

Actual string types fixes that, abstracting away low-level details (see that? Abstraction. That's what us programmers *do* use and build abstractions. If you're not using abstractions, you're probably a shitty programmer), and allow you to focus on the meaning of a string, not the meaning of "an array of chars."

Unless you just want to re-type all the real basic shit over and over again, like ensuring strings are well-formed instead of letting your string abstraction take care of that for you.
>>
>>61027118
They shouldn't use a non-argument to dismiss a suggestion. An excuse is not an argument.
They don't need an excuse, they need something other than an excuse.
>>
>>61027208
while you could simply have

myputs(string s);

where the string constructor guarantees the well formation of every strings.

only a PLT illiterate could love C.
>>
>>61027215
>ensuring strings are well-formed
??? But you can do this in C.
See: >>61027208
>>
>>61027238
You still haven't understood.
>>
>>61027208
>this means s must be a well formed string or else it's the caller's fault the function didn't work

Lol, or you could an actual string class, so the caller doesn't have to give a fuck if it's a well formed string or otherwise gets alerted if he did fuck up.
>>
>>61027248
>while you could simply have
>myputs(string s);
>where the string constructor guarantees the well formation of every strings.
You can easily do this in C as well.
stringtype.h:
/* Let all instances of this typedef be null-terminated. */
typedef char* string;
>>
>>61027175
>>61027212
If you don't UNDERSTAND what's going on under the hood, you're a shit programmer.
I'm not saying everybody needs to go back to writing in ASM. Don't be obtuse.
>>
>>61027215
>abstract always and your problems go away
This is a terrible attitude. All your program does is transform data from one form to another. A lot of abstractions (not all) hide the problems from you well. Abstractions mainly save you in typing time (very small portion of time realistically) and it pushes the problem elsewhere. Someone has to deal with it.

If you think abstraction is a generally good way to approach problems you're not an engineer.
>>
>>61027208
>>61027273
>this is the C programmer's mindset
LMAO
>>
>>61027259
Well done in saying nothing while feigning knowledge.
I won't waste my time on someone who has to pretend to be smart.
>>
>>61027273
you could also fix c

fixc.h
#error "Use another programming language, you sick fuck."
>>
>>61027262
>class
>>>/int/india/
>>
int dequeue (queue *q) {
int value = q->head->data;
q->head = q->head->next;
q->head->prev = nil;
return value;
}

Why this gives me seg. fault on last element of list?
>>
>>61027282
You are now moving the goalposts.
No one said anything about not UNDERSTANDING what's going on under the hood.
This conversation has all along been about whether it's desirable to ABSTRACT over what's going on under the hood. Which it is.
Hence why C is a shit language. Because it does not do the desirable. Instead it is the undesirable thing over which desirable things must abstract because it is undesirable.
>>
>>61027282
If you need to understand what's going under the hood to reason about your program logic, your programming is flawed.
>>
>>61027300
I'll leave you to ponder >>61026880 and >>61027118
This is pretty basic and it's shocking you don't understand my meaning
>>
>>61027311
This looks like C, so I'm working off that assumption.
After you change q->head to q->head->next, you're not making sure there's an actual object there before you try to set the prev property on it.
Also, this is unrelated to the segfault, but you're leaking memory.
Fixed version:
int dequeue(queue *q) {
int value = q->head->data;
void *to_free = q->head;
q->head = q->head->next;
free(to_free);
if (q->head) q->head->prev = nil;
return value;
}

Also, wait a minute, since when is nil a name for the null pointer in C? I'm confused now.
>>
>>61027288
Nice way to invent quotes.

Use abstractions when it's appropriate. If the given abstraction is not appropriate, then create a new one.

Abstractions do more than saving typing -- they ensure readability of programs (by establishing a more concise language), they enhance testability (by formalizing protocols and expected behavior), they reduce mental burden (by creating a smaller surface of which you have to concern yourself).

When you have to constantly concern yourself with the problems at hand (when already well-solved), you're just introducing more room for error and making that error harder to single out.

Pushing the problem elsewhere isn't a fault of abstractions, it's a fault of not being disciplined, which is an issue regardless of how high level of abstractions you use.

If you think abstractions aren't a good way to approach problems, you're not an engineer, you're a physicist or a mathematician.

Even C is a huge abstraction over actual the ISA (the ISA, itself, being a huge abstraction over what the processor is actually doing).
>>
>>61027410
>reddit spacing
I didn't even bother to read your post, because I already know it's fucking stupid. Piss off.
>>
>>61027404
#define nil NULL

But yeah he might be using something else.
>>
>>61027288
>If you think abstraction is a generally good way to approach problems you're not an engineer.

abstraction is the fundamental concept of computer science. any computer scientist would agree on that.
>>
>>61027311
>q->head->next line
Dereferences next and copies it into q->head
You probably mean q->head.next
Which would leave the head at a null ptr.

Don't forget to deallocate if these nodes are individually allocated.

>prev = nil
Is this lua? Looks like C.
>>
File: 1480153094177.jpg (42KB, 712x712px) Image search: [Google]
1480153094177.jpg
42KB, 712x712px
>If you think abstractions aren't a good way to approach problems, you're not an engineer, you're a physicist or a mathematician
What did she mean by this?
>>
>>61027431
Not that I agree with the guy you replied too but computer science is not engineering
>>
>>61027439
>not being a baremetal mathematician writing proofs in binary in ano domini 2017
>>
>>61027431
>computer scientist
Not engineers. Abstraction is great in academia. It's occasionally useful in engineering. But it's generally bad.
>>
>>61027417
When you've got no better arguments to make than to insult someone for using the spacing between paragraphs (or in this case, main ideas) as taught in school.
>>
>>61027439
But abstraction is part of mathematics
>>
>>61027462
@? the fuck was that shit?
>>
>abstraction is bad
>programmer
Pick one or read SICP.
>>
@61027474
You should consider switching to Go, it was designed with "people" like you in mind.
>>
>>61027459
In what context is that a response to my post?
>>
>>61027410
>abstractions increase the readability of the program.
So this is a big topic. I can't cover all of it with you. But you saying this makes it look like you think hiding details is a good idea. We can't go further before you conclude otherwise.
>>
>>61027474
retards's way to put themselves out of the conversation.
>>
>>61027474
Stop replying to the gate keeper retard.
>>
>>61027500
do you need to know the implementatopn of sin() to being able to use it?
do you need to know the implementation of sin() to understand a program using it?
>>
>>61027439
Because an engineer doesn't give a shit about the actual math behind the part he uses. He just needs to make sure his nuts and bolts and a few common parts match the specifications that his other calculations says he needs.

Meanwhile, Physicists and Mathematicians are interested in breaking down their knowledge to axiomatic principles (even if they often don't do so, as no one needs another paper on the fundamentals).
>>
>>61027523
Yes to both.
>>
>>61027526
>an engineer doesn't give a shit about the actual math behind the part he uses
Ok.
>>
>>61027315
>You are now moving the goalposts.
I haven't moved shit.

>>61027321
Is that why there's so much god awful, slow, shitty python and Java code out in the wild while the logic is perfectly sound?
>>
make out
>>
can you guys stop arguing about dumb shit all the time?
>>
>Because an engineer doesn't give a shit about the actual math behind the part he uses
This blatantly shows that you don't know anything about engineering.
>Physicists and Mathematicians are interested in breaking down their knowledge to axiomatic principles
This blatantly shows that you don't know anything about physics or mathematics.
Let's even assume you weren't a retard and this was true, in what way does it imply that "physicists or mathematicians think abstractions aren't a good way to approach problems"?
>>
>>61027530
then programming (and mathematics as a whole) is definitively not for you. not everyone is able to think abstractly; abstraction is recognized has one of the most difficult things in any science field.
>>
>>61027500
>you think hiding details is a good idea
Not him, but usually--if you're using abstraction the RIGHT way--hiding details isn't an idea at all, it's an undesirable side effect of the idea of creating a more distanced and expressive representation of what's going on. Inevitably any details which are not indispensable to the basic concept of what's going on will be lost in translation, and while understanding these details is still vital, it must be either taken on faith, or, preferably, guaranteed by providing complete and detailed documentation.
>>
>>61027585
I'm of a race with a pretty low average IQ. Most of my people aren't really capable of that.
>>
>>61027549
>I haven't moved shit.
Yes you have, the conversation was about whether abstraction is a good idea, not whether understanding what it's abstracting over is important. (The answer to both is yes.)
>>
>>61027535
You try to take it out of context.

>He just needs to make sure his nuts and bolts and a few common parts match the specifications that his other calculations says he needs.

> This blatantly shows that you don't know anything about engineering.

An engineer isn't going to sit there and work out the load bearing of a part he uses bought from another company. If he did, his boss would probably fire him for such a dumb use of company time. He'll use the specifications the they bought it from provided.
>>
>>61027549
is this why you doesn't have to rewrite your c program when moving, for example, from gcc to clang.
>>
Multidimensional arrays support. I think I'm pretty close to done with an initial release.
>>
>>61027625
also inb4
>nice screen usage faggot
>>
>>61027625
>C++
ree
>>
@61027625
>sepples
Instant trash.
>>
>>61027625
just have arrays as regular type constructors
there's no need to have built in multidim arrays if you have built in arrays
>>
>>61027404
>>61027437
It's C, defined nil as (void *)0.
I cut freeing because of understanting what was going on. Anyway, >>61027404 solution still gives me seg. fault.
>>
>>61027475
>SICP
>Hal Abelson
>Computer scientist who's only work is in education. Never had a complicated software project of note
>Gerald Jay Sussman
>Also an academic with no software projects of note on his back.
And then you have people who come in here and recommend that people read SCIP as if it's some guide to writing good software. It's made by people who haven't worked on serious software in their lives.
It'd be more useful to read Gravitys rainbow even if it has nothing to do with programming practice directly than SCIP if you want to learn programming well.

>>61027569
>Dumb shit
Anon this is a big step up from programming language fights.
>>61027585
>programming (and mathematics as a whole)
No anon mathematics has https://en.wikipedia.org/wiki/Computational_mathematics
Not programming. Programming is an engineering discipline.
>able to think abstractly
No need for insults. Especially not before you're right about things.
>>
>>61027641
see: >>61027640
>>
>>61027659
see: >>61027641
>>
>>61027645
The issue is pointer size is different from integer/boolean size, so I have to adapt the memory allocation so pointer size fits.
>>
File: 1474244339847.png (177KB, 424x335px) Image search: [Google]
1474244339847.png
177KB, 424x335px
>His language has null instead of Maybe/Option
>>
>>61027647
>still gives me seg
Yeah. It's because he's still dereferencing the null pointer. Read my post.
Also get a debugger. When you can inspect the values at runtime it becomes obvious.
>>
We should have a /dcsg/
Because clearly these lunatics don't belong in programming.
>>
File: 1496112118319.jpg (13KB, 228x238px) Image search: [Google]
1496112118319.jpg
13KB, 228x238px
>>61027677
>his language has partial functions
>>
>>61027680
>Also get a debugger.
What do you suggest in linux?
>>
>>61027702
>he
>>
>>61027694
Which lunatics?
Can you link to the exact posts?
>>
>>61027647
>Anyway, >>61027404 (You) solution still gives me seg. fault.
Hmm. You aren't ever calling it on an empty queue, are you?
int dequeue(queue *q) {
if (!q->head) {
fputs(stderr, "warning: dequeue called on empty queue, returning 0\n");
return 0;
}
int value = q->head->data;
void *to_free = q->head;
q->head = q->head->next;
free(to_free);
if (q->head) q->head->prev = nil;
return value;
}
>>
>>61027705
>Linux
No clue. Last I did Linux debugging I used DDD but that was unpleasant. I did use code blocks too. Less unpleasant and generally sufficient but also a bit lacking. I'm sure many of the expert programmers here can enlighten you on what to use. I don't have the luxury of working on Linux.
>>
>>61027729
>I did use code blocks too
+18 please.
>>
>>61027705
You have several plugins that can embed gdb in your favourite editor provided it's not too obscure.
>>
>>61027437
>Dereferences next and copies it into q->head
>You probably mean q->head.next
>Which would leave the head at a null ptr.
This is completely inaccurate.
>q->head.next
This is appropriate if q->head is a struct type.
>q->head->next
This is appropriate if q->head is a pointer to a struct type.
It has nothing to do with whether or not next is dereferenced.
>>
>>61027702
>not wanting partial functions
>>
>>61027722
>q->head->next
It's still bad.
This is like *(q->head.next)
Which should be more obviously problematic.
>>
>I’m too stupid for academia so academia is bad.
>>
File: 14806977129201.jpg (87KB, 720x720px) Image search: [Google]
14806977129201.jpg
87KB, 720x720px
>>61027753
>wanting to use a complete shitlang
>>
>>61027754
This is incorrect.
>q->head->next
This is like *(q->head).next, not *(q->head.next).
See: >>61027752
>>
forgot to ‘reply’
>>61027651
see >>61027762
>>
>>61027754
>>>/g/rustg/
>>
>>61027702
My language neither has null nor partial functions, what now, fgt?
>>
>>61027764
>map (\x -> x + 1) [1..3]
>instead of
>map (+1) [1..3]
lamo

>>61027762
academics created haskell, and look how bad it turned out.
>>
>>61027764
>doing the work of the compiler
>>
>>61027784
Is it Turing-complete?
>>
>>61027784
It might actually be good if the answer to this is "no" >>61027803
>>
>>61027803
It's so turing-complete, even its type system is turing complete
>>
>>61027790
So you’re on my side?
>>
File: 1497927196580.jpg (103KB, 1200x1163px) Image search: [Google]
1497927196580.jpg
103KB, 1200x1163px
>>61027818
>turing-complete
So in other words it's garbage?
>>
>>61027818
Pretty cool anon, please show us.
>>
>>61027839
https://sdleffler.github.io/RustTypeSystemTuringComplete/
>>
>>61027833
What are you talking about?
>>
>>61027790
>plus is a partial function
Are Shitkellers really this retarded or is this supposed to be a joke?
>>
>>61027851
Thanks.
>>
>>61027853
I'm talking about a property which can show that a language is shit.
>>
>>61027742
I'm 24.
Nothing wrong with trying things.
What debugger do you use anon?
>>
>>61027877
>What debugger do you use anon?
You don't need a debugger if you don't write buggy software.
>>
>>61027859
What’s bad about it? You can still use it like this:
1 + 1
>>
>>61027871
How can it show that?
>>
>>61027311
Don't listen to this guy: >>61027437 >>61027680 >>61027754
He has no idea what he's talking about. If you follow his suggestions, your code literally won't even compile.
>>
>>61027851
Wow that's disgusting.
>>
File: 1494830140289.jpg (19KB, 272x332px) Image search: [Google]
1494830140289.jpg
19KB, 272x332px
>>61027890
This is pretty embarrassing even for a Shitkeller. Are you suggesting there is a well-typed value for which "plus" is undefined?
>>
my language is so turing complete even the comments are turing complete
>>
>>61027886
>I don't use a debugger
Why? You never inspect values using print functions or whatever either?
Pretty hardcore anon.
>>
>>61027957
My language doesn't really have "print" functions.
>>
>>61027967
>or whatever
Any data output that could be used for inspecting values.
>>
>>61027967
my language's print function is Turing complete
>>
>>61027987
It has something which can be used for that purpose, but I don't really use it.
>>
>>61027916
Are you suggesting there are values which are not well-typed?
>>
re post #61027474
it's a gimmick from brit to deny bad posts (You)'s
>>
>>61027997
And you never have errors/bugs in your language? What language is it? Sounds like a dream. Assuming you're actually writing software.
>>
>>61027916
>his language's plus works on non numbers
lmaoo
>>
File: 1487631013684.jpg (781KB, 1024x1152px) Image search: [Google]
1487631013684.jpg
781KB, 1024x1152px
>>61025589
>>
>>61027999
Sadly every single syntactically valid term can be made well-typed in Shitkell.
>>
New thread when
>>
2D text is an inferior format to 3D text for programming

Discuss.
>>
>>61028036
What are you even babbling on about? I'm talking specifically about the "plus" on numbers.
It's pretty embarrassing that a Shitkeller doesn't know what a partial function is even though his language is filled with them.
>>
>>61028026
>And you never have errors/bugs in your language?
Yes, if by "bugs" you mean things which I consider to be unwanted behavior.
>What language is it?
Why do you want to know?
>>
File: 06222529.png (411KB, 908x1889px) Image search: [Google]
06222529.png
411KB, 908x1889px
Trying to read csv and insert into postgresql. Why does it get precision problems?? I've even tried using NUMERIC in the table def in postgresql and long double in the code but its still randomly fucking up the numbers. Why does it work on some but not on others?
>>
>>61025589
>tolerates 0.5% error on every calculation involving pi.
It can add up quickly anon.
I'd say 3.14159 is enough.
But 22/7 is also good if you're looking to save typing or characters.
>>
>>61027702
>>61027916
this anon's definition of partial functions is "a function that is not defined on some subset of its domain." this is the correct and generally accepted definition of partial function
>>61027753
>>61027859
this anon's definition of partial function is what we would normally call a "partially applied function."

hope that clears that up for you all
>>
>>61028161
Because it sounds like a good language.
>>
>>61028204
Why would I want you to know about it though? You'll most likely just shit it up.
What's your favorite language?
>>
>>61028230
Fortran
>>
>>61028251
At least it's not C-influenced garbage.
Explain why it's your favorite language.
>>
>>61028203
This post is incorrect.
>>61027859 is in fact using the proper definition.
The rest is fine.
>>
>>61028270
It's just because it's the first language I got to know and I have good memories of mom teaching me it.
Not really any solid arguments.
>>
C, Lisp, and Rust are garbage.
>>
>>61028312
They're the same language. Why even bother to type it out three times?
>>
New thread: >>61028323
>>
>>61028328
Make new thread, OP is a frogposter.
>>
>>61028336
Real new thread:
>>61028387
>>
>>61028420
kill yourself weeb

real thread >>61028323
>>
>>61027722
What if q == NULL?
>>
well done retards
>>
>>61028098
>3D text
Is it WordArt?
Thread posts: 374
Thread images: 28


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.