What are you working on, Sup Forums?
Old thread:
What are you working on, Sup Forums?
Old thread:
Learning asm.
...
Would it be hard to learn C# if you're new to programming?
And what are the best methods to learn, i've already signed up for a programming course at a community college.
Aren't you supposed to start with C?
C# is not THAT hard, my friend that is not very good in practical programming learns it right now and, i think, somewhat succeeds in it
The hardest part is beginning, you're expected to write meaningless OOP incantations before you can start any programming at all. It's got a nice gentle learning curve after that.
it's quite easy, you can start making windows applications fast and that's motivating, also much better syntax than java
Not really no.
I want to make a simple push button for a Linux machine.
Not a keyboard, just something so I can read if there is a short circuit.
What resources should I read?
Is it even possible with a modern computer? Or do I need to connect an arduino?
Would you two recommend this site learncs.org
And is microsoft visual studio the best IDE for C#?
Definetly.
At least until Ryder from JetBrains comes out.
its not that hard
def avgdicts(dicts):
totval=0.00
totlen=0
for dic in dicts:
totval += sum(dic.values())
totlen += len(dic)
return totval/totlen
or if you want to do functional programming
def avgdicts(dicts):
return (lambda vallen: vallen[0]/vallen[1])(reduce(lambda old_vallen, dic: (old_vallen[0] + sum(dic.values()), old_vallen[1] + len(dic)), dicts,(0.0, 0)))
VS is basically the only good IDE for C# if you are under windows, yes
it's called Rider and it's actually out already, unfortunately its payed (or 30-days trial)
anyone here used it yet?
What are advantages/disadvantages of C++ over C when it comes to efficiency and reliability of the program? How much am I missing if I use a C++ replacement like D or Rust instead? Advantages of mixing C with C++ or one of its replacements? I only know C.
Any libraries that let me write programs for Windows and Linux without ifdeffing every syscall?
Also, when is it better to use threads over processes? How do I schedule my threads on my own and is it really worth it?
>Any libraries that let me write programs for Windows and Linux without ifdeffing every syscall?
This is why POSIX exists.
Depends on what you want to do, Qt would do that for a good cross-platform GUI and is C++ if that's what you want.
>What are advantages/disadvantages of C++ over C when it comes to efficiency and reliability of the program?
Depends entirely on the way you write C++. You could write C++ that is just like C and has all the efficiency of that, or you could use abstractions to make your program safer + easier to write but probably slower.
>Advantages of mixing C with C++ or one of its replacements? I only know C.
Portability. If you're making a library you want to do it in C, or at least expose a C interface.
>Advantages of mixing C with C++ or one of its replacements
Basically, there are many more C libraries, than D/Rust
>How much am I missing if I use a C++ replacement like D or Rust instead
Their standard libraries are actually better than C++'s
If C++ can replace C why do they still teach it at CS?
C is a small and focused language, the concepts it teaches are inescapable. You could write C++ without ever calling free/delete or using a function pointer. It's very easy for someone to fuck up and break a whole codebase by misusing C++ features or using obscure C++ features. Also, certain "unsafe" behavior is much more ergonomic in C (e.g. pointer casts)
Do you need to learn to swim before you learn to ride a bike?
Also, VS Code is very usable for C# if you don't want the full suite. It has the codelens stuff, intellisense, very similar debugger, etc.
Because its simpler. K&R2 is like 270 pages. TC++PL4 is like 1400 pages, and that edition of the book is now 2 language revisions behind.
C is easier to understand and has pointers & recursion — basically two things that are the hardest to understand for students
Introducing programming with C++ can be VERY confusing. Especially when the first examples start with:
using namespace std; // yuck
cout
C# is one of the best beginner languages, from a standpoint of being able to do things fairly quickly. I highly recommend you use the Yellow Book. It's free, get the PDF and resources on this page: robmiles.com
why are people disgusted about using `namespace std`
whats so wrong about it
>before going deep into C++.
>implying
It's tolerable if it's properly scoped.
Fucks up headers. Nothing wrong with using it in a source file tho
Taking a dump right now
>Rider
>€139.00/year
well fugg :-DD
"using namespace foo" should only be done at the deepest scope.
otherwise you risk namespace pollution
Holy fuck that's like more expensive than windows 10 lol
It's a bottomless pit.
t. C++ dev, I lost the sense of purpose in life
Because C and c++ have different things they are both good at.
There is honestly nothing wrong with introducing people to programming using c++. That is as long as you don't start by teaching it using idioms from the 70/80's the C way.
>payed
since there are some C++ developers in here, preferences?
const foo& bar();
//vs
foo const& bar();
// --
const foo &bar();
//vs
foo const &bar();
void foo(const bar& b);
// vs
void foo(bar const& b);
// --
void foo(const bar &b);
// vs
void foo(bar const &b);
>python is slow
3673 function calls (3606 primitive calls) in 0.072 seconds
What's the point in using C when you can use Rust which is better in every way?
>better type safety
>abstractions that don't hinder performance
>removes a lot of shitty backwards compatibility and out dated features.
Third both
>removes a lot of shitty backwards compatibility
>better
const foo &bar(const baz &b);
I don't like the rules, I just follow them. Swapping const position is fine too.
Now post the code
>What's the point in playing a good ol' card game when you can play the latest fashionable game no one except hipsters knows about and have a reputation of being played by huge cunts?
can't. but its a image downloader using json and urllib2
>How do I schedule my threads on my own and is it really worth it?
You don't. And as far as I know for OS-level threads you can't. Maybe you can in some cooperative multitasking systems but then you're not really doing "stuff at the same time," you're just making an abstraction that makes it easier to juggle multiple workloads.
>hurr durr C lacks modern language conveniences, must be a great language!
Fuck off, C is obselete, Rust is the future.
you can do a yield() but otherwise it's both stupid and pointless.
yield() yields control to any running thread, not just the host program though, correct?
>hurr durr C lacks modern language conveniences, must be a great language!
What are you quoting?
read this sentence
>C is obselete
So are most card games, yet everyone knows them, plays them, and enjoys them.
Given how you present Rust, I'm not sure I'm gonna enjoy it.
Usually yield is optimized to give the thread's priority to its other threads so they have higher chances of running during scheduling and release a mutex, send a message, etc. There's also a syscall that does this for a process and its children but I can't remember its name.
Read.
But it doesn't contain any source on your quote!
>IQ ranking
60: Average IOS user.
70: Average OSX user.
80: Gaymer windows user.
85: Non-gaymer windows user.
88: Average non-programmer Linux user.
89: Web developer.
90: Programmer Windows user.
95: Programmer OSX user.
100: Average mid-tier programmer Linux user.
110: High tier Windows programmer.
120: High tier OSX programmer.
130: High tier Linux programmer.
140: UNIX programmer.
That's because you are a closed minded fool who doesn't want to more away from their pond.
>It is difficult to free fools from the chains they revere.
what about bsd
>140: UNIX programmer.
that makes osx just as high desu
What license is better to use?
>It is difficult to free fools from the chains they revere.
I have never seen a language that put as many chains and training wheels as Rust.
have a lot less reverence for high level languages after beginning assembly
How can i write a regular expression that makes sure there's only one word on the entire line
it needs to meet the following expression /(^de|ed$)/ just not sure how to check that there's only one word on the line
>not misinterpreting the quote
You are misunderstanding the difference between training wheels and pragmatic safety. Rust is designed to be safe so that you avoid the countless memory security holes that riddle software written in C.
You will probably have quite enough of that reverence again after you will be throgh with assembly.
Good stuff to know, thanks man.
I know some programming from uni not that much but still where could i find some small jobs or something to do on the internet? I want sum moneys
>I want sum moneys
get some knee pads
is it possible to re write the JVM?
Yes but it'd be pointless. It's literally the only good thing about java
Like it's been already said countless times to other Rust shills, security holes are the facts of bad programmers, not inherent to the language itself.
Preventing such problems at the core of the language won't prevent bad programmers to be still bad and produce incorrect code that doesn't respect the specifications.
Do you guys use linked-in to get programming jobs / talk to recruiters?
Yes, but Rust eliminates a large portion of security holes at compile time to avoid them at run time.
>security holes are the facts of bad programmers
Do you think this is true? I can point to many projects written in C that were written by "good" programmers but had security holes. Did you forget shellshock? Heartbleed? The many security holes present in Linux? I could go on.
/((^de|ed$)(?!(^de|ed$))\z)/
What's up with Asians women and the V sign? Do they all want to get the tongue???
More seriously, workers are lured into Linkedin most likely because it facilitates the work of headhunters, more than helping you finding a job by yourself. And that's how Linkedin do business actually.
/\s*(^de|ed$)/ checks before the word, not sure how to check after the word
Rust lacks security holes because no one writes in Rust.
not him but, i tried this on regex but don't know wtf this regexp does
>2017
>not using go
it's like you don't want to be happy and productive
"regular expression compile failed (missing operand)"
i'm doing it on my own volition, not for a class, so i probably will never have the same hate most people have for it. it's fun to be able to write your own code and not have a compiler make it. but after i finish this i plan to teach myself compilers so you're probably right
What language(s) does /dpt/ use at their >job
What language(s) does /dpt/ use for personal/fun projects?
compilers are fun, user approves
I don't kniw if your language of choice has those operands, I tried to write Perl regexp.
Still, I can't guarantee if it works.
>Rust lacks security holes because no one writes in Rust.
Are actually going to provide any sort of decent rebuttal or are you just going to spout bullshit? Rust lacks security holes because Rust is secure. There are plenty of Rust programs used, you just never hear about any security issues because there are none. There are many projects on github:
github.com
rust is for beta males, C is for alpha males. simple as
That might come as a shock or a contrarian opinion, but in general open-source code quality is very subpar. Of course, that doesn't mean closed-source is forcibly better, but it's actually in the nature of every surviving and active open-source project to stoop to the lowest common denominator of quality.
But I can assure you, that sort of security hole just can't exist in critical systems, even when written in C. It's a matter of responsibility and the level of code quality required is just insane there. Maybe that's where Rust may shine, but Ada already has quite the upper hand in such matters. Not the same tools, not the same persons, not the same sums of money involved too.
C++/C#
C++, Rus and Python mostly, but also like a bunch of others just to check them out
I'm using awk, basically I have /\s*(^de|ed$)/ currently which works for words before DE or ED is found, but I can't figure out how to check for words after
>Ada already has quite the upper hand in such matters
But Ada requires a garbage collector, Rust doesn't.
>open-source code quality is very subpar
As opposed to what? Apple who produce such shitty software they have to restrict their users to their walled garden as to not get a virus? Or Windows who constantly get security holes? Remember when a there was that randomware attack a few months ago which cost billions of dollars in damage because it got into the NHS?
See Lookaround assertions at perldoc.perl.org
OCaml
OCaml
Powershell
D
The solution to the riddle of software quality does not lie in a programming language, because a language that is expressive enough to build programs which interact with the outside world is non-deterministic by nature, hence allowing insecurity. That's why Rust is obliged to include an "unsafe" keyword to be relevant enough as a programming language. You can only be "safe" in a restricted part of the language.
The recurrence of flaws of programs is an engineering problem and stems from the lack of rigor and seriousness in program engineering. Take a look at other industries where risk and danger are involved and see how rigorously they proceed. As with C, making a procedure or calculation mistake is easy, yet risk is managed in such a way it doesn't lead to catastrophic consequences. The software industry has yet to reach such maturity.
Python + C
Python, C#, PHP and JS
I hope for your sake that these lines are in reverse order.
Pick something that doesn't contain GPL in it and you are fine and if you really want GPL just make sure to avoid v3.
I have a research job, where I use Python to do all kinds of calculations. When I need the super computer, I use C.
At home, I use Python for all kinds of things, C# for Unity, and PHP and JS for my server and homepage.
On Linux threads are just processes with sharing memory and shit and they're scheduled just as processes. I meant something like implement my own threads running within my process and schedule them. Or coroutines or shit. nvm, that was a dumb question.
Just had my first year of CS classes at Uni. Thought implementing Conway's game of life should be an easy enough thing to work on so I learned a bit of SDL2 in order to display it. Getting the game to work went well enough but I don't know enough about SDL to fix something: the game maxes out a core for no good reason.
Initializing the renderer with vSync keeps the core usage to about 20% (this still seems way to high) but that messes with how I pace board ticks.
Here is the source: dl.dropboxusercontent.com
Any help would be appreciated.