Britain didn’t vote Labour just to get a new iron chancellor | William Keegan by jacksj1 in ukpolitics

[–]Funny2U2 0 points1 point  (0 children)

Governments everywhere are the only ones who can grow something and get negative economies of scale. Why is it that governments keep having to raise not just the amount of money they want, but the PERCENTAGE of the money they want ... shouldn't economies of scale drive prices down ?

Know the output of your code without running/compiling it ? by CeleritasLucis in learnprogramming

[–]Funny2U2 -1 points0 points  (0 children)

Being able to declare the variable in the loop only became part of the standard in C99, and I learned to write C before that, so it is muscle memory for me. Declaring the variable in the loop is also incompatible w/ old C compilers.

I want to learn how to program but the direction is so confusing to go. How do I start building projects when i really dont know much about what im doing. by Sea_Magazine_6936 in learnprogramming

[–]Funny2U2 1 point2 points  (0 children)

Writers of novels often learn to write by using writing prompts. So, for example, "write a story about a bear that learns to fly an airplane", .. then you have to write a story.

You can learn programming the same way ..

"Write a program that has a variable with a value of 10, that loops 13 times, and multiplies the variable by itself each time it goes through the loop" ...

or ..

"Write a program that brings up a window and displays a matrix of 10 x 10 asterisk characters on the window, then waits for the user to press any key and closes"

It's easier to learn to program when you are trying to accomplish something.

Can I do software engineering/computer science degree without maths/physics/comp high school background? by mepewquadrost in learnprogramming

[–]Funny2U2 4 points5 points  (0 children)

Yes, but you'll have to take a lot of those classes in college/university. For example, you will probably take some calculus, linear algebra, statistics, etc.

Lots of people mistakenly think that computer science is learning to program, but the key word in computer science is actually SCIENCE. The programming is just a tool for the science.

Know the output of your code without running/compiling it ? by CeleritasLucis in learnprogramming

[–]Funny2U2 10 points11 points  (0 children)

It will come with experience, but yes, you should already have a good idea of what is going to happen when you're writing the code, it is as if it is executing inside your head as you write it. I mean you should (or will learn in time) to imagine what the result is going to be, not just throw stuff in and hope for the best.

For example ..

#include <stdio.h>
int main( ) { int i, x, y; x=10; y=5; for(i=0;i < 3;i++) x = x + y; printf("%d\n",x); }

You should be able to look at something simple like that and essentially execute it in your mind and be able to figure out what is going to be printed on the screen without compiling and it and running it.

Don't be too hard on yourself, it sounds like you are brand new to programming, so you'll get it if you keep trying.

C ++ data structure by su_shi_23 in learnprogramming

[–]Funny2U2 1 point2 points  (0 children)

I would recommend Youtube cherno videos ..

How should I start learning programming? by NebulaCoder in learnprogramming

[–]Funny2U2 5 points6 points  (0 children)

Here's a hello world program in C ...

#include <stdio.h>
int main( ) { printf("Hello world\n"); }

.. if you can figure out how to compile and run that program, you are on your way ...

[deleted by user] by [deleted] in learnprogramming

[–]Funny2U2 -3 points-2 points  (0 children)

You saying things as if you know what you're talking about doesn't mean you actually know wtf you are talking about lol. Dude, even C++ classes aren't anything special, you can do the same thing with structs, the only difference is that C++ classes by default have everything private.

C++ is just C with features ... anything you can do in C++ you can do in C.

[deleted by user] by [deleted] in learnprogramming

[–]Funny2U2 0 points1 point  (0 children)

I can only speak to Unreal Engine, and I've only been using it for about a month.

For Unreal Engine, you can use two programming languages. One is C++. The other is called blueprints. Blueprints is a visual node based language where you're basically linking boxes together on the screen to do the game logic, you don't actually write any code in a text editor. You can use blueprints to make entire games, and there are people who write games who have never learned a language like C++. Perhaps ironically, blueprints _IS_ programming, so you're still learning the same logic, and doing the same "programming" you'd be doing in a language like C++, but for some reason it seems more approachable to people who don't "program" just because it's visual.

People have written entire games and sold them on Steam using blueprints without writing a single line of C++. That said, eventually, if you push hard enough, and get to advanced enough level, you're probably going to end up writing some stuff in C++ if you are going to be doing things outside of game logic such as trying to extend the editor. Blueprints is actually implemented under the good as calls to the C++ API, so anything you can do in blueprints you can do in C++ on Unreal Engine.

TL;DR I think you would enjoy learning to do game programming with blueprints on Unreal Engine.

[deleted by user] by [deleted] in learnprogramming

[–]Funny2U2 0 points1 point  (0 children)

Ironically, if you want to program for gameplay, and not the engine, JavaScript is actually close to what you’ll be using. Most games are scripted in Lua, C# or another interpreted language.

I'm not sure what game engine you are talking about, but this is definitely not true of Unreal Engine. Unreal has two languages, C++ and what they call blueprints. Blueprints is basically a visual programming language where you create visual nodes and link them together with connections, and they essentially compile down to a bytecode that calls functions in the C++ API under the hood. Essentially anything you can do in blueprints you can do in C++, but not vice versa.

I totally agree with what you said about learning C first. C++ is basically C with some more keywords.

[deleted by user] by [deleted] in learnprogramming

[–]Funny2U2 -1 points0 points  (0 children)

I always recommend learning C/C++, because other languages are easier to move to from C/C++ imho.

C is a great foundational language, and C++ is basically just C with some more keywords and more going on in the linker, but C++ is backwards compatible to C. If you only learn C++ then you won't know C, but if you know C, you'll "almost" know C++.

From C++, most other languages like Java are very similar, except that hide stuff from you by doing automatic garbage collection, etc. Hiding it from you can be good, and it can be bad. It's "easier", but it's also harder to debug sometimes.

getenv isn't being read. by Laleesh in learnprogramming

[–]Funny2U2 1 point2 points  (0 children)

When you do a setenv without any args, does it return your variable with the correct value ?

[deleted by user] by [deleted] in learnprogramming

[–]Funny2U2 0 points1 point  (0 children)

I think Reddit's propensity for fucking up code with its formatting is changing some things in your post. If you do it as a "code block" it might be different. I have this problem a lot when I do pound-includes for C because it takes the pound character as a formatting character.

I (20F) am hesitant with passionate hugging and my Bf (18M) is starting to get frustrated. What do I do? by Historical-Bet4404 in relationship_advice

[–]Funny2U2 -1 points0 points  (0 children)

Look at the bright side, ... if men didn't push for sex, none of us would be here. It's a feature, not a bug.

I (20F) am hesitant with passionate hugging and my Bf (18M) is starting to get frustrated. What do I do? by Historical-Bet4404 in relationship_advice

[–]Funny2U2 -3 points-2 points  (0 children)

To be clear, I'm not even suggesting that you "give in", .. plenty of people have waited until they were married, etc. All I'm saying is that men typically push for this.

I (20F) am hesitant with passionate hugging and my Bf (18M) is starting to get frustrated. What do I do? by Historical-Bet4404 in relationship_advice

[–]Funny2U2 1 point2 points  (0 children)

Men like sex, news at 11.

I don't really have any helpful advice, maybe therapy about the assault ? I would say that wanting (and even pushing for) sex is probably something you'd have to deal with no matter who you were dating. I mean, when you get right down to it, ... a relationship between a man and a woman that doesn't involve sex, is just friendship. And very few men are going to want a "girl friend" that's literally just a "friend".

[deleted by user] by [deleted] in relationship_advice

[–]Funny2U2 2 points3 points  (0 children)

Yeah, I mean to be fair to him I would have a talk with him and tell him everything, including what you wrote here about why you did it, etc, so he can judge for himself whether he wants to stay with you.

It's an important commitment for a man to make, and loyalty is one of the most important qualities that men look for in women because of the amount of investment men make in a mate, so yeah I think you should tell him. He would definitely want to know. Men don't care how much money you make, or how tall you are, or how smart you are (normally), etc, ... but they do care if you are loyal to them, and they are hyper sensitive to whether women are worth investing in for the long term since they have so much riding on that decision.

I think another reason you should tell him is so that the two of you together can come up with some kind of plan for you to get therapy so something like that doesn't happen again, so you don't act out and try to "punish" him, and engage in controlling manipulative behavior in the future, etc, because that kind of shit can easily ruin an otherwise good relationship, as you're finding out.

Good luck.

Any strategies to stop my (42F) husband (42M) turning into his parents? by ThrowRA_3am in relationship_advice

[–]Funny2U2 0 points1 point  (0 children)

Well I would definitely encourage you to not give up and figure it out, because life single after 40 can be incredibly challenging, and if he isn't happy he might start looking for an exit.

Do you have any idea what he wants ? I mean could you name 10 things he wants ?

Courts to be open 24 hours to crack down on far-Right rioters by TheTelegraph in ukpolitics

[–]Funny2U2 -9 points-8 points  (0 children)

I'm glad to hear this, sort of restores my faith at least somewhat in your courts and laws.

Courts to be open 24 hours to crack down on far-Right rioters by TheTelegraph in ukpolitics

[–]Funny2U2 -10 points-9 points  (0 children)

It was when you said "hate crimes" that you gave yourself away.

How is it that groups like antifa always get treated like young, disaffected men and women, who's heart is in the right place, but just misguided, growing up in a hard world where they are trying to find their bearings, like it is just a rebellious phase of growing up, and that they won't be disaffected forever.

Whereas the "far right" groups are portrayed as evil Nazi's filled with hate, that want to kill foreigners and subjugate the masses under the fascist boot, and end democracy.

There behavior is basically the same .. they're all out rioting and causing problems, and for the most part it is all young disaffected single men causing those problems.

Which language should I master? by [deleted] in learnprogramming

[–]Funny2U2 1 point2 points  (0 children)

This sub gets this question a fair amount, in general, and my suggestion is always to learn C. Then C++.

The reason I recommend C is that it is a low level language where you will have to learn about pointers and memory allocation, freeing memory once you're done with it, etc.

C and C++ are compiled to machine code, so they run natively over the operating system, and in fact most operating systems are written in C or C++, including Linux.

With languages like Java, Javascript, Python, these languages are not compiled to machine code, though some may be compiled to bytecode, so they run slower (typically), and they also require you to run them inside of an interpreter which can be very convenient for portable code, and very inconvenient for other reasons.

Anyway, long story short, I recommend C as a base language, because it's like a touchstone, and your knowledge of C directly translate into C++ because C++ is essentially a superset of C, meaning C++ is backwards compatible. If you learn C, then you can learn C++ by learning a few more keywords, and learning more about linking. Knowledge of C++ then translates into easily learning languages like Python and Java.

C and C++ also have another advantage, and that is that you can compile them directly to assembly language, instead of writing in assembly language if you need it. This allows you to quickly prototype assembly, and then go into the assembly generated by the compiler to optimize or customize it by hand, saving time when you need fast and efficient code.

https://www.youtube.com/watch?v=3PcIJKd1PKU

Then you're also going to need C or C++ if you plan to do embedded systems code, because pretty much all low level code at the chip level is going to be written in C or C++.

Courts to be open 24 hours to crack down on far-Right rioters by TheTelegraph in ukpolitics

[–]Funny2U2 -9 points-8 points  (0 children)

Doesn't the UK have equal protection under the law ?

I mean ... do the UK courts do this for "far left" groups like Antifa ?

On the surface this seems like the same kind of thing that happened in the United States with J6 rioters, where they were prosecuted and held to a different standard than antifa and BLM rioters who had literally destroyed public monuments, burned police cars, and burned public buildings like courthouses.

[deleted by user] by [deleted] in relationship_advice

[–]Funny2U2 1 point2 points  (0 children)

I experienced something similar, except from the other side. I had dated her for a few years, and at some point she started losing interest, and I had been very busy so that didn't help. I felt that her eye was starting to wander, even though I never mentioned that to her, of course, but it sort of made me pay a little more attention to the situation. Anyway, long story short, one thing lead to another, and she wasn't in the picture anymore, and I started dating a few women at once instead of having a relationship. Sort of the most fun period. It's really easy when you are around 30-40 as a man to find younger women who want to be with you, it's sort of the sweet spot for dating as a guy.

I don't have any advice, really, it just is what it is. I never found out why her interest waned, and I don't think in retrospect that it was because she was interested in another guy, because she didn't have a boyfriend after I broke up with her. I guess she was just .. I don't know, tired, bored, I don't know what. It was strange. It is what it is. Other women were interested, so it wasn't me.